diff options
author | Matthias Clasen <mclasen@redhat.com> | 2021-04-22 19:51:17 -0400 |
---|---|---|
committer | Matthias Clasen <mclasen@redhat.com> | 2021-04-22 21:09:54 -0400 |
commit | d225f146575e6eae79562cca73d65234e08f3bcb (patch) | |
tree | a9e2cec1b129030e7cd8020230ba23412d92ea9f | |
parent | be927d9ce665e9715b328ffa546c0427e0b9fb43 (diff) | |
download | gtk+-d225f146575e6eae79562cca73d65234e08f3bcb.tar.gz |
gdk: Avoid synthetic motion confusionsynthetic-motion-grab
Don't emit a synthetic motion event on a surface
that is grab-shadowed by a popup. This has been
known to confuse GTK, at times.
Fixes: #3439
-rw-r--r-- | gdk/gdksurface.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/gdk/gdksurface.c b/gdk/gdksurface.c index ef6464c43a..589dc4e10c 100644 --- a/gdk/gdksurface.c +++ b/gdk/gdksurface.c @@ -2443,6 +2443,7 @@ gdk_surface_ensure_motion (GdkSurface *surface) GdkEvent *event; double x, y; GdkModifierType state; + GdkSurface *grab_surface; if (!surface->request_motion) return; @@ -2459,6 +2460,12 @@ gdk_surface_ensure_motion (GdkSurface *surface) if (!gdk_surface_get_device_position (surface, device, &x, &y, &state)) return; + if (gdk_device_grab_info (display, device, &grab_surface, NULL)) + { + if (grab_surface != surface) + return; + } + event = gdk_motion_event_new (surface, device, NULL, |