summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2021-11-26 23:03:54 +0100
committerAndreas Kling <kling@serenityos.org>2021-11-26 23:27:57 +0100
commit1ded1ed963f703755f475fe4b8688f783f3a83e4 (patch)
tree55fc65cb151042424369f3a251189926fcc006f8
parent0b8fb8358e2502cf34e72444d7be5e259e937544 (diff)
downloadserenity-1ded1ed963f703755f475fe4b8688f783f3a83e4.zip
Run: Port to LibMain :^)
-rw-r--r--Userland/Applications/Run/CMakeLists.txt2
-rw-r--r--Userland/Applications/Run/main.cpp15
2 files changed, 7 insertions, 10 deletions
diff --git a/Userland/Applications/Run/CMakeLists.txt b/Userland/Applications/Run/CMakeLists.txt
index 1a4f65d4f5..0fe582ce82 100644
--- a/Userland/Applications/Run/CMakeLists.txt
+++ b/Userland/Applications/Run/CMakeLists.txt
@@ -14,4 +14,4 @@ set(SOURCES
)
serenity_app(Run ICON app-run)
-target_link_libraries(Run LibCore LibDesktop LibGUI)
+target_link_libraries(Run LibCore LibDesktop LibGUI LibMain)
diff --git a/Userland/Applications/Run/main.cpp b/Userland/Applications/Run/main.cpp
index 82ef0ee165..207839b8ec 100644
--- a/Userland/Applications/Run/main.cpp
+++ b/Userland/Applications/Run/main.cpp
@@ -5,20 +5,17 @@
*/
#include "RunWindow.h"
-#include <AK/StringBuilder.h>
+#include <LibCore/System.h>
#include <LibGUI/Application.h>
#include <LibGUI/Desktop.h>
-#include <unistd.h>
+#include <LibMain/Main.h>
-int main(int argc, char** argv)
+ErrorOr<int> serenity_main(Main::Arguments arguments)
{
- if (pledge("stdio recvfd sendfd thread cpath rpath wpath unix proc exec", nullptr) < 0) {
- perror("pledge");
- return 1;
- }
+ TRY(Core::System::pledge("stdio recvfd sendfd thread cpath rpath wpath unix proc exec", nullptr));
- auto app = GUI::Application::construct(argc, argv);
- auto window = RunWindow::construct();
+ auto app = TRY(GUI::Application::try_create(arguments));
+ auto window = TRY(RunWindow::try_create());
window->move_to(16, GUI::Desktop::the().rect().bottom() - GUI::Desktop::the().taskbar_height() - 16 - window->height());
window->show();