mutter/0001-Revert-x11-Use-input-region-from-frame-window-for-de.patch
Florian Müllner a6f46c185c
Backport F40 changes
Resolves: RHEL-30252
2024-04-10 14:06:07 +02:00

116 lines
4.1 KiB
Diff

From 1d5c47f8970c2027de5f6fa49b84de73d55b419b Mon Sep 17 00:00:00 2001
From: Adam Williamson <awilliam@redhat.com>
Date: Thu, 5 Oct 2023 13:09:46 -0700
Subject: [PATCH] Revert "x11: Use input region from frame window for decorated
windows"
This reverts commit d991961ae2a5c8cf2e58ff1072239f4902b0f767. It
seems to cause the broken mouse interaction bug reported in
https://bugzilla.redhat.com/show_bug.cgi?id=2239128 .
Closes: https://gitlab.gnome.org/GNOME/mutter/-/issues/3068
---
src/core/frame.c | 7 -------
src/x11/window-x11.c | 29 ++++++++++-------------------
2 files changed, 10 insertions(+), 26 deletions(-)
diff --git a/src/core/frame.c b/src/core/frame.c
index 145f0b7bd7..1c90ce4231 100644
--- a/src/core/frame.c
+++ b/src/core/frame.c
@@ -35,7 +35,6 @@
#include "x11/window-props.h"
#include <X11/Xatom.h>
-#include <X11/extensions/shape.h>
#define EVENT_MASK (SubstructureRedirectMask | \
StructureNotifyMask | SubstructureNotifyMask | \
@@ -109,9 +108,6 @@ meta_window_x11_set_frame_xwindow (MetaWindow *window,
XChangeWindowAttributes (x11_display->xdisplay,
frame->xwindow, CWEventMask, &attrs);
- if (META_X11_DISPLAY_HAS_SHAPE (x11_display))
- XShapeSelectInput (x11_display->xdisplay, frame->xwindow, ShapeNotifyMask);
-
meta_x11_display_register_x_window (x11_display, &frame->xwindow, window);
if (window->mapped)
@@ -220,9 +216,6 @@ meta_window_destroy_frame (MetaWindow *window)
window->reparents_pending += 1;
}
- if (META_X11_DISPLAY_HAS_SHAPE (x11_display))
- XShapeSelectInput (x11_display->xdisplay, frame->xwindow, NoEventMask);
-
XDeleteProperty (x11_display->xdisplay,
meta_window_x11_get_xwindow (window),
x11_display->atom__MUTTER_NEEDS_FRAME);
diff --git a/src/x11/window-x11.c b/src/x11/window-x11.c
index 745c45db18..8edff883c9 100644
--- a/src/x11/window-x11.c
+++ b/src/x11/window-x11.c
@@ -2082,10 +2082,6 @@ meta_window_x11_constructed (GObject *object)
priv->keys_grabbed = FALSE;
priv->grab_on_frame = FALSE;
- g_signal_connect (window, "notify::decorated",
- G_CALLBACK (meta_window_x11_update_input_region),
- window);
-
G_OBJECT_CLASS (meta_window_x11_parent_class)->constructed (object);
}
@@ -2400,21 +2396,16 @@ meta_window_x11_update_input_region (MetaWindow *window)
g_autoptr (MtkRegion) region = NULL;
MetaWindowX11 *window_x11 = META_WINDOW_X11 (window);
MetaWindowX11Private *priv = meta_window_x11_get_instance_private (window_x11);
- Window xwindow;
+ /* Decorated windows don't have an input region, because
+ we don't shape the frame to match the client windows
+ (so the events are blocked by the frame anyway)
+ */
if (window->decorated)
{
- if (!window->frame)
- {
- if (priv->input_region)
- meta_window_set_input_region (window, NULL);
- return;
- }
- xwindow = window->frame->xwindow;
- }
- else
- {
- xwindow = priv->xwindow;
+ if (priv->input_region)
+ meta_window_set_input_region (window, NULL);
+ return;
}
if (META_X11_DISPLAY_HAS_SHAPE (x11_display))
@@ -2426,7 +2417,7 @@ meta_window_x11_update_input_region (MetaWindow *window)
mtk_x11_error_trap_push (x11_display->xdisplay);
rects = XShapeGetRectangles (x11_display->xdisplay,
- xwindow,
+ priv->xwindow,
ShapeInput,
&n_rects,
&ordering);
@@ -2480,8 +2471,8 @@ meta_window_x11_update_input_region (MetaWindow *window)
client_area.x = 0;
client_area.y = 0;
- client_area.width = window->buffer_rect.width;
- client_area.height = window->buffer_rect.height;
+ client_area.width = priv->client_rect.width;
+ client_area.height = priv->client_rect.height;
/* The shape we get back from the client may have coordinates
* outside of the frame. The X SHAPE Extension requires that
--
2.43.2