1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 15:28:11 +00:00

WorkspacePicker: Hide applet if size == 0

This commit is contained in:
Filiph Sandström 2022-07-12 18:45:44 +02:00 committed by Andreas Kling
parent 3ee5bdcfb7
commit a1ddc44c07
2 changed files with 14 additions and 1 deletions

View file

@ -8,6 +8,7 @@
#include <LibCore/System.h>
#include <LibGUI/Application.h>
#include <LibGUI/ConnectionToWindowManagerServer.h>
#include <LibGUI/Desktop.h>
#include <LibGUI/Painter.h>
#include <LibMain/Main.h>
#include <WindowServer/Window.h>
@ -25,7 +26,13 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
auto window = TRY(DesktopStatusWindow::try_create());
window->set_title("WorkspacePicker");
window->resize(28, 16);
auto& desktop = GUI::Desktop::the();
if (desktop.workspace_rows() == 1 && desktop.workspace_columns() == 1)
window->resize(0, 0);
else
window->resize(28, 16);
window->show();
window->make_window_manager(WindowServer::WMEventMask::WorkspaceChanges);