[mutter/gnome-3-28] compositor: Skip windows not visible to the compositor



commit f7658ac5f08e6d93d14f4dd7f766b2c817499cb4
Author: Olivier Fourdan <ofourdan redhat com>
Date:   Wed Sep 19 16:08:52 2018 +0200

    compositor: Skip windows not visible to the compositor
    
    The compositor will automatically unredirect the top most window which
    is fully visible on screen. When unredirecting windows, it also shapes
    the compositor overlay window (COW) so that other redirected windows
    still shows correctly.
    
    The function `get_top_visible_window_actor()` however will simply walks
    down the window list, so if a window is placed on a layer above and
    unredirected, then iconified by the client, it will still be picked up
    by `get_top_visible_window_actor()` and he compositor will reckon it's
    still unredirected while not in a visible state anymore, thus leaving a
    black area on screen.
    
    Make sure we skip the windows not known to the compositor while picking
    the top visible window actor to avoid this issue.
    
    Closes: https://gitlab.gnome.org/GNOME/mutter/issues/306
    
    (cherry picked from commit 2fb3db7659caa3627a473fefabc4d6a87f688cee)

 src/compositor/compositor.c | 4 ++++
 1 file changed, 4 insertions(+)
---
diff --git a/src/compositor/compositor.c b/src/compositor/compositor.c
index 8c924d256..176028b71 100644
--- a/src/compositor/compositor.c
+++ b/src/compositor/compositor.c
@@ -798,6 +798,7 @@ meta_compositor_hide_window (MetaCompositor *compositor,
 {
   MetaWindowActor *window_actor = META_WINDOW_ACTOR (meta_window_get_compositor_private (window));
   meta_window_actor_hide (window_actor, effect);
+  meta_stack_tracker_queue_sync_stack (compositor->display->screen->stack_tracker);
 }
 
 void
@@ -944,6 +945,9 @@ get_top_visible_window_actor (MetaCompositor *compositor)
       MetaWindow *window = meta_window_actor_get_meta_window (window_actor);
       MetaRectangle buffer_rect;
 
+      if (!window->visible_to_compositor)
+        continue;
+
       meta_window_get_buffer_rect (window, &buffer_rect);
 
       if (meta_rectangle_overlap (&compositor->display->screen->rect,


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