main.cpp 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839
  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 <LibGUI/Application.h>
  8. #include <LibGUI/Painter.h>
  9. #include <LibGUI/WindowManagerServerConnection.h>
  10. #include <WindowServer/Window.h>
  11. #include <serenity.h>
  12. #include <stdio.h>
  13. int main(int argc, char** argv)
  14. {
  15. if (pledge("stdio recvfd sendfd rpath unix", nullptr) < 0) {
  16. perror("pledge");
  17. return 1;
  18. }
  19. auto app = GUI::Application::construct(argc, argv);
  20. // We need to obtain the WM connection here as well before the pledge shortening.
  21. GUI::WindowManagerServerConnection::the();
  22. if (pledge("stdio recvfd sendfd rpath", nullptr) < 0) {
  23. perror("pledge");
  24. return 1;
  25. }
  26. auto window = DesktopStatusWindow::construct();
  27. window->set_title("WorkspacePicker");
  28. window->resize(28, 16);
  29. window->show();
  30. window->make_window_manager(WindowServer::WMEventMask::WorkspaceChanges);
  31. return app->exec();
  32. }