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

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