From 070f3a61ac9dc66f4204188dc04fe540fa74ed65 Mon Sep 17 00:00:00 2001 From: Carlos Garnacho Date: Fri, 19 Jan 2024 13:19:11 +0100 Subject: [PATCH] gdk/wayland: Bail out on titlebar gestures with no seat This API might be called programmatically at a time that there's no seats, handle this situation by returning FALSE in the GDK API. Related: https://gitlab.gnome.org/GNOME/gtk/-/issues/6335 --- gdk/wayland/gdktoplevel-wayland.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/gdk/wayland/gdktoplevel-wayland.c b/gdk/wayland/gdktoplevel-wayland.c index 66d11848ca..5125a283a9 100644 --- a/gdk/wayland/gdktoplevel-wayland.c +++ b/gdk/wayland/gdktoplevel-wayland.c @@ -1973,8 +1973,10 @@ gdk_wayland_toplevel_titlebar_gesture (GdkToplevel *toplevel, return FALSE; seat = gdk_display_get_default_seat (surface->display); - wl_seat = gdk_wayland_seat_get_wl_seat (seat); + if (!seat) + return FALSE; + wl_seat = gdk_wayland_seat_get_wl_seat (seat); serial = _gdk_wayland_seat_get_last_implicit_grab_serial (GDK_WAYLAND_SEAT (seat), NULL); gtk_surface1_titlebar_gesture (wayland_toplevel->display_server.gtk_surface,