[gtk+/wip/garnacho/gdkseat: 187/193] wayland: Make gdk_wayland_device_get_focus() work on touch
- From: Carlos Garnacho <carlosg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/wip/garnacho/gdkseat: 187/193] wayland: Make gdk_wayland_device_get_focus() work on touch
- Date: Wed, 9 Dec 2015 12:35:54 +0000 (UTC)
commit 67634bdbf688585f701190802ceb16cabcfdafcc
Author: Carlos Garnacho <carlosg gnome org>
Date: Wed Dec 9 12:42:33 2015 +0100
wayland: Make gdk_wayland_device_get_focus() work on touch
So we can figure out the focus for the master device.
gdk/wayland/gdkdevice-wayland.c | 15 ++++++++++-----
1 files changed, 10 insertions(+), 5 deletions(-)
---
diff --git a/gdk/wayland/gdkdevice-wayland.c b/gdk/wayland/gdkdevice-wayland.c
index 7ecf24f..c334e6a 100644
--- a/gdk/wayland/gdkdevice-wayland.c
+++ b/gdk/wayland/gdkdevice-wayland.c
@@ -488,12 +488,17 @@ device_emit_grab_crossing (GdkDevice *device,
static GdkWindow *
gdk_wayland_device_get_focus (GdkDevice *device)
{
- GdkWaylandDeviceData *wayland_device = GDK_WAYLAND_DEVICE (device)->device;
-
- if (gdk_device_get_source (device) == GDK_SOURCE_KEYBOARD)
- return wayland_device->keyboard_focus;
+ GdkWaylandSeat *wayland_seat = GDK_WAYLAND_DEVICE (device)->device;
+
+ if (device == wayland_seat->master_keyboard)
+ return wayland_seat->keyboard_focus;
+ else if (device == wayland_seat->master_pointer)
+ return wayland_seat->pointer_focus;
+ else if (device == wayland_seat->touch_master &&
+ GDK_WAYLAND_DEVICE(device)->emulating_touch)
+ return GDK_WAYLAND_DEVICE(device)->emulating_touch->window;
else
- return wayland_device->pointer_focus;
+ return NULL;
}
static GdkGrabStatus
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]