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

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