[mutter] window: Ensure window-visibility-updated is emitted when flushing queue



commit b289c8f01e97e65dffaf512844f3a769cc4e8ea0
Author: Sebastian Keller <skeller gnome org>
Date:   Fri May 13 19:12:52 2022 +0200

    window: Ensure window-visibility-updated is emitted when flushing queue
    
    Currently the signal is getting emitted accidentally, because even when
    removing a window from the queue, the later handler of that queue will
    still get run due to a bug. This bug is going to get fixed in the next
    commit, but some things might depend on the signal getting emitted when
    the visibility of a window has changed.
    
    This change affects the behavior in two ways. First the signal is now
    emitted immediately rather than from an idle. And second it now
    correctly includes the window in the should_show or should_hide list.
    
    Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2414>

 src/core/window.c | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)
---
diff --git a/src/core/window.c b/src/core/window.c
index e22bd5a0e3..95ea18f2c8 100644
--- a/src/core/window.c
+++ b/src/core/window.c
@@ -1800,11 +1800,13 @@ meta_window_flush_calc_showing (MetaWindow *window)
 {
   MetaWindowPrivate *priv = meta_window_get_instance_private (window);
 
-  if (priv->queued_types & META_QUEUE_CALC_SHOWING)
-    {
-      meta_window_unqueue (window, META_QUEUE_CALC_SHOWING);
-      meta_window_update_visibility (window);
-    }
+  if (!(priv->queued_types & META_QUEUE_CALC_SHOWING))
+    return;
+
+  meta_display_flush_queued_window (window->display, window,
+                                    META_QUEUE_CALC_SHOWING);
+
+  priv->queued_types &= ~META_QUEUE_CALC_SHOWING;
 }
 
 void


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]