[gtk+/gtk-3-20] wayland: Avoid NULL slave devices in GdkSeat::get_slaves



commit b8140b74e3e13a921a5825efe126c4c74ea0c67c
Author: Carlos Garnacho <carlosg gnome org>
Date:   Fri Apr 1 19:09:03 2016 +0200

    wayland: Avoid NULL slave devices in GdkSeat::get_slaves
    
    Just because we're asked for a capability, it doesn't mean we have
    it.

 gdk/wayland/gdkdevice-wayland.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/gdk/wayland/gdkdevice-wayland.c b/gdk/wayland/gdkdevice-wayland.c
index 34004ba..3f2bafe 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;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]