[gtk+] wayland: Avoid NULL slave devices in GdkSeat::get_slaves
- From: Carlos Garnacho <carlosg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] wayland: Avoid NULL slave devices in GdkSeat::get_slaves
- Date: Fri, 1 Apr 2016 17:11:19 +0000 (UTC)
commit 2784eacf008b13d4f6d1461adc046917ef0a18a5
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]