From 6c4fcdd3bb77e18c4d6ec20136fae81fd1622656 Mon Sep 17 00:00:00 2001 From: steve finkel Date: Tue, 29 Sep 2026 13:32:12 -0400 Subject: [PATCH 1/3] metadata: fix launcher option definitions Add metadata for generic launcher_ options. This prevents wf-config warnings like: Loaded option panel/launcher_, which does not belong to any registered plugin Assisted-by: ChatGPT:GPT-5.6 Sol Signed-off-by: steve finkel --- metadata/panel.xml | 31 ++++++++++++++++++++----------- 1 file changed, 20 insertions(+), 11 deletions(-) diff --git a/metadata/panel.xml b/metadata/panel.xml index 6da3f7202..a208147f4 100644 --- a/metadata/panel.xml +++ b/metadata/panel.xml @@ -167,17 +167,26 @@ If full_span is off, both sides of the panel will take the same amount of space, From c6314ed539a5a2a50a6c715cba835767ea02f501 Mon Sep 17 00:00:00 2001 From: steve finkel Date: Tue, 29 Sep 2026 13:38:14 -0400 Subject: [PATCH 2/3] panel: prevent launcher and menu apps from inheriting output Redirect stdin, stdout, and stderr to /dev/null for applications started from panel launcher buttons and standard application menu entries. This prevents launched applications, such as Firefox, from writing their warnings and output to wf-panel's stdout and stderr and contaminating the panel log. Assisted-by: ChatGPT:GPT-5.6 Sol Signed-off-by: steve finkel --- src/panel/widgets/launchers.cpp | 40 ++++++++++++++++++++++++++++++--- src/panel/widgets/menu/item.cpp | 35 ++++++++++++++++++++++++++++- 2 files changed, 71 insertions(+), 4 deletions(-) diff --git a/src/panel/widgets/launchers.cpp b/src/panel/widgets/launchers.cpp index 7ec8f2940..fd9528b77 100644 --- a/src/panel/widgets/launchers.cpp +++ b/src/panel/widgets/launchers.cpp @@ -8,6 +8,9 @@ #include #include #include +#include +#include +#include #include "wf-shell-app.hpp" @@ -75,10 +78,41 @@ void WfLauncherButton::update_icon() void WfLauncherButton::launch() { - if (app_info) + if (!app_info) + { + return; + } + + auto ctx = Gdk::Display::get_default()->get_app_launch_context(); + + int devnull = open("/dev/null", O_RDWR); + if (devnull < 0) + { + return; + } + + GError *error = nullptr; + + g_desktop_app_info_launch_uris_as_manager_with_fds( + app_info->gobj(), + nullptr, + G_APP_LAUNCH_CONTEXT(ctx->gobj()), + G_SPAWN_DEFAULT, + nullptr, + nullptr, + nullptr, + nullptr, + devnull, // stdin + devnull, // stdout + devnull, // stderr + &error); + + close(devnull); + + if (error) { - auto ctx = Gdk::Display::get_default()->get_app_launch_context(); - app_info->launch(std::vector>(), ctx); + g_warning("Failed to launch application: %s", error->message); + g_error_free(error); } } diff --git a/src/panel/widgets/menu/item.cpp b/src/panel/widgets/menu/item.cpp index 46beb5973..86bf10b89 100644 --- a/src/panel/widgets/menu/item.cpp +++ b/src/panel/widgets/menu/item.cpp @@ -1,5 +1,8 @@ #include #include +#include +#include +#include #include "item.hpp" #include "menu.hpp" @@ -152,7 +155,37 @@ WfMenuItem::~WfMenuItem() void WfMenuItem::on_click() { auto ctx = Gdk::Display::get_default()->get_app_launch_context(); - app_info->launch(std::vector>(), ctx); + + int devnull = open("/dev/null", O_RDWR); + if (devnull < 0) + { + return; + } + + GError *error = nullptr; + + g_desktop_app_info_launch_uris_as_manager_with_fds( + app_info->gobj(), + nullptr, + G_APP_LAUNCH_CONTEXT(ctx->gobj()), + G_SPAWN_DEFAULT, + nullptr, + nullptr, + nullptr, + nullptr, + devnull, // stdin + devnull, // stdout + devnull, // stderr + &error); + + close(devnull); + + if (error) + { + g_warning("Failed to launch application: %s", error->message); + g_error_free(error); + } + menu->hide_menu(); } From 6d24d056ec0720d7a581a05669a8ec1d29aa2a18 Mon Sep 17 00:00:00 2001 From: steve finkel Date: Tue, 29 Sep 2026 13:40:02 -0400 Subject: [PATCH 3/3] window-list: avoid appending an already parented button Check whether a toplevel button already has a GTK parent before appending it to the window list. This prevents gtk_box_append() critical warnings caused by attempting to add the same button to a container more than once. Assisted-by: ChatGPT:GPT-5.6 Sol Signed-off-by: steve finkel --- src/panel/widgets/window-list/toplevel.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/panel/widgets/window-list/toplevel.cpp b/src/panel/widgets/window-list/toplevel.cpp index 7d114287d..4262e717a 100644 --- a/src/panel/widgets/window-list/toplevel.cpp +++ b/src/panel/widgets/window-list/toplevel.cpp @@ -847,7 +847,11 @@ class WayfireToplevel::impl if (window_list->output->wo == output) { - window_list->append(button); + if (!button.get_parent()) + { + window_list->append(button); + } + send_rectangle_hints(); } }