diff options
author | Carlos Garnacho <carlosg@gnome.org> | 2022-12-02 19:59:21 +0100 |
---|---|---|
committer | Carlos Garnacho <carlosg@gnome.org> | 2022-12-04 12:09:43 +0100 |
commit | 6c0254bf0211e0a0cdc2cd8f0f4c304ebfc8111d (patch) | |
tree | 4c3af57cd903c5bc787704557c69dd2b7e5573cb | |
parent | 381de44c5dd50ec61f583239a11d5a9c35c5f05d (diff) | |
download | mutter-6c0254bf0211e0a0cdc2cd8f0f4c304ebfc8111d.tar.gz |
frames: Double check _MUTTER_NEEDS_FRAME property changes
Recalculating window features is a busy thing on the Mutter side, the
different properties being (re)set will overwrite the current state
and cause some side work. Between that is the rewriting of the
_MUTTER_NEEDS_FRAME property on the window being recalculated, which
throws the frames client off, by thinking the window does actually
require a new frame.
It is not sufficient to trust that PropertyNewValue means the property
or the value are new, also double check that the window did not have
in fact a frame, and avoid the busy work if it did.
Besides the busywork that can be easily avoided, this also fixes the
window close button state being stuck if the window changed its
deletable state, since the frame being respawn managed to miss the
property change.
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2735>
-rw-r--r-- | src/frames/meta-window-tracker.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/frames/meta-window-tracker.c b/src/frames/meta-window-tracker.c index 7487904c4..f849c547d 100644 --- a/src/frames/meta-window-tracker.c +++ b/src/frames/meta-window-tracker.c @@ -214,9 +214,13 @@ on_xevent (GdkDisplay *display, xevent->xproperty.atom == gdk_x11_get_xatom_by_name_for_display (display, "_MUTTER_NEEDS_FRAME")) { - if (xevent->xproperty.state == PropertyNewValue) + if (xevent->xproperty.state == PropertyNewValue && + !g_hash_table_contains (window_tracker->client_windows, + GUINT_TO_POINTER (xwindow))) set_up_frame (window_tracker, xwindow); - else if (xevent->xproperty.state == PropertyDelete) + else if (xevent->xproperty.state == PropertyDelete && + g_hash_table_contains (window_tracker->client_windows, + GUINT_TO_POINTER (xwindow))) remove_frame (window_tracker, xwindow); } else if (xevent->type == PropertyNotify) |