summaryrefslogtreecommitdiff
path: root/Userland/Applets/DesktopPicker/main.cpp
blob: a6b5d868a3555df1cdbac2220ce6f4534412c3cb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
/*
 * Copyright (c) 2021, Peter Elliott <pelliott@ualberta.ca>
 *
 * SPDX-License-Identifier: BSD-2-Clause
 */

#include "DesktopStatusWindow.h"
#include <LibGUI/Application.h>
#include <LibGUI/Painter.h>
#include <LibGUI/WindowManagerServerConnection.h>
#include <WindowServer/Window.h>
#include <serenity.h>
#include <stdio.h>

int main(int argc, char** argv)
{
    if (pledge("stdio recvfd sendfd rpath unix", nullptr) < 0) {
        perror("pledge");
        return 1;
    }

    auto app = GUI::Application::construct(argc, argv);

    // We need to obtain the WM connection here as well before the pledge shortening.
    GUI::WindowManagerServerConnection::the();

    if (pledge("stdio recvfd sendfd rpath", nullptr) < 0) {
        perror("pledge");
        return 1;
    }

    auto window = DesktopStatusWindow::construct();
    window->set_title("DesktopPicker");
    window->resize(28, 16);
    window->show();
    window->make_window_manager(WindowServer::WMEventMask::VirtualDesktopChanges);

    return app->exec();
}