token_done,
};
+static struct wl_surface *
+peek_launcher_toplevel (GdkSeat *seat)
+{
+ struct wl_surface *wl_surface = NULL;
+ GdkSurface *focus_surface;
+
+ focus_surface = gdk_wayland_device_get_focus (gdk_seat_get_keyboard (seat));
+ while (focus_surface && focus_surface->parent)
+ focus_surface = focus_surface->parent;
+ if (focus_surface)
+ wl_surface = gdk_wayland_surface_get_wl_surface (focus_surface);
+
+ return wl_surface;
+}
+
static char *
gdk_wayland_app_launch_context_get_startup_notify_id (GAppLaunchContext *context,
GAppInfo *info,
struct wl_event_queue *event_queue;
struct wl_surface *wl_surface = NULL;
GdkWaylandSeat *seat;
- GdkSurface *focus_surface;
AppLaunchData app_launch_data = { 0 };
event_queue = wl_display_create_queue (display->wl_display);
_gdk_wayland_seat_get_last_implicit_grab_serial (seat, NULL),
gdk_wayland_seat_get_wl_seat (GDK_SEAT (seat)));
- focus_surface = gdk_wayland_device_get_focus (gdk_seat_get_keyboard (GDK_SEAT (seat)));
- if (focus_surface)
- wl_surface = gdk_wayland_surface_get_wl_surface (focus_surface);
+ wl_surface = peek_launcher_toplevel (GDK_SEAT (seat));
if (wl_surface)
xdg_activation_token_v1_set_surface (token, wl_surface);