main.cpp 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. /*
  2. * Copyright (c) 2021, Peter Elliott <pelliott@ualberta.ca>
  3. *
  4. * SPDX-License-Identifier: BSD-2-Clause
  5. */
  6. #include "DesktopStatusWindow.h"
  7. #include <LibGUI/Application.h>
  8. #include <LibGUI/Frame.h>
  9. #include <LibGUI/Painter.h>
  10. #include <LibGUI/Window.h>
  11. #include <LibGUI/WindowManagerServerConnection.h>
  12. #include <WindowServer/Window.h>
  13. #include <serenity.h>
  14. #include <stdio.h>
  15. int main(int argc, char** argv)
  16. {
  17. if (pledge("stdio recvfd sendfd rpath unix", nullptr) < 0) {
  18. perror("pledge");
  19. return 1;
  20. }
  21. auto app = GUI::Application::construct(argc, argv);
  22. // We need to obtain the WM connection here as well before the pledge shortening.
  23. GUI::WindowManagerServerConnection::the();
  24. if (pledge("stdio recvfd sendfd rpath", nullptr) < 0) {
  25. perror("pledge");
  26. return 1;
  27. }
  28. auto window = DesktopStatusWindow::construct();
  29. window->resize(28, 16);
  30. window->show();
  31. window->make_window_manager(WindowServer::WMEventMask::VirtualDesktopChanges);
  32. return app->exec();
  33. }