diff --git a/src/panel/widgets/launchers.cpp b/src/panel/widgets/launchers.cpp index aaf2fb96..c03b3d2d 100644 --- a/src/panel/widgets/launchers.cpp +++ b/src/panel/widgets/launchers.cpp @@ -33,6 +33,11 @@ bool WfLauncherButton::initialize(std::string name, std::string icon, std::strin } keyfile.set_string("Desktop Entry", "Name", label); + /* needed for xdg-activation to work, see: + * https://gitlab.gnome.org/GNOME/glib/-/blob/main/gio/gdesktopappinfo.c?ref_type=heads#L1970 + * https://gitlab.gnome.org/GNOME/glib/-/blob/main/gio/gdesktopappinfo.c?ref_type=heads#L2957 + */ + keyfile.set_string("Desktop Entry", "StartupNotify", "true"); // Hand off to have a custom launcher app_info = Gio::DesktopAppInfo::create_from_keyfile(keyfile); @@ -69,7 +74,8 @@ void WfLauncherButton::launch() { if (app_info) { - app_info->launch(std::vector>()); + auto ctx = Gdk::Display::get_default()->get_app_launch_context(); + app_info->launch(std::vector>(), ctx); } } diff --git a/src/panel/widgets/menu.cpp b/src/panel/widgets/menu.cpp index 00759611..2c6231f5 100644 --- a/src/panel/widgets/menu.cpp +++ b/src/panel/widgets/menu.cpp @@ -118,7 +118,8 @@ WfMenuMenuItem::WfMenuMenuItem(WayfireMenu *_menu, Glib::RefPtrsignal_activate().connect( [this, action] () { - m_app_info->launch_action(action); + auto ctx = Gdk::Display::get_default()->get_app_launch_context(); + m_app_info->launch_action(action, ctx); menu->hide_menu(); }); m_action_menu.append(*menu_item); @@ -161,7 +162,8 @@ WfMenuMenuItem::WfMenuMenuItem(WayfireMenu *_menu, Glib::RefPtrlaunch(std::vector>()); + auto ctx = Gdk::Display::get_default()->get_app_launch_context(); + m_app_info->launch(std::vector>(), ctx); menu->hide_menu(); }