mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-11-10 19:00:08 +00:00
wayland: Make gdk_wayland_device_get_focus() work on touch
So we can figure out the focus for the master device. https://bugzilla.gnome.org/show_bug.cgi?id=759309
This commit is contained in:
parent
8ec3fb39a2
commit
09947a63ed
@ -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;
|
||||
GdkWaylandSeat *wayland_seat = GDK_WAYLAND_DEVICE (device)->device;
|
||||
|
||||
if (gdk_device_get_source (device) == GDK_SOURCE_KEYBOARD)
|
||||
return wayland_device->keyboard_focus;
|
||||
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
|
||||
|
Loading…
Reference in New Issue
Block a user