Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion src/panel/widgets/launchers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -69,7 +74,8 @@ void WfLauncherButton::launch()
{
if (app_info)
{
app_info->launch(std::vector<Glib::RefPtr<Gio::File>>());
auto ctx = Gdk::Display::get_default()->get_app_launch_context();
app_info->launch(std::vector<Glib::RefPtr<Gio::File>>(), ctx);
}
}

Expand Down
6 changes: 4 additions & 2 deletions src/panel/widgets/menu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,8 @@ WfMenuMenuItem::WfMenuMenuItem(WayfireMenu *_menu, Glib::RefPtr<Gio::DesktopAppI
menu_item->signal_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);
Expand Down Expand Up @@ -161,7 +162,8 @@ WfMenuMenuItem::WfMenuMenuItem(WayfireMenu *_menu, Glib::RefPtr<Gio::DesktopAppI

void WfMenuMenuItem::on_click()
{
m_app_info->launch(std::vector<Glib::RefPtr<Gio::File>>());
auto ctx = Gdk::Display::get_default()->get_app_launch_context();
m_app_info->launch(std::vector<Glib::RefPtr<Gio::File>>(), ctx);
menu->hide_menu();
}

Expand Down