From ffdf06ae2639641deca0c760a13f60f41834bc53 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 | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/metadata/panel.xml b/metadata/panel.xml index 99789871..97140299 100644 --- a/metadata/panel.xml +++ b/metadata/panel.xml @@ -167,16 +167,24 @@ From e89e36e116c9888bc62bd1e9f0fee7464fd74f88 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 7ec8f294..fd9528b7 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 4994c7ad..24f8db09 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" @@ -160,7 +163,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 46b2f8032b3256c9d2b2ee3d39c7e826e5eae001 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 14e0b627..620e2bbf 100644 --- a/src/panel/widgets/window-list/toplevel.cpp +++ b/src/panel/widgets/window-list/toplevel.cpp @@ -885,7 +885,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(); } }