[gtk/wip/chergert/gdk-macos-fixes: 1/3] macos: dont send crossing events during grab
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/wip/chergert/gdk-macos-fixes: 1/3] macos: dont send crossing events during grab
- Date: Wed, 14 Oct 2020 22:46:04 +0000 (UTC)
commit cdb2c1698cca8256a578e616fe8e57914dd424f6
Author: Christian Hergert <chergert redhat com>
Date: Wed Oct 14 14:08:23 2020 -0700
macos: dont send crossing events during grab
Fixes an issue where we can't drag scrollbars or text selections while
outside of the application window.
gdk/macos/gdkmacosdisplay-translate.c | 17 ++++++++++++++---
1 file changed, 14 insertions(+), 3 deletions(-)
---
diff --git a/gdk/macos/gdkmacosdisplay-translate.c b/gdk/macos/gdkmacosdisplay-translate.c
index 50497320f7..41b738f99d 100644
--- a/gdk/macos/gdkmacosdisplay-translate.c
+++ b/gdk/macos/gdkmacosdisplay-translate.c
@@ -1120,10 +1120,21 @@ _gdk_macos_display_translate (GdkMacosDisplay *self,
break;
case NSEventTypeMouseExited:
- [[NSCursor arrowCursor] set];
- /* fallthrough */
case NSEventTypeMouseEntered:
- ret = synthesize_crossing_event (self, surface, nsevent, x, y);
+ {
+ GdkSeat *seat = gdk_display_get_default_seat (GDK_DISPLAY (self));
+ GdkDevice *pointer = gdk_seat_get_pointer (seat);
+ GdkDeviceGrabInfo *grab = _gdk_display_get_last_device_grab (GDK_DISPLAY (self), pointer);
+
+ if (grab == NULL)
+ {
+ if (event_type == NSEventTypeMouseExited)
+ [[NSCursor arrowCursor] set];
+
+ ret = synthesize_crossing_event (self, surface, nsevent, x, y);
+ }
+ }
+
break;
case NSEventTypeKeyDown:
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]