mirror of
https://github.com/SerenityOS/serenity.git
synced 2025-01-22 17:31:58 -05:00
582bf1eaf3
The set_main_widget<T>() function only calls the construct and not `try_create()` that the GMLCompiler generates so all calls to `find_descendant_of_type_named()` would result in null pointers that would resolve in a crash.
25 lines
715 B
C++
25 lines
715 B
C++
/*
|
|
* Copyright (c) 2021, Nick Vella <nick@nxk.io>
|
|
*
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
*/
|
|
|
|
#include "RunWindow.h"
|
|
#include <LibCore/System.h>
|
|
#include <LibGUI/Application.h>
|
|
#include <LibGUI/Desktop.h>
|
|
#include <LibMain/Main.h>
|
|
|
|
ErrorOr<int> serenity_main(Main::Arguments arguments)
|
|
{
|
|
TRY(Core::System::pledge("stdio recvfd sendfd thread cpath rpath wpath unix proc exec"));
|
|
|
|
auto app = TRY(GUI::Application::create(arguments));
|
|
auto window = TRY(Run::RunWindow::try_create());
|
|
|
|
constexpr int margin = 16;
|
|
window->move_to(margin, GUI::Desktop::the().rect().bottom() - 1 - GUI::Desktop::the().taskbar_height() - margin - window->height());
|
|
window->show();
|
|
|
|
return app->exec();
|
|
}
|