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

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