serenity/Userland/Applications/Run/main.cpp

26 lines
715 B
C++
Raw Normal View History

2021-01-13 12:10:00 +00:00
/*
* Copyright (c) 2021, Nick Vella <nick@nxk.io>
*
* SPDX-License-Identifier: BSD-2-Clause
2021-01-13 12:10:00 +00:00
*/
#include "RunWindow.h"
2021-11-26 22:03:54 +00:00
#include <LibCore/System.h>
#include <LibGUI/Application.h>
#include <LibGUI/Desktop.h>
2021-11-26 22:03:54 +00:00
#include <LibMain/Main.h>
2021-01-13 12:10:00 +00:00
2021-11-26 22:03:54 +00:00
ErrorOr<int> serenity_main(Main::Arguments arguments)
2021-01-13 12:10:00 +00:00
{
TRY(Core::System::pledge("stdio recvfd sendfd thread cpath rpath wpath unix proc exec"));
2021-01-13 12:10:00 +00:00
auto app = TRY(GUI::Application::create(arguments));
auto window = TRY(Run::RunWindow::try_create());
2021-01-13 12:10:00 +00:00
constexpr int margin = 16;
window->move_to(margin, GUI::Desktop::the().rect().bottom() - 1 - GUI::Desktop::the().taskbar_height() - margin - window->height());
2021-01-13 12:10:00 +00:00
window->show();
return app->exec();
}