summaryrefslogtreecommitdiff
path: root/Userland
diff options
context:
space:
mode:
authorLucas CHOLLET <lucas.chollet@free.fr>2023-05-05 00:24:53 -0400
committerSam Atkins <atkinssj@gmail.com>2023-05-05 16:41:21 +0100
commit1a97382305f517dcc4c4f71746b6ab5d96012b0d (patch)
tree71bc8573bea401d8a27847c1dadeeceb518fd1a0 /Userland
parentf132751faeaa486c3eebc1ed23117efe9701da22 (diff)
downloadserenity-1a97382305f517dcc4c4f71746b6ab5d96012b0d.zip
LibGUI: Make `Application`'s construction fallible
The pattern to construct `Application` was to use the `try_create` method from the `C_OBJECT` macro. While being safe from an OOM perspective, this method doesn't propagate errors from the constructor. This patch make `Application` use the `C_OBJECT_ABSTRACT` and manually define a `create` method that can bubble up errors from the construction stage. This commit also removes the ability to use `argc` and `argv` to create an `Application`, only `Main`'s `Arguments` can be used. From a user point of view, the patch renames `try_create` => `create`, hence the huge number of modified files.
Diffstat (limited to 'Userland')
-rw-r--r--Userland/Applets/Audio/main.cpp2
-rw-r--r--Userland/Applets/ClipboardHistory/main.cpp2
-rw-r--r--Userland/Applets/Keymap/main.cpp2
-rw-r--r--Userland/Applets/Network/main.cpp2
-rw-r--r--Userland/Applets/ResourceGraph/main.cpp2
-rw-r--r--Userland/Applets/WorkspacePicker/main.cpp2
-rw-r--r--Userland/Applications/3DFileViewer/main.cpp2
-rw-r--r--Userland/Applications/About/main.cpp2
-rw-r--r--Userland/Applications/AnalogClock/main.cpp2
-rw-r--r--Userland/Applications/Assistant/main.cpp2
-rw-r--r--Userland/Applications/Browser/main.cpp2
-rw-r--r--Userland/Applications/BrowserSettings/main.cpp2
-rw-r--r--Userland/Applications/Calculator/main.cpp2
-rw-r--r--Userland/Applications/Calendar/main.cpp2
-rw-r--r--Userland/Applications/CalendarSettings/main.cpp2
-rw-r--r--Userland/Applications/CertificateSettings/main.cpp2
-rw-r--r--Userland/Applications/CharacterMap/main.cpp2
-rw-r--r--Userland/Applications/ClockSettings/main.cpp2
-rw-r--r--Userland/Applications/CrashReporter/main.cpp2
-rw-r--r--Userland/Applications/DisplaySettings/main.cpp2
-rw-r--r--Userland/Applications/Escalator/main.cpp2
-rw-r--r--Userland/Applications/FileManager/main.cpp2
-rw-r--r--Userland/Applications/FontEditor/main.cpp2
-rw-r--r--Userland/Applications/GamesSettings/main.cpp2
-rw-r--r--Userland/Applications/Help/main.cpp2
-rw-r--r--Userland/Applications/HexEditor/main.cpp2
-rw-r--r--Userland/Applications/ImageViewer/main.cpp2
-rw-r--r--Userland/Applications/KeyboardMapper/main.cpp2
-rw-r--r--Userland/Applications/KeyboardSettings/main.cpp2
-rw-r--r--Userland/Applications/Magnifier/main.cpp2
-rw-r--r--Userland/Applications/Mail/main.cpp2
-rw-r--r--Userland/Applications/MailSettings/main.cpp2
-rw-r--r--Userland/Applications/MouseSettings/main.cpp2
-rw-r--r--Userland/Applications/NetworkSettings/main.cpp2
-rw-r--r--Userland/Applications/PDFViewer/main.cpp2
-rw-r--r--Userland/Applications/PartitionEditor/main.cpp2
-rw-r--r--Userland/Applications/Piano/main.cpp2
-rw-r--r--Userland/Applications/PixelPaint/main.cpp2
-rw-r--r--Userland/Applications/Presenter/main.cpp2
-rw-r--r--Userland/Applications/Run/main.cpp2
-rw-r--r--Userland/Applications/Settings/main.cpp2
-rw-r--r--Userland/Applications/SoundPlayer/main.cpp2
-rw-r--r--Userland/Applications/SpaceAnalyzer/main.cpp2
-rw-r--r--Userland/Applications/Spreadsheet/main.cpp2
-rw-r--r--Userland/Applications/SystemMonitor/main.cpp2
-rw-r--r--Userland/Applications/Terminal/main.cpp2
-rw-r--r--Userland/Applications/TerminalSettings/main.cpp2
-rw-r--r--Userland/Applications/TextEditor/main.cpp2
-rw-r--r--Userland/Applications/ThemeEditor/main.cpp2
-rw-r--r--Userland/Applications/VideoPlayer/main.cpp2
-rw-r--r--Userland/Applications/Welcome/main.cpp2
-rw-r--r--Userland/Demos/CatDog/main.cpp2
-rw-r--r--Userland/Demos/Eyes/main.cpp2
-rw-r--r--Userland/Demos/Gradient/Gradient.cpp2
-rw-r--r--Userland/Demos/LibGfxDemo/main.cpp2
-rw-r--r--Userland/Demos/LibGfxScaleDemo/main.cpp2
-rw-r--r--Userland/Demos/Mandelbrot/Mandelbrot.cpp2
-rw-r--r--Userland/Demos/ModelGallery/main.cpp2
-rw-r--r--Userland/Demos/Screensaver/main.cpp2
-rw-r--r--Userland/Demos/Starfield/Starfield.cpp2
-rw-r--r--Userland/Demos/Tubes/main.cpp2
-rw-r--r--Userland/Demos/WidgetGallery/main.cpp2
-rw-r--r--Userland/DevTools/GMLPlayground/main.cpp2
-rw-r--r--Userland/DevTools/HackStudio/main.cpp2
-rw-r--r--Userland/DevTools/Profiler/main.cpp2
-rw-r--r--Userland/DevTools/SQLStudio/main.cpp2
-rw-r--r--Userland/Games/2048/main.cpp2
-rw-r--r--Userland/Games/BrickGame/main.cpp2
-rw-r--r--Userland/Games/Chess/main.cpp2
-rw-r--r--Userland/Games/ColorLines/main.cpp2
-rw-r--r--Userland/Games/FlappyBug/main.cpp2
-rw-r--r--Userland/Games/Flood/main.cpp2
-rw-r--r--Userland/Games/GameOfLife/main.cpp2
-rw-r--r--Userland/Games/Hearts/main.cpp2
-rw-r--r--Userland/Games/MasterWord/main.cpp2
-rw-r--r--Userland/Games/Minesweeper/main.cpp2
-rw-r--r--Userland/Games/Snake/main.cpp2
-rw-r--r--Userland/Games/Solitaire/main.cpp2
-rw-r--r--Userland/Games/Spider/main.cpp2
-rw-r--r--Userland/Libraries/LibGUI/Application.cpp44
-rw-r--r--Userland/Libraries/LibGUI/Application.h10
-rw-r--r--Userland/Services/FileSystemAccessServer/main.cpp4
-rw-r--r--Userland/Services/LoginServer/main.cpp2
-rw-r--r--Userland/Services/NotificationServer/main.cpp2
-rw-r--r--Userland/Services/Taskbar/main.cpp2
-rw-r--r--Userland/Utilities/chres.cpp3
-rw-r--r--Userland/Utilities/copy.cpp2
-rw-r--r--Userland/Utilities/notify.cpp2
-rw-r--r--Userland/Utilities/paste.cpp2
-rw-r--r--Userland/Utilities/shot.cpp2
-rw-r--r--Userland/Utilities/wallpaper.cpp2
-rw-r--r--Userland/Utilities/wsctl.cpp2
92 files changed, 120 insertions, 117 deletions
diff --git a/Userland/Applets/Audio/main.cpp b/Userland/Applets/Audio/main.cpp
index 229b22ebd7..8bce27ab30 100644
--- a/Userland/Applets/Audio/main.cpp
+++ b/Userland/Applets/Audio/main.cpp
@@ -231,7 +231,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
{
TRY(Core::System::pledge("stdio recvfd sendfd rpath wpath cpath unix thread"));
- auto app = TRY(GUI::Application::try_create(arguments));
+ auto app = TRY(GUI::Application::create(arguments));
Config::pledge_domain("AudioApplet");
TRY(Core::System::unveil("/tmp/session/%sid/portal/audio", "rw"));
TRY(Core::System::unveil("/res", "r"));
diff --git a/Userland/Applets/ClipboardHistory/main.cpp b/Userland/Applets/ClipboardHistory/main.cpp
index bea6d1f8e6..95a16d105b 100644
--- a/Userland/Applets/ClipboardHistory/main.cpp
+++ b/Userland/Applets/ClipboardHistory/main.cpp
@@ -18,7 +18,7 @@
ErrorOr<int> serenity_main(Main::Arguments arguments)
{
TRY(Core::System::pledge("stdio recvfd sendfd rpath unix"));
- auto app = TRY(GUI::Application::try_create(arguments));
+ auto app = TRY(GUI::Application::create(arguments));
Config::pledge_domain("ClipboardHistory");
Config::monitor_domain("ClipboardHistory");
diff --git a/Userland/Applets/Keymap/main.cpp b/Userland/Applets/Keymap/main.cpp
index 616e76f1ef..2fd0c7d826 100644
--- a/Userland/Applets/Keymap/main.cpp
+++ b/Userland/Applets/Keymap/main.cpp
@@ -15,7 +15,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
{
TRY(Core::System::pledge("stdio recvfd sendfd rpath unix getkeymap proc exec"));
- auto app = TRY(GUI::Application::try_create(arguments));
+ auto app = TRY(GUI::Application::create(arguments));
auto window = TRY(KeymapStatusWindow::try_create());
window->set_has_alpha_channel(true);
diff --git a/Userland/Applets/Network/main.cpp b/Userland/Applets/Network/main.cpp
index b361d983e9..e073fcc038 100644
--- a/Userland/Applets/Network/main.cpp
+++ b/Userland/Applets/Network/main.cpp
@@ -164,7 +164,7 @@ private:
ErrorOr<int> serenity_main(Main::Arguments arguments)
{
TRY(Core::System::pledge("stdio recvfd sendfd rpath unix proc exec"));
- auto app = TRY(GUI::Application::try_create(arguments));
+ auto app = TRY(GUI::Application::create(arguments));
TRY(Core::System::unveil("/tmp/session/%sid/portal/notify", "rw"));
TRY(Core::System::unveil("/res", "r"));
diff --git a/Userland/Applets/ResourceGraph/main.cpp b/Userland/Applets/ResourceGraph/main.cpp
index 836a1e7d39..7008d995b1 100644
--- a/Userland/Applets/ResourceGraph/main.cpp
+++ b/Userland/Applets/ResourceGraph/main.cpp
@@ -239,7 +239,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
{
TRY(Core::System::pledge("stdio recvfd sendfd proc exec rpath unix"));
- auto app = TRY(GUI::Application::try_create(arguments));
+ auto app = TRY(GUI::Application::create(arguments));
TRY(Core::System::pledge("stdio recvfd sendfd proc exec rpath"));
diff --git a/Userland/Applets/WorkspacePicker/main.cpp b/Userland/Applets/WorkspacePicker/main.cpp
index 028189ba5f..b9ec4bc442 100644
--- a/Userland/Applets/WorkspacePicker/main.cpp
+++ b/Userland/Applets/WorkspacePicker/main.cpp
@@ -17,7 +17,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
{
TRY(Core::System::pledge("stdio recvfd sendfd rpath proc exec unix"));
- auto app = TRY(GUI::Application::try_create(arguments));
+ auto app = TRY(GUI::Application::create(arguments));
app->set_quit_when_last_window_deleted(false);
// We need to obtain the WM connection here as well before the pledge shortening.
diff --git a/Userland/Applications/3DFileViewer/main.cpp b/Userland/Applications/3DFileViewer/main.cpp
index 6f618a8c1f..f1b32c7ea6 100644
--- a/Userland/Applications/3DFileViewer/main.cpp
+++ b/Userland/Applications/3DFileViewer/main.cpp
@@ -348,7 +348,7 @@ bool GLContextWidget::load_file(String const& filename, NonnullOwnPtr<Core::File
ErrorOr<int> serenity_main(Main::Arguments arguments)
{
- auto app = TRY(GUI::Application::try_create(arguments));
+ auto app = TRY(GUI::Application::create(arguments));
TRY(Core::System::pledge("stdio thread recvfd sendfd rpath unix prot_exec map_fixed"));
diff --git a/Userland/Applications/About/main.cpp b/Userland/Applications/About/main.cpp
index ea3ee7c03a..72805f84b7 100644
--- a/Userland/Applications/About/main.cpp
+++ b/Userland/Applications/About/main.cpp
@@ -14,7 +14,7 @@
ErrorOr<int> serenity_main(Main::Arguments arguments)
{
TRY(Core::System::pledge("stdio recvfd sendfd rpath unix"));
- auto app = TRY(GUI::Application::try_create(arguments));
+ auto app = TRY(GUI::Application::create(arguments));
TRY(Core::System::pledge("stdio recvfd sendfd rpath"));
TRY(Core::System::unveil("/res", "r"));
diff --git a/Userland/Applications/AnalogClock/main.cpp b/Userland/Applications/AnalogClock/main.cpp
index fefa207ed8..9331f7a7a2 100644
--- a/Userland/Applications/AnalogClock/main.cpp
+++ b/Userland/Applications/AnalogClock/main.cpp
@@ -17,7 +17,7 @@
ErrorOr<int> serenity_main(Main::Arguments arguments)
{
- auto app = TRY(GUI::Application::try_create(arguments));
+ auto app = TRY(GUI::Application::create(arguments));
TRY(Core::System::pledge("stdio recvfd sendfd rpath"));
TRY(Core::System::unveil("/etc/timezone", "r"));
diff --git a/Userland/Applications/Assistant/main.cpp b/Userland/Applications/Assistant/main.cpp
index 0242f98097..752eff40de 100644
--- a/Userland/Applications/Assistant/main.cpp
+++ b/Userland/Applications/Assistant/main.cpp
@@ -160,7 +160,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
return 0;
}
- auto app = TRY(GUI::Application::try_create(arguments));
+ auto app = TRY(GUI::Application::create(arguments));
auto window = GUI::Window::construct();
window->set_minimizable(false);
diff --git a/Userland/Applications/Browser/main.cpp b/Userland/Applications/Browser/main.cpp
index 8744fc7fab..6a8127c32d 100644
--- a/Userland/Applications/Browser/main.cpp
+++ b/Userland/Applications/Browser/main.cpp
@@ -102,7 +102,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
args_parser.parse(arguments);
- auto app = TRY(GUI::Application::try_create(arguments));
+ auto app = TRY(GUI::Application::create(arguments));
Config::pledge_domain("Browser");
Config::monitor_domain("Browser");
diff --git a/Userland/Applications/BrowserSettings/main.cpp b/Userland/Applications/BrowserSettings/main.cpp
index 9fa6b1d7d3..f354e8b40e 100644
--- a/Userland/Applications/BrowserSettings/main.cpp
+++ b/Userland/Applications/BrowserSettings/main.cpp
@@ -18,7 +18,7 @@
ErrorOr<int> serenity_main(Main::Arguments arguments)
{
TRY(Core::System::pledge("stdio rpath wpath cpath recvfd sendfd unix"));
- auto app = TRY(GUI::Application::try_create(arguments));
+ auto app = TRY(GUI::Application::create(arguments));
Config::pledge_domain("Browser");
StringView selected_tab;
diff --git a/Userland/Applications/Calculator/main.cpp b/Userland/Applications/Calculator/main.cpp
index 13e19e4add..293578e682 100644
--- a/Userland/Applications/Calculator/main.cpp
+++ b/Userland/Applications/Calculator/main.cpp
@@ -22,7 +22,7 @@
ErrorOr<int> serenity_main(Main::Arguments arguments)
{
TRY(Core::System::pledge("stdio recvfd sendfd rpath unix"));
- auto app = TRY(GUI::Application::try_create(arguments));
+ auto app = TRY(GUI::Application::create(arguments));
TRY(Core::System::pledge("stdio recvfd sendfd rpath"));
TRY(Core::System::unveil("/res", "r"));
diff --git a/Userland/Applications/Calendar/main.cpp b/Userland/Applications/Calendar/main.cpp
index 7b4d9afd6c..05837cedc6 100644
--- a/Userland/Applications/Calendar/main.cpp
+++ b/Userland/Applications/Calendar/main.cpp
@@ -25,7 +25,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
{
TRY(Core::System::pledge("stdio recvfd sendfd rpath proc exec unix"));
- auto app = TRY(GUI::Application::try_create(arguments));
+ auto app = TRY(GUI::Application::create(arguments));
Config::pledge_domain("Calendar");
Config::monitor_domain("Calendar");
diff --git a/Userland/Applications/CalendarSettings/main.cpp b/Userland/Applications/CalendarSettings/main.cpp
index bbe1bd314b..952c4d1475 100644
--- a/Userland/Applications/CalendarSettings/main.cpp
+++ b/Userland/Applications/CalendarSettings/main.cpp
@@ -17,7 +17,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
{
TRY(Core::System::pledge("stdio rpath recvfd sendfd unix"));
- auto app = TRY(GUI::Application::try_create(arguments));
+ auto app = TRY(GUI::Application::create(arguments));
Config::pledge_domain("Calendar");
diff --git a/Userland/Applications/CertificateSettings/main.cpp b/Userland/Applications/CertificateSettings/main.cpp
index 8be7108e89..8eb549cb04 100644
--- a/Userland/Applications/CertificateSettings/main.cpp
+++ b/Userland/Applications/CertificateSettings/main.cpp
@@ -17,7 +17,7 @@ ErrorOr<int> serenity_main(Main::Arguments args)
{
TRY(Core::System::pledge("stdio rpath wpath cpath recvfd sendfd unix"));
- auto app = TRY(GUI::Application::try_create(args));
+ auto app = TRY(GUI::Application::create(args));
TRY(Core::System::unveil(TRY(String::formatted("{}/.config/certs.pem", Core::StandardPaths::home_directory())), "rwc"_short_string));
TRY(Core::System::unveil("/tmp/session/%sid/portal/filesystemaccess", "rw"));
diff --git a/Userland/Applications/CharacterMap/main.cpp b/Userland/Applications/CharacterMap/main.cpp
index 2a0530ddfd..0702feae49 100644
--- a/Userland/Applications/CharacterMap/main.cpp
+++ b/Userland/Applications/CharacterMap/main.cpp
@@ -43,7 +43,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
{
TRY(Core::System::pledge("stdio recvfd sendfd rpath unix"));
- auto app = TRY(GUI::Application::try_create(arguments));
+ auto app = TRY(GUI::Application::create(arguments));
Config::pledge_domain("CharacterMap");
TRY(Desktop::Launcher::add_allowed_handler_with_only_specific_urls("/bin/Help", { URL::create_with_file_scheme("/usr/share/man/man1/Applications/CharacterMap.md") }));
diff --git a/Userland/Applications/ClockSettings/main.cpp b/Userland/Applications/ClockSettings/main.cpp
index 9b480d6ebf..c5a44b2f4c 100644
--- a/Userland/Applications/ClockSettings/main.cpp
+++ b/Userland/Applications/ClockSettings/main.cpp
@@ -18,7 +18,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
{
TRY(Core::System::pledge("stdio rpath recvfd sendfd unix proc exec"));
- auto app = TRY(GUI::Application::try_create(arguments));
+ auto app = TRY(GUI::Application::create(arguments));
Config::pledge_domain("Taskbar");
diff --git a/Userland/Applications/CrashReporter/main.cpp b/Userland/Applications/CrashReporter/main.cpp
index 42bdfa8d65..4d2b3e8641 100644
--- a/Userland/Applications/CrashReporter/main.cpp
+++ b/Userland/Applications/CrashReporter/main.cpp
@@ -160,7 +160,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
{
TRY(Core::System::pledge("stdio recvfd sendfd cpath rpath unix proc exec thread"));
- auto app = TRY(GUI::Application::try_create(arguments));
+ auto app = TRY(GUI::Application::create(arguments));
DeprecatedString coredump_path {};
bool unlink_on_exit = false;
diff --git a/Userland/Applications/DisplaySettings/main.cpp b/Userland/Applications/DisplaySettings/main.cpp
index 2985a2d407..5d530c937f 100644
--- a/Userland/Applications/DisplaySettings/main.cpp
+++ b/Userland/Applications/DisplaySettings/main.cpp
@@ -24,7 +24,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
{
TRY(Core::System::pledge("stdio thread recvfd sendfd rpath cpath wpath unix proc exec"));
- auto app = TRY(GUI::Application::try_create(arguments));
+ auto app = TRY(GUI::Application::create(arguments));
Config::pledge_domain("WindowManager");
StringView selected_tab;
diff --git a/Userland/Applications/Escalator/main.cpp b/Userland/Applications/Escalator/main.cpp
index 1f1464162b..806bba33b4 100644
--- a/Userland/Applications/Escalator/main.cpp
+++ b/Userland/Applications/Escalator/main.cpp
@@ -31,7 +31,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
TRY(Core::System::pledge("stdio recvfd sendfd thread cpath rpath wpath unix proc exec id"));
- auto app = TRY(GUI::Application::try_create(arguments));
+ auto app = TRY(GUI::Application::create(arguments));
auto executable_path = FileSystem::resolve_executable_from_environment(command[0]);
if (executable_path.is_error()) {
diff --git a/Userland/Applications/FileManager/main.cpp b/Userland/Applications/FileManager/main.cpp
index f0b876158a..68f96811c9 100644
--- a/Userland/Applications/FileManager/main.cpp
+++ b/Userland/Applications/FileManager/main.cpp
@@ -89,7 +89,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
args_parser.add_positional_argument(initial_location, "Path to open", "path", Core::ArgsParser::Required::No);
args_parser.parse(arguments);
- auto app = TRY(GUI::Application::try_create(arguments));
+ auto app = TRY(GUI::Application::create(arguments));
TRY(Core::System::pledge("stdio thread recvfd sendfd cpath rpath wpath fattr proc exec unix"));
diff --git a/Userland/Applications/FontEditor/main.cpp b/Userland/Applications/FontEditor/main.cpp
index e4326385b2..22bd4a1297 100644
--- a/Userland/Applications/FontEditor/main.cpp
+++ b/Userland/Applications/FontEditor/main.cpp
@@ -21,7 +21,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
{
TRY(Core::System::pledge("stdio recvfd sendfd thread rpath unix cpath wpath"));
- auto app = TRY(GUI::Application::try_create(arguments));
+ auto app = TRY(GUI::Application::create(arguments));
TRY(Desktop::Launcher::add_allowed_handler_with_only_specific_urls("/bin/Help", { URL::create_with_file_scheme("/usr/share/man/man1/Applications/FontEditor.md") }));
TRY(Desktop::Launcher::seal_allowlist());
diff --git a/Userland/Applications/GamesSettings/main.cpp b/Userland/Applications/GamesSettings/main.cpp
index f15e3f50bf..7e22533c77 100644
--- a/Userland/Applications/GamesSettings/main.cpp
+++ b/Userland/Applications/GamesSettings/main.cpp
@@ -17,7 +17,7 @@
ErrorOr<int> serenity_main(Main::Arguments arguments)
{
TRY(Core::System::pledge("stdio rpath recvfd sendfd unix thread"));
- auto app = TRY(GUI::Application::try_create(arguments));
+ auto app = TRY(GUI::Application::create(arguments));
Config::pledge_domain("Games");
StringView selected_tab;
diff --git a/Userland/Applications/Help/main.cpp b/Userland/Applications/Help/main.cpp
index 20fa5a3809..cdaa6ff859 100644
--- a/Userland/Applications/Help/main.cpp
+++ b/Userland/Applications/Help/main.cpp
@@ -21,7 +21,7 @@ using namespace Help;
ErrorOr<int> serenity_main(Main::Arguments arguments)
{
TRY(Core::System::pledge("stdio recvfd sendfd rpath unix"));
- auto app = TRY(GUI::Application::try_create(arguments));
+ auto app = TRY(GUI::Application::create(arguments));
TRY(Core::System::unveil("/res", "r"));
// We specifically don't want to load this path from a library, as that can be hijacked with LD_PRELOAD.
diff --git a/Userland/Applications/HexEditor/main.cpp b/Userland/Applications/HexEditor/main.cpp
index 7d9bf8c244..7a55832e16 100644
--- a/Userland/Applications/HexEditor/main.cpp
+++ b/Userland/Applications/HexEditor/main.cpp
@@ -22,7 +22,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
{
TRY(Core::System::pledge("stdio recvfd sendfd rpath unix cpath wpath thread"));
- auto app = TRY(GUI::Application::try_create(arguments));
+ auto app = TRY(GUI::Application::create(arguments));
TRY(Desktop::Launcher::add_allowed_handler_with_only_specific_urls("/bin/Help", { URL::create_with_file_scheme("/usr/share/man/man1/Applications/HexEditor.md") }));
TRY(Desktop::Launcher::seal_allowlist());
diff --git a/Userland/Applications/ImageViewer/main.cpp b/Userland/Applications/ImageViewer/main.cpp
index bf23daa3f2..f77a72cee7 100644
--- a/Userland/Applications/ImageViewer/main.cpp
+++ b/Userland/Applications/ImageViewer/main.cpp
@@ -41,7 +41,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
{
TRY(Core::System::pledge("stdio recvfd sendfd rpath wpath cpath unix thread"));
- auto app = TRY(GUI::Application::try_create(arguments));
+ auto app = TRY(GUI::Application::create(arguments));
Config::pledge_domains({ "ImageViewer", "WindowManager" });
diff --git a/Userland/Applications/KeyboardMapper/main.cpp b/Userland/Applications/KeyboardMapper/main.cpp
index 22f4a75c5c..4e3e613d6a 100644
--- a/Userland/Applications/KeyboardMapper/main.cpp
+++ b/Userland/Applications/KeyboardMapper/main.cpp
@@ -25,7 +25,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
TRY(Core::System::pledge("stdio getkeymap thread rpath cpath wpath recvfd sendfd unix"));
- auto app = TRY(GUI::Application::try_create(arguments));
+ auto app = TRY(GUI::Application::create(arguments));
TRY(Core::System::pledge("stdio getkeymap thread rpath cpath wpath recvfd sendfd"));
diff --git a/Userland/Applications/KeyboardSettings/main.cpp b/Userland/Applications/KeyboardSettings/main.cpp
index b34c2ba13d..ece5c18182 100644
--- a/Userland/Applications/KeyboardSettings/main.cpp
+++ b/Userland/Applications/KeyboardSettings/main.cpp
@@ -16,7 +16,7 @@
ErrorOr<int> serenity_main(Main::Arguments arguments)
{
TRY(Core::System::pledge("stdio rpath recvfd sendfd unix proc exec"));
- auto app = TRY(GUI::Application::try_create(arguments));
+ auto app = TRY(GUI::Application::create(arguments));
Config::pledge_domain("KeyboardSettings");
StringView selected_tab;
diff --git a/Userland/Applications/Magnifier/main.cpp b/Userland/Applications/Magnifier/main.cpp
index 3b3e46e607..3581bdbe14 100644
--- a/Userland/Applications/Magnifier/main.cpp
+++ b/Userland/Applications/Magnifier/main.cpp
@@ -40,7 +40,7 @@ static ErrorOr<ByteBuffer> dump_bitmap(RefPtr<Gfx::Bitmap> bitmap, AK::StringVie
ErrorOr<int> serenity_main(Main::Arguments arguments)
{
TRY(Core::System::pledge("stdio cpath rpath recvfd sendfd unix"));
- auto app = TRY(GUI::Application::try_create(arguments));
+ auto app = TRY(GUI::Application::create(arguments));
TRY(Desktop::Launcher::add_allowed_handler_with_only_specific_urls("/bin/Help", { URL::create_with_file_scheme("/usr/share/man/man1/Applications/Magnifier.md") }));
TRY(Desktop::Launcher::seal_allowlist());
diff --git a/Userland/Applications/Mail/main.cpp b/Userland/Applications/Mail/main.cpp
index 123d789a4b..4d7f90fedf 100644
--- a/Userland/Applications/Mail/main.cpp
+++ b/Userland/Applications/Mail/main.cpp
@@ -20,7 +20,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
{
TRY(Core::System::pledge("stdio recvfd sendfd rpath unix inet"));
- auto app = TRY(GUI::Application::try_create(arguments));
+ auto app = TRY(GUI::Application::create(arguments));
Config::pledge_domain("Mail");
diff --git a/Userland/Applications/MailSettings/main.cpp b/Userland/Applications/MailSettings/main.cpp
index 6146d81885..8e6af3c280 100644
--- a/Userland/Applications/MailSettings/main.cpp
+++ b/Userland/Applications/MailSettings/main.cpp
@@ -18,7 +18,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
{
TRY(Core::System::pledge("stdio rpath recvfd sendfd unix"));
- auto app = TRY(GUI::Application::try_create(arguments));
+ auto app = TRY(GUI::Application::create(arguments));
Config::pledge_domain("Mail");
diff --git a/Userland/Applications/MouseSettings/main.cpp b/Userland/Applications/MouseSettings/main.cpp
index 852e77429e..6410b7e432 100644
--- a/Userland/Applications/MouseSettings/main.cpp
+++ b/Userland/Applications/MouseSettings/main.cpp
@@ -22,7 +22,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
{
TRY(Core::System::pledge("stdio cpath rpath recvfd sendfd unix"));
- auto app = TRY(GUI::Application::try_create(arguments));
+ auto app = TRY(GUI::Application::create(arguments));
TRY(Core::System::pledge("stdio cpath rpath recvfd sendfd"));
diff --git a/Userland/Applications/NetworkSettings/main.cpp b/Userland/Applications/NetworkSettings/main.cpp
index 2c78fdc633..692d8a6c61 100644
--- a/Userland/Applications/NetworkSettings/main.cpp
+++ b/Userland/Applications/NetworkSettings/main.cpp
@@ -33,7 +33,7 @@ ErrorOr<int> serenity_main(Main::Arguments args)
parser.add_positional_argument(adapter, "Adapter to display settings for", "adapter", Core::ArgsParser::Required::No);
parser.parse(args);
- auto app = TRY(GUI::Application::try_create(args));
+ auto app = TRY(GUI::Application::create(args));
if (getuid() != 0) {
GUI::MessageBox::show_error(nullptr, "You need to be root to run Network Settings!"sv);
diff --git a/Userland/Applications/PDFViewer/main.cpp b/Userland/Applications/PDFViewer/main.cpp
index 456249e100..1910989797 100644
--- a/Userland/Applications/PDFViewer/main.cpp
+++ b/Userland/Applications/PDFViewer/main.cpp
@@ -23,7 +23,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
args_parser.add_positional_argument(file_path, "PDF file to open", "path", Core::ArgsParser::Required::No);
args_parser.parse(arguments);
- auto app = TRY(GUI::Application::try_create(arguments));
+ auto app = TRY(GUI::Application::create(arguments));
auto app_icon = GUI::Icon::default_icon("app-pdf-viewer"sv);
Config::pledge_domain("PDFViewer");
diff --git a/Userland/Applications/PartitionEditor/main.cpp b/Userland/Applications/PartitionEditor/main.cpp
index 5316366750..77a0a2c604 100644
--- a/Userland/Applications/PartitionEditor/main.cpp
+++ b/Userland/Applications/PartitionEditor/main.cpp
@@ -41,7 +41,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
TRY(Core::System::pledge("stdio recvfd sendfd rpath unix"));
- auto app = TRY(GUI::Application::try_create(arguments));
+ auto app = TRY(GUI::Application::create(arguments));
TRY(Core::System::pledge("stdio recvfd sendfd rpath"));
diff --git a/Userland/Applications/Piano/main.cpp b/Userland/Applications/Piano/main.cpp
index b3f386cbfa..8aa79b0f4d 100644
--- a/Userland/Applications/Piano/main.cpp
+++ b/Userland/Applications/Piano/main.cpp
@@ -31,7 +31,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
{
TRY(Core::System::pledge("stdio thread proc rpath cpath wpath recvfd sendfd unix"));
- auto app = TRY(GUI::Application::try_create(arguments));
+ auto app = TRY(GUI::Application::create(arguments));
TrackManager track_manager;
diff --git a/Userland/Applications/PixelPaint/main.cpp b/Userland/Applications/PixelPaint/main.cpp
index ec5130e163..cc359811a2 100644
--- a/Userland/Applications/PixelPaint/main.cpp
+++ b/Userland/Applications/PixelPaint/main.cpp
@@ -23,7 +23,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
{
TRY(Core::System::pledge("stdio thread recvfd sendfd rpath unix wpath cpath"));
- auto app = TRY(GUI::Application::try_create(arguments));
+ auto app = TRY(GUI::Application::create(arguments));
Config::pledge_domain("PixelPaint");
app->set_config_domain(TRY(String::from_utf8("PixelPaint"sv)));
diff --git a/Userland/Applications/Presenter/main.cpp b/Userland/Applications/Presenter/main.cpp
index 226fe51fc0..3b9b7af50b 100644
--- a/Userland/Applications/Presenter/main.cpp
+++ b/Userland/Applications/Presenter/main.cpp
@@ -23,7 +23,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
argument_parser.add_positional_argument(file_to_load, "Presentation to load", "file", Core::ArgsParser::Required::No);
argument_parser.parse(arguments);
- auto app = TRY(GUI::Application::try_create(arguments));
+ auto app = TRY(GUI::Application::create(arguments));
auto window = TRY(GUI::Window::try_create());
window->set_title("Presenter");
window->set_icon(GUI::Icon::default_icon("app-presenter"sv).bitmap_for_size(16));
diff --git a/Userland/Applications/Run/main.cpp b/Userland/Applications/Run/main.cpp
index b8c5a37dac..a1475fe84f 100644
--- a/Userland/Applications/Run/main.cpp
+++ b/Userland/Applications/Run/main.cpp
@@ -14,7 +14,7 @@ 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::try_create(arguments));
+ auto app = TRY(GUI::Application::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());
diff --git a/Userland/Applications/Settings/main.cpp b/Userland/Applications/Settings/main.cpp
index c936cca845..8ecca60dcb 100644
--- a/Userland/Applications/Settings/main.cpp
+++ b/Userland/Applications/Settings/main.cpp
@@ -82,7 +82,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
{
TRY(Core::System::pledge("stdio thread recvfd sendfd rpath cpath wpath unix proc exec"));
- auto app = TRY(GUI::Application::try_create(arguments));
+ auto app = TRY(GUI::Application::create(arguments));
TRY(Core::System::pledge("stdio thread recvfd sendfd rpath cpath wpath proc exec"));
diff --git a/Userland/Applications/SoundPlayer/main.cpp b/Userland/Applications/SoundPlayer/main.cpp
index 71a7ea7ccc..3e9ef8a3ae 100644
--- a/Userland/Applications/SoundPlayer/main.cpp
+++ b/Userland/Applications/SoundPlayer/main.cpp
@@ -36,7 +36,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
args_parser.add_positional_argument(file_path, "Path to audio file to play", "file", Core::ArgsParser::Required::No);
args_parser.parse(arguments);
- auto app = TRY(GUI::Application::try_create(arguments));
+ auto app = TRY(GUI::Application::create(arguments));
auto audio_client = TRY(Audio::ConnectionToServer::try_create());
auto decoder_client = TRY(ImageDecoderClient::Client::try_create());
diff --git a/Userland/Applications/SpaceAnalyzer/main.cpp b/Userland/Applications/SpaceAnalyzer/main.cpp
index 7f6b4f94bd..8968dc463b 100644
--- a/Userland/Applications/SpaceAnalyzer/main.cpp
+++ b/Userland/Applications/SpaceAnalyzer/main.cpp
@@ -43,7 +43,7 @@ static DeprecatedString get_absolute_path_to_selected_node(SpaceAnalyzer::TreeMa
ErrorOr<int> serenity_main(Main::Arguments arguments)
{
- auto app = TRY(GUI::Application::try_create(arguments));
+ auto app = TRY(GUI::Application::create(arguments));
// Configure application window.
auto app_icon = GUI::Icon::default_icon("app-space-analyzer"sv);
diff --git a/Userland/Applications/Spreadsheet/main.cpp b/Userland/Applications/Spreadsheet/main.cpp
index 73e1b5ca99..c4f96cc764 100644
--- a/Userland/Applications/Spreadsheet/main.cpp
+++ b/Userland/Applications/Spreadsheet/main.cpp
@@ -25,7 +25,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
{
TRY(Core::System::pledge("stdio recvfd sendfd rpath fattr unix cpath wpath thread"));
- auto app = TRY(GUI::Application::try_create(arguments));
+ auto app = TRY(GUI::Application::create(arguments));
StringView filename;
diff --git a/Userland/Applications/SystemMonitor/main.cpp b/Userland/Applications/SystemMonitor/main.cpp
index 6747f9bc78..505ac767f9 100644
--- a/Userland/Applications/SystemMonitor/main.cpp
+++ b/Userland/Applications/SystemMonitor/main.cpp
@@ -237,7 +237,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
TRY(Core::System::pledge("stdio thread proc recvfd sendfd rpath exec unix"));
- auto app = TRY(GUI::Application::try_create(arguments));
+ auto app = TRY(GUI::Application::create(arguments));
Config::pledge_domain("SystemMonitor");
diff --git a/Userland/Applications/Terminal/main.cpp b/Userland/Applications/Terminal/main.cpp
index 4ed8a2717e..a9407c8154 100644
--- a/Userland/Applications/Terminal/main.cpp
+++ b/Userland/Applications/Terminal/main.cpp
@@ -245,7 +245,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
TRY(Core::System::sigaction(SIGCHLD, &act, nullptr));
- auto app = TRY(GUI::Application::try_create(arguments));
+ auto app = TRY(GUI::Application::create(arguments));
TRY(Core::System::pledge("stdio tty rpath cpath wpath recvfd sendfd proc exec unix"));
diff --git a/Userland/Applications/TerminalSettings/main.cpp b/Userland/Applications/TerminalSettings/main.cpp
index 22d79fe1c2..ff0a5865d7 100644
--- a/Userland/Applications/TerminalSettings/main.cpp
+++ b/Userland/Applications/TerminalSettings/main.cpp
@@ -16,7 +16,7 @@
ErrorOr<int> serenity_main(Main::Arguments arguments)
{
TRY(Core::System::pledge("stdio rpath recvfd sendfd unix"));
- auto app = TRY(GUI::Application::try_create(arguments));
+ auto app = TRY(GUI::Application::create(arguments));
Config::pledge_domain("Terminal");
StringView selected_tab;
diff --git a/Userland/Applications/TextEditor/main.cpp b/Userland/Applications/TextEditor/main.cpp
index abbb39fa38..a6b6e09c82 100644
--- a/Userland/Applications/TextEditor/main.cpp
+++ b/Userland/Applications/TextEditor/main.cpp
@@ -20,7 +20,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
{
TRY(Core::System::pledge("stdio recvfd sendfd thread rpath cpath wpath unix"));
- auto app = TRY(GUI::Application::try_create(arguments));
+ auto app = TRY(GUI::Application::create(arguments));
Config::pledge_domain("TextEditor");
diff --git a/Userland/Applications/ThemeEditor/main.cpp b/Userland/Applications/ThemeEditor/main.cpp
index 607f25dc12..c2185644b4 100644
--- a/Userland/Applications/ThemeEditor/main.cpp
+++ b/Userland/Applications/ThemeEditor/main.cpp
@@ -25,7 +25,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
{
TRY(Core::System::pledge("stdio recvfd sendfd thread rpath cpath wpath unix"));
- auto app = TRY(GUI::Application::try_create(arguments));
+ auto app = TRY(GUI::Application::create(arguments));
StringView file_to_edit;
diff --git a/Userland/Applications/VideoPlayer/main.cpp b/Userland/Applications/VideoPlayer/main.cpp
index 27e2a45adb..8d8bd6a540 100644
--- a/Userland/Applications/VideoPlayer/main.cpp
+++ b/Userland/Applications/VideoPlayer/main.cpp
@@ -19,7 +19,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
args_parser.add_positional_argument(filename, "The video file to display.", "filename", Core::ArgsParser::Required::No);
args_parser.parse(arguments);
- auto app = TRY(GUI::Application::try_create(arguments));
+ auto app = TRY(GUI::Application::create(arguments));
auto window = TRY(GUI::Window::try_create());
window->resize(640, 480);
window->set_resizable(true);
diff --git a/Userland/Applications/Welcome/main.cpp b/Userland/Applications/Welcome/main.cpp
index 5de82d36cf..f684ab5aba 100644
--- a/Userland/Applications/Welcome/main.cpp
+++ b/Userland/Applications/Welcome/main.cpp
@@ -15,7 +15,7 @@
ErrorOr<int> serenity_main(Main::Arguments arguments)
{
TRY(Core::System::pledge("stdio recvfd sendfd rpath unix proc exec"));
- auto app = TRY(GUI::Application::try_create(arguments));
+ auto app = TRY(GUI::Application::create(arguments));
Config::pledge_domain("SystemServer");
diff --git a/Userland/Demos/CatDog/main.cpp b/Userland/Demos/CatDog/main.cpp
index 76e7796dfd..d657e44696 100644
--- a/Userland/Demos/CatDog/main.cpp
+++ b/Userland/Demos/CatDog/main.cpp
@@ -21,7 +21,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
{
TRY(Core::System::pledge("stdio recvfd sendfd rpath wpath cpath unix"));
- auto app = TRY(GUI::Application::try_create(arguments));
+ auto app = TRY(GUI::Application::create(arguments));
auto app_icon = TRY(GUI::Icon::try_create_default_icon("app-catdog"sv));
TRY(Core::System::pledge("stdio recvfd sendfd rpath"));
diff --git a/Userland/Demos/Eyes/main.cpp b/Userland/Demos/Eyes/main.cpp
index 2fb554ca7a..218c8c308a 100644
--- a/Userland/Demos/Eyes/main.cpp
+++ b/Userland/Demos/Eyes/main.cpp
@@ -38,7 +38,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
TRY(Core::System::pledge("stdio recvfd sendfd rpath unix cpath wpath thread"));
- auto app = TRY(GUI::Application::try_create(arguments));
+ auto app = TRY(GUI::Application::create(arguments));
TRY(Core::System::unveil("/tmp/session/%sid/portal/launch", "rw"));
TRY(Core::System::unveil("/res", "r"));
diff --git a/Userland/Demos/Gradient/Gradient.cpp b/Userland/Demos/Gradient/Gradient.cpp
index 8a36ff927b..04e7374687 100644
--- a/Userland/Demos/Gradient/Gradient.cpp
+++ b/Userland/Demos/Gradient/Gradient.cpp
@@ -89,7 +89,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
{
TRY(Core::System::pledge("stdio rpath recvfd sendfd unix"));
- auto app = TRY(GUI::Application::try_create(arguments));
+ auto app = TRY(GUI::Application::create(arguments));
TRY(Core::System::pledge("stdio rpath recvfd sendfd"));
TRY(Core::System::unveil("/res", "r"));
diff --git a/Userland/Demos/LibGfxDemo/main.cpp b/Userland/Demos/LibGfxDemo/main.cpp
index b2c73a3821..3f539cc038 100644
--- a/Userland/Demos/LibGfxDemo/main.cpp
+++ b/Userland/Demos/LibGfxDemo/main.cpp
@@ -185,7 +185,7 @@ void Canvas::draw()
ErrorOr<int> serenity_main(Main::Arguments arguments)
{
- auto app = TRY(GUI::Application::try_create(arguments));
+ auto app = TRY(GUI::Application::create(arguments));
TRY(Core::System::pledge("stdio recvfd sendfd rpath"));
TRY(Core::System::unveil("/res", "r"));
diff --git a/Userland/Demos/LibGfxScaleDemo/main.cpp b/Userland/Demos/LibGfxScaleDemo/main.cpp
index d0222ee4f4..a1709f3bf3 100644
--- a/Userland/Demos/LibGfxScaleDemo/main.cpp
+++ b/Userland/Demos/LibGfxScaleDemo/main.cpp
@@ -105,7 +105,7 @@ void Canvas::draw(Gfx::Painter& painter)
ErrorOr<int> serenity_main(Main::Arguments arguments)
{
- auto app = TRY(GUI::Application::try_create(arguments));
+ auto app = TRY(GUI::Application::create(arguments));
TRY(Core::System::pledge("stdio recvfd sendfd rpath"));
TRY(Core::System::unveil("/res", "r"));
diff --git a/Userland/Demos/Mandelbrot/Mandelbrot.cpp b/Userland/Demos/Mandelbrot/Mandelbrot.cpp
index 197c235579..cf53b0e9e3 100644
--- a/Userland/Demos/Mandelbrot/Mandelbrot.cpp
+++ b/Userland/Demos/Mandelbrot/Mandelbrot.cpp
@@ -396,7 +396,7 @@ ErrorOr<void> Mandelbrot::export_image(DeprecatedString const& export_path, Imag
ErrorOr<int> serenity_main(Main::Arguments arguments)
{
- auto app = TRY(GUI::Application::try_create(arguments));
+ auto app = TRY(GUI::Application::create(arguments));
TRY(Core::System::pledge("stdio thread recvfd sendfd rpath wpath cpath"));
diff --git a/Userland/Demos/ModelGallery/main.cpp b/Userland/Demos/ModelGallery/main.cpp
index 8c78ab6c2b..0709c1fb17 100644
--- a/Userland/Demos/ModelGallery/main.cpp
+++ b/Userland/Demos/ModelGallery/main.cpp
@@ -18,7 +18,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
{
TRY(Core::System::pledge("stdio recvfd sendfd rpath wpath cpath unix"));
- auto app = TRY(GUI::Application::try_create(arguments));
+ auto app = TRY(GUI::Application::create(arguments));
TRY(Core::System::pledge("stdio recvfd sendfd rpath"));
diff --git a/Userland/Demos/Screensaver/main.cpp b/Userland/Demos/Screensaver/main.cpp
index 372fc35016..403065795b 100644
--- a/Userland/Demos/Screensaver/main.cpp
+++ b/Userland/Demos/Screensaver/main.cpp
@@ -66,7 +66,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
{
TRY(Core::System::pledge("stdio thread recvfd sendfd rpath cpath wpath unix proc exec"));
- auto app = TRY(GUI::Application::try_create(arguments));
+ auto app = TRY(GUI::Application::create(arguments));
TRY(Core::System::pledge("stdio thread recvfd sendfd rpath cpath wpath proc exec"));
diff --git a/Userland/Demos/Starfield/Starfield.cpp b/Userland/Demos/Starfield/Starfield.cpp
index ebf6e6e5e5..8cddd78a46 100644
--- a/Userland/Demos/Starfield/Starfield.cpp
+++ b/Userland/Demos/Starfield/Starfield.cpp
@@ -161,7 +161,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
args_parser.add_option(speed, "Speed (default = 1)", "speed", 's', "number");
args_parser.parse(arguments);
- auto app = TRY(GUI::Application::try_create(arguments));
+ auto app = TRY(GUI::Application::create(arguments));
TRY(Core::System::pledge("stdio recvfd sendfd rpath"));
diff --git a/Userland/Demos/Tubes/main.cpp b/Userland/Demos/Tubes/main.cpp
index 33ae9ecca2..9f585e205a 100644
--- a/Userland/Demos/Tubes/main.cpp
+++ b/Userland/Demos/Tubes/main.cpp
@@ -22,7 +22,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
args_parser.add_option(refresh_rate, "Refresh rate", "rate", 'r', "milliseconds");
args_parser.parse(arguments);
- auto app = TRY(GUI::Application::try_create(arguments));
+ auto app = TRY(GUI::Application::create(arguments));
TRY(Core::System::pledge("stdio recvfd sendfd rpath prot_exec map_fixed"));
diff --git a/Userland/Demos/WidgetGallery/main.cpp b/Userland/Demos/WidgetGallery/main.cpp
index a3f1035de6..53b1785c3d 100644
--- a/Userland/Demos/WidgetGallery/main.cpp
+++ b/Userland/Demos/WidgetGallery/main.cpp
@@ -15,7 +15,7 @@
ErrorOr<int> serenity_main(Main::Arguments arguments)
{
TRY(Core::System::pledge("stdio recvfd sendfd rpath unix thread"));
- auto app = TRY(GUI::Application::try_create(arguments));
+ auto app = TRY(GUI::Application::create(arguments));
TRY(Core::System::unveil("/tmp/session/%sid/portal/filesystemaccess", "rw"));
TRY(Core::System::unveil("/res", "r"));
diff --git a/Userland/DevTools/GMLPlayground/main.cpp b/Userland/DevTools/GMLPlayground/main.cpp
index 03823997dd..dbb92bee37 100644
--- a/Userland/DevTools/GMLPlayground/main.cpp
+++ b/Userland/DevTools/GMLPlayground/main.cpp
@@ -66,7 +66,7 @@ void UnregisteredWidget::paint_event(GUI::PaintEvent& event)
ErrorOr<int> serenity_main(Main::Arguments arguments)
{
TRY(Core::System::pledge("stdio thread recvfd sendfd cpath rpath wpath unix"));
- auto app = TRY(GUI::Application::try_create(arguments));
+ auto app = TRY(GUI::Application::create(arguments));
Config::pledge_domains({ "GMLPlayground", "Calendar" });
app->set_config_domain(TRY("GMLPlayground"_string));
diff --git a/Userland/DevTools/HackStudio/main.cpp b/Userland/DevTools/HackStudio/main.cpp
index 176c320b24..b170b3ea57 100644
--- a/Userland/DevTools/HackStudio/main.cpp
+++ b/Userland/DevTools/HackStudio/main.cpp
@@ -41,7 +41,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
{
TRY(Core::System::pledge("stdio recvfd sendfd tty rpath cpath wpath proc exec unix fattr thread ptrace"));
- auto app = TRY(GUI::Application::try_create(arguments));
+ auto app = TRY(GUI::Application::create(arguments));
Config::pledge_domains({ "HackStudio", "Terminal", "FileManager" });
auto window = GUI::Window::construct();
diff --git a/Userland/DevTools/Profiler/main.cpp b/Userland/DevTools/Profiler/main.cpp
index c4be9a29cd..f270f7a236 100644
--- a/Userland/DevTools/Profiler/main.cpp
+++ b/Userland/DevTools/Profiler/main.cpp
@@ -58,7 +58,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
return 1;
}
- auto app = TRY(GUI::Application::try_create(arguments));
+ auto app = TRY(GUI::Application::create(arguments));
auto app_icon = TRY(GUI::Icon::try_create_default_icon("app-profiler"sv));
DeprecatedString perfcore_file;
diff --git a/Userland/DevTools/SQLStudio/main.cpp b/Userland/DevTools/SQLStudio/main.cpp
index e855d3ee20..58bfaa97c1 100644
--- a/Userland/DevTools/SQLStudio/main.cpp
+++ b/Userland/DevTools/SQLStudio/main.cpp
@@ -21,7 +21,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
args_parser.add_positional_argument(file_to_open, "Path to SQL script or DB", "file", Core::ArgsParser::Required::No);
args_parser.parse(arguments);
- auto app = TRY(GUI::Application::try_create(arguments));
+ auto app = TRY(GUI::Application::create(arguments));
auto app_icon = GUI::Icon::default_icon("app-sql-studio"sv);
diff --git a/Userland/Games/2048/main.cpp b/Userland/Games/2048/main.cpp
index 4f298379cb..4444d6a482 100644
--- a/Userland/Games/2048/main.cpp
+++ b/Userland/Games/2048/main.cpp
@@ -33,7 +33,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
srand(time(nullptr));
- auto app = TRY(GUI::Application::try_create(arguments));
+ auto app = TRY(GUI::Application::create(arguments));
auto app_icon = TRY(GUI::Icon::try_create_default_icon("app-2048"sv));
auto window = TRY(GUI::Window::try_create());
diff --git a/Userland/Games/BrickGame/main.cpp b/Userland/Games/BrickGame/main.cpp
index a7eaae25c9..3f3315470b 100644
--- a/Userland/Games/BrickGame/main.cpp
+++ b/Userland/Games/BrickGame/main.cpp
@@ -23,7 +23,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
{
TRY(Core::System::pledge("stdio rpath recvfd sendfd unix"));
- auto app = TRY(GUI::Application::try_create(arguments));
+ auto app = TRY(GUI::Application::create(arguments));
auto const app_name = "BrickGame"sv;
auto const title = "Brick Game"sv;
diff --git a/Userland/Games/Chess/main.cpp b/Userland/Games/Chess/main.cpp
index 9edf65d3e7..ba19020741 100644
--- a/Userland/Games/Chess/main.cpp
+++ b/Userland/Games/Chess/main.cpp
@@ -53,7 +53,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
{
TRY(Core::System::pledge("stdio rpath recvfd sendfd thread proc exec unix"));
- auto app = TRY(GUI::Application::try_create(arguments));
+ auto app = TRY(GUI::Application::create(arguments));
Config::pledge_domain("Games");
Config::monitor_domain("Games");
diff --git a/Userland/Games/ColorLines/main.cpp b/Userland/Games/ColorLines/main.cpp
index 2528fb7509..17fc449ba4 100644
--- a/Userland/Games/ColorLines/main.cpp
+++ b/Userland/Games/ColorLines/main.cpp
@@ -22,7 +22,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
{
TRY(Core::System::pledge("stdio rpath recvfd sendfd unix"));
- auto app = TRY(GUI::Application::try_create(arguments));
+ auto app = TRY(GUI::Application::create(arguments));
auto const app_name = "ColorLines"sv;
auto const title = "Color Lines"sv;
diff --git a/Userland/Games/FlappyBug/main.cpp b/Userland/Games/FlappyBug/main.cpp
index 245b7afc82..e390aec4e9 100644
--- a/Userland/Games/FlappyBug/main.cpp
+++ b/Userland/Games/FlappyBug/main.cpp
@@ -21,7 +21,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
{
TRY(Core::System::pledge("stdio rpath recvfd sendfd unix"));
- auto app = TRY(GUI::Application::try_create(arguments));
+ auto app = TRY(GUI::Application::create(arguments));
Config::pledge_domain("FlappyBug");
diff --git a/Userland/Games/Flood/main.cpp b/Userland/Games/Flood/main.cpp
index 1fc3f3d854..0b2de679fe 100644
--- a/Userland/Games/Flood/main.cpp
+++ b/Userland/Games/Flood/main.cpp
@@ -56,7 +56,7 @@ static int get_number_of_moves_from_ai(Board const& board)
ErrorOr<int> serenity_main(Main::Arguments arguments)
{
TRY(Core::System::pledge("stdio rpath recvfd sendfd unix"));
- auto app = TRY(GUI::Application::try_create(arguments));
+ auto app = TRY(GUI::Application::create(arguments));
auto app_icon = TRY(GUI::Icon::try_create_default_icon("app-flood"sv));
auto window = TRY(GUI::Window::try_create());
diff --git a/Userland/Games/GameOfLife/main.cpp b/Userland/Games/GameOfLife/main.cpp
index 40ad80f203..9ab3a22ee9 100644
--- a/Userland/Games/GameOfLife/main.cpp
+++ b/Userland/Games/GameOfLife/main.cpp
@@ -30,7 +30,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
{
TRY(Core::System::pledge("stdio rpath recvfd sendfd unix"));
- auto app = TRY(GUI::Application::try_create(arguments));
+ auto app = TRY(GUI::Application::create(arguments));
TRY(Desktop::Launcher::add_allowed_handler_with_only_specific_urls("/bin/Help", { URL::create_with_file_scheme("/usr/share/man/man6/GameOfLife.md") }));
TRY(Desktop::Launcher::seal_allowlist());
diff --git a/Userland/Games/Hearts/main.cpp b/Userland/Games/Hearts/main.cpp
index fc5b48d2e8..4cb715db7b 100644
--- a/Userland/Games/Hearts/main.cpp
+++ b/Userland/Games/Hearts/main.cpp
@@ -29,7 +29,7 @@
ErrorOr<int> serenity_main(Main::Arguments arguments)
{
- auto app = TRY(GUI::Application::try_create(arguments));
+ auto app = TRY(GUI::Application::create(arguments));
auto app_icon = TRY(GUI::Icon::try_create_default_icon("app-hearts"sv));
Config::pledge_domains({ "Games", "Hearts" });
diff --git a/Userland/Games/MasterWord/main.cpp b/Userland/Games/MasterWord/main.cpp
index 17eb9415cc..5fde56f6ff 100644
--- a/Userland/Games/MasterWord/main.cpp
+++ b/Userland/Games/MasterWord/main.cpp
@@ -25,7 +25,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
{
TRY(Core::System::pledge("stdio rpath recvfd sendfd unix"));
- auto app = TRY(GUI::Application::try_create(arguments));
+ auto app = TRY(GUI::Application::create(arguments));
Config::pledge_domain("MasterWord");
diff --git a/Userland/Games/Minesweeper/main.cpp b/Userland/Games/Minesweeper/main.cpp
index 2f7f1b6a48..ffffe0668b 100644
--- a/Userland/Games/Minesweeper/main.cpp
+++ b/Userland/Games/Minesweeper/main.cpp
@@ -29,7 +29,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
{
TRY(Core::System::pledge("stdio rpath recvfd sendfd unix"));
- auto app = TRY(GUI::Application::try_create(arguments));
+ auto app = TRY(GUI::Application::create(arguments));
Config::pledge_domain("Minesweeper");
diff --git a/Userland/Games/Snake/main.cpp b/Userland/Games/Snake/main.cpp
index 7a9c422ff2..25ba16d838 100644
--- a/Userland/Games/Snake/main.cpp
+++ b/Userland/Games/Snake/main.cpp
@@ -30,7 +30,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
{
TRY(Core::System::pledge("stdio rpath recvfd sendfd unix"));
- auto app = TRY(GUI::Application::try_create(arguments));
+ auto app = TRY(GUI::Application::create(arguments));
Config::pledge_domain("Snake");
Config::monitor_domain("Snake");
diff --git a/Userland/Games/Solitaire/main.cpp b/Userland/Games/Solitaire/main.cpp
index 92c4969646..5457611f1e 100644
--- a/Userland/Games/Solitaire/main.cpp
+++ b/Userland/Games/Solitaire/main.cpp
@@ -29,7 +29,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
{
TRY(Core::System::pledge("stdio recvfd sendfd rpath unix proc exec"));
- auto app = TRY(GUI::Application::try_create(arguments));
+ auto app = TRY(GUI::Application::create(arguments));
auto app_icon = TRY(GUI::Icon::try_create_default_icon("app-solitaire"sv));
auto const man_file = "/usr/share/man/man6/Solitaire.md"sv;
diff --git a/Userland/Games/Spider/main.cpp b/Userland/Games/Spider/main.cpp
index 789fd256eb..c622d56b90 100644
--- a/Userland/Games/Spider/main.cpp
+++ b/Userland/Games/Spider/main.cpp
@@ -42,7 +42,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
{
TRY(Core::System::pledge("stdio recvfd sendfd rpath unix proc exec"));
- auto app = TRY(GUI::Application::try_create(arguments));
+ auto app = TRY(GUI::Application::create(arguments));
auto app_icon = TRY(GUI::Icon::try_create_default_icon("app-spider"sv));
Config::pledge_domains({ "Games", "Spider" });
diff --git a/Userland/Libraries/LibGUI/Application.cpp b/Userland/Libraries/LibGUI/Application.cpp
index 1fc3c107a4..cbb4403493 100644
--- a/Userland/Libraries/LibGUI/Application.cpp
+++ b/Userland/Libraries/LibGUI/Application.cpp
@@ -68,37 +68,43 @@ Application* Application::the()
return *s_the;
}
-Application::Application(int argc, char** argv)
+ErrorOr<NonnullRefPtr<Application>> Application::create(Main::Arguments const& arguments)
{
- VERIFY(!*s_the);
- *s_the = *this;
- m_event_loop = make<Core::EventLoop>();
+ if (*s_the)
+ return Error::from_string_literal("An Application has already been created for this process!");
+
+ auto application = TRY(adopt_nonnull_ref_or_enomem(new (nothrow) Application {}));
+ *s_the = *application;
+
+ application->m_event_loop = TRY(try_make<Core::EventLoop>());
+
ConnectionToWindowServer::the();
Clipboard::initialize({});
- if (argc > 0)
- m_invoked_as = argv[0];
+
+ if (arguments.argc > 0)
+ application->m_invoked_as = arguments.argv[0];
if (getenv("GUI_FOCUS_DEBUG"))
- m_focus_debugging_enabled = true;
+ application->m_focus_debugging_enabled = true;
if (getenv("GUI_HOVER_DEBUG"))
- m_hover_debugging_enabled = true;
+ application->m_hover_debugging_enabled = true;
if (getenv("GUI_DND_DEBUG"))
- m_dnd_debugging_enabled = true;
+ application->m_dnd_debugging_enabled = true;
- for (int i = 1; i < argc; i++) {
- DeprecatedString arg(argv[i]);
- m_args.append(move(arg));
- }
+ for (auto arg : arguments.strings.slice(1))
+ TRY(application->m_args.try_append(arg));
- m_tooltip_show_timer = Core::Timer::create_single_shot(700, [this] {
- request_tooltip_show();
- }).release_value_but_fixme_should_propagate_errors();
+ application->m_tooltip_show_timer = TRY(Core::Timer::create_single_shot(700, [weak_application = application->make_weak_ptr<Application>()] {
+ weak_application->request_tooltip_show();
+ }));
+
+ application->m_tooltip_hide_timer = TRY(Core::Timer::create_single_shot(50, [weak_application = application->make_weak_ptr<Application>()] {
+ weak_application->tooltip_hide_timer_did_fire();
+ }));
- m_tooltip_hide_timer = Core::Timer::create_single_shot(50, [this] {
- tooltip_hide_timer_did_fire();
- }).release_value_but_fixme_should_propagate_errors();
+ return application;
}
static bool s_in_teardown;
diff --git a/Userland/Libraries/LibGUI/Application.h b/Userland/Libraries/LibGUI/Application.h
index 387f53bebb..b25674bfd6 100644
--- a/Userland/Libraries/LibGUI/Application.h
+++ b/Userland/Libraries/LibGUI/Application.h
@@ -22,11 +22,13 @@
namespace GUI {
class Application : public Core::Object {
- C_OBJECT(Application);
+ C_OBJECT_ABSTRACT(Application);
public:
static Application* the();
+ static ErrorOr<NonnullRefPtr<Application>> create(Main::Arguments const& arguments);
+
~Application();
static bool in_teardown();
@@ -97,11 +99,7 @@ public:
void register_recent_file_actions(Badge<GUI::Menu>, Vector<NonnullRefPtr<GUI::Action>>);
private:
- Application(int argc, char** argv);
- Application(Main::Arguments const& arguments)
- : Application(arguments.argc, arguments.argv)
- {
- }
+ Application() = default;
virtual void event(Core::Event&) override;
diff --git a/Userland/Services/FileSystemAccessServer/main.cpp b/Userland/Services/FileSystemAccessServer/main.cpp
index 5556104df2..3644de3105 100644
--- a/Userland/Services/FileSystemAccessServer/main.cpp
+++ b/Userland/Services/FileSystemAccessServer/main.cpp
@@ -10,11 +10,11 @@
#include <LibIPC/SingleServer.h>
#include <LibMain/Main.h>
-ErrorOr<int> serenity_main(Main::Arguments)
+ErrorOr<int> serenity_main(Main::Arguments arguments)
{
TRY(Core::System::pledge("stdio recvfd sendfd rpath cpath wpath unix thread"));
- auto app = TRY(GUI::Application::try_create(0, nullptr));
+ auto app = TRY(GUI::Application::create(arguments));
app->set_quit_when_last_window_deleted(false);
auto client = TRY(IPC::take_over_accepted_client_from_system_server<FileSystemAccessServer::ConnectionFromClient>());
diff --git a/Userland/Services/LoginServer/main.cpp b/Userland/Services/LoginServer/main.cpp
index 3318cc93bd..df58920cfc 100644
--- a/Userland/Services/LoginServer/main.cpp
+++ b/Userland/Services/LoginServer/main.cpp
@@ -61,7 +61,7 @@ static void login(Core::Account const& account, LoginWindow& window)
ErrorOr<int> serenity_main(Main::Arguments arguments)
{
- auto app = TRY(GUI::Application::try_create(arguments));
+ auto app = TRY(GUI::Application::create(arguments));
TRY(Core::System::pledge("stdio recvfd sendfd cpath chown rpath exec proc id"));
TRY(Core::System::unveil("/home", "r"));
diff --git a/Userland/Services/NotificationServer/main.cpp b/Userland/Services/NotificationServer/main.cpp
index 1a210e6cb3..424241601f 100644
--- a/Userland/Services/NotificationServer/main.cpp
+++ b/Userland/Services/NotificationServer/main.cpp
@@ -14,7 +14,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
{
TRY(Core::System::pledge("stdio recvfd sendfd accept rpath unix"));
- auto app = TRY(GUI::Application::try_create(arguments));
+ auto app = TRY(GUI::Application::create(arguments));
auto server = TRY(IPC::MultiServer<NotificationServer::ConnectionFromClient>::try_create());
TRY(Core::System::unveil("/res", "r"));
diff --git a/Userland/Services/Taskbar/main.cpp b/Userland/Services/Taskbar/main.cpp
index 099b53fbc8..7e1b961758 100644
--- a/Userland/Services/Taskbar/main.cpp
+++ b/Userland/Services/Taskbar/main.cpp
@@ -41,7 +41,7 @@ static ErrorOr<NonnullRefPtr<GUI::Menu>> build_system_menu(GUI::Window&);
ErrorOr<int> serenity_main(Main::Arguments arguments)
{
TRY(Core::System::pledge("stdio recvfd sendfd proc exec rpath unix sigaction"));
- auto app = TRY(GUI::Application::try_create(arguments));
+ auto app = TRY(GUI::Application::create(arguments));
Config::pledge_domains({ "Taskbar", "Calendar" });
Config::monitor_domain("Taskbar");
Config::monitor_domain("Calendar");
diff --git a/Userland/Utilities/chres.cpp b/Userland/Utilities/chres.cpp
index 4bfc5f48b6..b045bff957 100644
--- a/Userland/Utilities/chres.cpp
+++ b/Userland/Utilities/chres.cpp
@@ -25,8 +25,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
args_parser.parse(arguments);
// A Core::EventLoop is all we need, but ConnectionToWindowServer needs a full Application object.
- char* dummy_argv[] = { arguments.argv[0] };
- auto app = TRY(GUI::Application::try_create(1, dummy_argv));
+ auto app = TRY(GUI::Application::create(arguments));
auto screen_layout = GUI::ConnectionToWindowServer::the().get_screen_layout();
if (screen < 0 || (size_t)screen >= screen_layout.screens.size()) {
warnln("invalid screen index: {}", screen);
diff --git a/Userland/Utilities/copy.cpp b/Userland/Utilities/copy.cpp
index 96da954496..821d6a9231 100644
--- a/Userland/Utilities/copy.cpp
+++ b/Userland/Utilities/copy.cpp
@@ -59,7 +59,7 @@ static ErrorOr<Options> parse_options(Main::Arguments arguments)
ErrorOr<int> serenity_main(Main::Arguments arguments)
{
- auto app = TRY(GUI::Application::try_create(arguments));
+ auto app = TRY(GUI::Application::create(arguments));
Options options = TRY(parse_options(arguments));
diff --git a/Userland/Utilities/notify.cpp b/Userland/Utilities/notify.cpp
index 15609acce5..963a79f67e 100644
--- a/Userland/Utilities/notify.cpp
+++ b/Userland/Utilities/notify.cpp
@@ -12,7 +12,7 @@
ErrorOr<int> serenity_main(Main::Arguments arguments)
{
- auto app = TRY(GUI::Application::try_create(arguments));
+ auto app = TRY(GUI::Application::create(arguments));
Core::ArgsParser args_parser;
StringView title {};
diff --git a/Userland/Utilities/paste.cpp b/Userland/Utilities/paste.cpp
index f80d187096..4f9519cddf 100644
--- a/Userland/Utilities/paste.cpp
+++ b/Userland/Utilities/paste.cpp
@@ -62,7 +62,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
args_parser.add_positional_argument(watch_command, "Command to run in watch mode", "command", Core::ArgsParser::Required::No);
args_parser.parse(arguments);
- auto app = TRY(GUI::Application::try_create(arguments));
+ auto app = TRY(GUI::Application::create(arguments));
auto& clipboard = GUI::Clipboard::the();
diff --git a/Userland/Utilities/shot.cpp b/Userland/Utilities/shot.cpp
index bb0b8cddc5..8b7caf975e 100644
--- a/Userland/Utilities/shot.cpp
+++ b/Userland/Utilities/shot.cpp
@@ -112,7 +112,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
output_path = Core::DateTime::now().to_deprecated_string("screenshot-%Y-%m-%d-%H-%M-%S.png"sv);
}
- auto app = TRY(GUI::Application::try_create(arguments));
+ auto app = TRY(GUI::Application::create(arguments));
Optional<Gfx::IntRect> crop_region;
if (select_region) {
auto window = GUI::Window::construct();
diff --git a/Userland/Utilities/wallpaper.cpp b/Userland/Utilities/wallpaper.cpp
index 73cb08898b..8f9bd02111 100644
--- a/Userland/Utilities/wallpaper.cpp
+++ b/Userland/Utilities/wallpaper.cpp
@@ -31,7 +31,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
args_parser.add_positional_argument(path, "Wallpaper to set", "path", Core::ArgsParser::Required::No);
args_parser.parse(arguments);
- auto app = TRY(GUI::Application::try_create(arguments));
+ auto app = TRY(GUI::Application::create(arguments));
TRY(Core::System::pledge("stdio rpath unix sendfd"));
diff --git a/Userland/Utilities/wsctl.cpp b/Userland/Utilities/wsctl.cpp
index 71cdc5bb72..b53e58392a 100644
--- a/Userland/Utilities/wsctl.cpp
+++ b/Userland/Utilities/wsctl.cpp
@@ -10,7 +10,7 @@
ErrorOr<int> serenity_main(Main::Arguments arguments)
{
- auto app = TRY(GUI::Application::try_create(arguments));
+ auto app = TRY(GUI::Application::create(arguments));
int flash_flush = -1;
Core::ArgsParser args_parser;