Skip to content

Commit bc53ee8

Browse files
committed
panel/menu: launch apps with a valid xdg-activation token
Creating a Gdk::AppLaunchContext from the current display and providing it to Gio::AppInfo::launch() takes care of this.
1 parent aaadead commit bc53ee8

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/panel/widgets/menu.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,8 @@ WfMenuMenuItem::WfMenuMenuItem(WayfireMenu *_menu, Glib::RefPtr<Gio::DesktopAppI
118118
menu_item->signal_activate().connect(
119119
[this, action] ()
120120
{
121-
m_app_info->launch_action(action);
121+
auto ctx = Gdk::Display::get_default()->get_app_launch_context();
122+
m_app_info->launch_action(action, ctx);
122123
menu->hide_menu();
123124
});
124125
m_action_menu.append(*menu_item);
@@ -161,7 +162,8 @@ WfMenuMenuItem::WfMenuMenuItem(WayfireMenu *_menu, Glib::RefPtr<Gio::DesktopAppI
161162

162163
void WfMenuMenuItem::on_click()
163164
{
164-
m_app_info->launch(std::vector<Glib::RefPtr<Gio::File>>());
165+
auto ctx = Gdk::Display::get_default()->get_app_launch_context();
166+
m_app_info->launch(std::vector<Glib::RefPtr<Gio::File>>(), ctx);
165167
menu->hide_menu();
166168
}
167169

0 commit comments

Comments
 (0)