Blame SOURCES/0001-events-Don-t-move-sloppy-focus-while-buttons-are-pre.patch

f7d48e
From 7ac5b7bad8f2d0e61700610f68282f6687cc9d2e Mon Sep 17 00:00:00 2001
f7d48e
From: =?UTF-8?q?Florian=20M=C3=BCllner?= <fmuellner@gnome.org>
f7d48e
Date: Thu, 21 Jul 2016 15:43:12 +0200
f7d48e
Subject: [PATCH] events: Don't move (sloppy) focus while buttons are pressed
f7d48e
f7d48e
(https://bugzilla.redhat.com/show_bug.cgi?id=1358535)
f7d48e
---
f7d48e
 src/x11/events.c | 11 +++++++++++
f7d48e
 1 file changed, 11 insertions(+)
f7d48e
f7d48e
diff --git a/src/x11/events.c b/src/x11/events.c
f7d48e
index efa8f9856b..388eff0ac7 100644
f7d48e
--- a/src/x11/events.c
f7d48e
+++ b/src/x11/events.c
f7d48e
@@ -839,6 +839,16 @@ crossing_serial_is_ignored (MetaX11Display *x11_display,
f7d48e
   return FALSE;
f7d48e
 }
f7d48e
 
f7d48e
+static gboolean
f7d48e
+event_has_button_mask (XIEnterEvent *enter_event)
f7d48e
+{
f7d48e
+  int i;
f7d48e
+  for (i = 0; i < enter_event->buttons.mask_len; i++)
f7d48e
+    if (enter_event->buttons.mask[i] != '\0')
f7d48e
+      return TRUE;
f7d48e
+  return FALSE;
f7d48e
+}
f7d48e
+
f7d48e
 static gboolean
f7d48e
 handle_input_xevent (MetaX11Display *x11_display,
f7d48e
                      XIEvent        *input_event,
f7d48e
@@ -883,6 +893,7 @@ handle_input_xevent (MetaX11Display *x11_display,
f7d48e
        * avoid races.
f7d48e
        */
f7d48e
       if (window && !crossing_serial_is_ignored (x11_display, serial) &&
f7d48e
+          !event_has_button_mask (enter_event) &&
f7d48e
           enter_event->mode != XINotifyGrab &&
f7d48e
           enter_event->mode != XINotifyUngrab &&
f7d48e
           enter_event->detail != XINotifyInferior &&
f7d48e
-- 
f7d48e
2.31.1
f7d48e