diff --git a/Userland/Games/Hearts/CMakeLists.txt b/Userland/Games/Hearts/CMakeLists.txt index fa494a8946..a0bc20ac16 100644 --- a/Userland/Games/Hearts/CMakeLists.txt +++ b/Userland/Games/Hearts/CMakeLists.txt @@ -17,4 +17,4 @@ set(SOURCES ) serenity_app(Hearts ICON app-hearts) -target_link_libraries(Hearts LibCards LibGUI LibGfx LibCore LibConfig LibMain) +target_link_libraries(Hearts LibCards LibGUI LibGfx LibCore LibConfig LibMain LibDesktop) diff --git a/Userland/Games/Hearts/main.cpp b/Userland/Games/Hearts/main.cpp index 6b02d484b0..454f707fb2 100644 --- a/Userland/Games/Hearts/main.cpp +++ b/Userland/Games/Hearts/main.cpp @@ -8,10 +8,12 @@ #include "Game.h" #include "SettingsDialog.h" +#include #include #include #include #include +#include #include #include #include @@ -31,9 +33,15 @@ ErrorOr serenity_main(Main::Arguments arguments) Config::pledge_domains("Hearts"); + TRY(Core::System::pledge("stdio recvfd sendfd rpath unix")); + + TRY(Desktop::Launcher::add_allowed_handler_with_only_specific_urls("/bin/Help", { URL::create_with_file_protocol("/usr/share/man/man6/Hearts.md") })); + TRY(Desktop::Launcher::seal_allowlist()); + TRY(Core::System::pledge("stdio recvfd sendfd rpath")); TRY(Core::System::unveil("/res", "r")); + TRY(Core::System::unveil("/tmp/portal/launch", "rw")); TRY(Core::System::unveil(nullptr, nullptr)); auto window = TRY(GUI::Window::try_create()); @@ -90,6 +98,9 @@ ErrorOr serenity_main(Main::Arguments arguments) TRY(game_menu->try_add_action(GUI::CommonActions::make_quit_action([&](auto&) { app->quit(); }))); auto help_menu = TRY(window->try_add_menu("&Help")); + TRY(help_menu->try_add_action(GUI::CommonActions::make_help_action([](auto&) { + Desktop::Launcher::open(URL::create_with_file_protocol("/usr/share/man/man6/Hearts.md"), "/bin/Help"); + }))); TRY(help_menu->try_add_action(GUI::CommonActions::make_about_action("Hearts", app_icon, window))); window->set_resizable(false);