main.cpp 982 B

123456789101112131415161718192021222324252627282930313233
  1. /*
  2. * Copyright (c) 2021, Peter Elliott <pelliott@serenityos.org>
  3. *
  4. * SPDX-License-Identifier: BSD-2-Clause
  5. */
  6. #include "DesktopStatusWindow.h"
  7. #include <LibCore/System.h>
  8. #include <LibGUI/Application.h>
  9. #include <LibGUI/ConnectionToWindowManagerServer.h>
  10. #include <LibGUI/Painter.h>
  11. #include <LibMain/Main.h>
  12. #include <WindowServer/Window.h>
  13. ErrorOr<int> serenity_main(Main::Arguments arguments)
  14. {
  15. TRY(Core::System::pledge("stdio recvfd sendfd rpath unix"));
  16. auto app = TRY(GUI::Application::try_create(arguments));
  17. // We need to obtain the WM connection here as well before the pledge shortening.
  18. GUI::ConnectionToWindowManagerServer::the();
  19. TRY(Core::System::pledge("stdio recvfd sendfd rpath"));
  20. auto window = TRY(DesktopStatusWindow::try_create());
  21. window->set_title("WorkspacePicker");
  22. window->resize(28, 16);
  23. window->show();
  24. window->make_window_manager(WindowServer::WMEventMask::WorkspaceChanges);
  25. return app->exec();
  26. }