mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 01:17:36 +00:00
WorkspacePicker: Port to LibMain :^)
This commit is contained in:
parent
51484bec82
commit
24bf74a177
2 changed files with 8 additions and 14 deletions
|
@ -10,4 +10,4 @@ set(SOURCES
|
||||||
)
|
)
|
||||||
|
|
||||||
serenity_bin(WorkspacePicker.Applet)
|
serenity_bin(WorkspacePicker.Applet)
|
||||||
target_link_libraries(WorkspacePicker.Applet LibGUI LibCore LibGfx)
|
target_link_libraries(WorkspacePicker.Applet LibGUI LibCore LibGfx LibMain)
|
||||||
|
|
|
@ -5,31 +5,25 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "DesktopStatusWindow.h"
|
#include "DesktopStatusWindow.h"
|
||||||
|
#include <LibCore/System.h>
|
||||||
#include <LibGUI/Application.h>
|
#include <LibGUI/Application.h>
|
||||||
#include <LibGUI/Painter.h>
|
#include <LibGUI/Painter.h>
|
||||||
#include <LibGUI/WindowManagerServerConnection.h>
|
#include <LibGUI/WindowManagerServerConnection.h>
|
||||||
|
#include <LibMain/Main.h>
|
||||||
#include <WindowServer/Window.h>
|
#include <WindowServer/Window.h>
|
||||||
#include <serenity.h>
|
|
||||||
#include <stdio.h>
|
|
||||||
|
|
||||||
int main(int argc, char** argv)
|
ErrorOr<int> serenity_main(Main::Arguments arguments)
|
||||||
{
|
{
|
||||||
if (pledge("stdio recvfd sendfd rpath unix", nullptr) < 0) {
|
TRY(Core::System::pledge("stdio recvfd sendfd rpath unix", nullptr));
|
||||||
perror("pledge");
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
auto app = GUI::Application::construct(argc, argv);
|
auto app = TRY(GUI::Application::try_create(arguments));
|
||||||
|
|
||||||
// We need to obtain the WM connection here as well before the pledge shortening.
|
// We need to obtain the WM connection here as well before the pledge shortening.
|
||||||
GUI::WindowManagerServerConnection::the();
|
GUI::WindowManagerServerConnection::the();
|
||||||
|
|
||||||
if (pledge("stdio recvfd sendfd rpath", nullptr) < 0) {
|
TRY(Core::System::pledge("stdio recvfd sendfd rpath", nullptr));
|
||||||
perror("pledge");
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
auto window = DesktopStatusWindow::construct();
|
auto window = TRY(DesktopStatusWindow::try_create());
|
||||||
window->set_title("WorkspacePicker");
|
window->set_title("WorkspacePicker");
|
||||||
window->resize(28, 16);
|
window->resize(28, 16);
|
||||||
window->show();
|
window->show();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue