summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarlos Garnacho <carlosg@gnome.org>2016-04-01 19:09:03 +0200
committerCarlos Garnacho <carlosg@gnome.org>2016-04-01 19:11:35 +0200
commitb8140b74e3e13a921a5825efe126c4c74ea0c67c (patch)
tree9f44326ec748e388961addfe33b8c7e5cc3786bb
parent8d402589cfeab084224596e4127d75c8f5dbef11 (diff)
downloadgtk+-b8140b74e3e13a921a5825efe126c4c74ea0c67c.tar.gz
wayland: Avoid NULL slave devices in GdkSeat::get_slaves
Just because we're asked for a capability, it doesn't mean we have it.
-rw-r--r--gdk/wayland/gdkdevice-wayland.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/gdk/wayland/gdkdevice-wayland.c b/gdk/wayland/gdkdevice-wayland.c
index 34004baf0b..3f2bafedc9 100644
--- a/gdk/wayland/gdkdevice-wayland.c
+++ b/gdk/wayland/gdkdevice-wayland.c
@@ -2893,11 +2893,11 @@ gdk_wayland_seat_get_slaves (GdkSeat *seat,
GdkWaylandSeat *wayland_seat = GDK_WAYLAND_SEAT (seat);
GList *slaves = NULL;
- if (capabilities & GDK_SEAT_CAPABILITY_POINTER)
+ if (wayland_seat->pointer && (capabilities & GDK_SEAT_CAPABILITY_POINTER))
slaves = g_list_prepend (slaves, wayland_seat->pointer);
- if (capabilities & GDK_SEAT_CAPABILITY_KEYBOARD)
+ if (wayland_seat->keyboard && (capabilities & GDK_SEAT_CAPABILITY_KEYBOARD))
slaves = g_list_prepend (slaves, wayland_seat->keyboard);
- if (capabilities & GDK_SEAT_CAPABILITY_TOUCH)
+ if (wayland_seat->touch && (capabilities & GDK_SEAT_CAPABILITY_TOUCH))
slaves = g_list_prepend (slaves, wayland_seat->touch);
return slaves;