mutter/0001-events-Don-t-move-sloppy-focus-while-buttons-are-pre.patch
2021-06-04 14:20:45 +02:00

43 lines
1.3 KiB
Diff

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