GNOME Bugzilla – Bug 735927
Background windows animate over current one when closing
Last modified: 2014-09-16 20:08:55 UTC
gnome-shell 3.13.90 The new window closing animations are great, but if the window closing is behind the currently focused one, one sees a horrible flash, the animation of the window closing on top of the current one, which is unwelcome. Reproducer: $ cat cat test.sh zenity --text-info --width=1920 --height=1000 & sleep 10 killall -9 zenity $ sh test.sh <switch to another fullscreen window and wait for zenity to close> <flash of white texture in front of your eyes>
I believe this is a stacking problem in mutter, the shell just animates the window opacity. Unfortunately, the stacking code is too hairy for me to understand, so I don't know if and where there is a bug.
Yeah, the compositor restacks all known windows by shoving the known ones to the bottom, which means that any unknown actors bubble to the top. And window actors during a destroy effect are "unknown". We can make them known by deferring the removal until the actual window actor is destroyed, but lots of code in gnome-shell calls get_window_actors() when it really wants to list all windows, and we don't want to return the half-dead windows in there.
Now that display.list_windows () is available, can we fix the shell?
Created attachment 285870 [details] [review] window-actor: Keep in compositor's window list until destroyed When a window is destroyed, the corresponding actor may still be kept around for the destroy effect. But as the actor is removed from the compositor's stack list immediately, the compositor will always stack it above "valid" window actors - this is not what we want, so only update the compositor's list when the actor is actually destroyed.
Created attachment 285871 [details] [review] window-actor: Consider needs_destroy in is_destroyed() According to the documentation, the method returns "whether the X window that the actor was displaying has been destroyed" - that is very much true when we delay the actual actor destruction for a destroy animation, so update the method accordingly.
Created attachment 285872 [details] [review] window-actor: Skip frame-sync when the corresponding window is gone
Created attachment 285873 [details] [review] global: Filter out destroyed actors from get_window_actors() All current code assumes that the list of window actors corresponds to the list of windows; however as the list returned by meta_get_window_actors() now includes actors during the destroy animation, that assumption breaks. Eventually we should make everyone move to a more appropriate API, but for now make it work again by returning a filtered list of "good" window actors.
Review of attachment 285870 [details] [review]: ::: src/compositor/meta-window-actor.c @@ +771,3 @@ + compositor->windows = g_list_remove (compositor->windows, (gconstpointer) self); + + CLUTTER_ACTOR_CLASS (meta_window_actor_parent_class)->destroy (self); Is there a reason we need this instead of just relying on the existing g_list_remove in dispose?
Created attachment 285894 [details] [review] window-actor: Keep in compositor's window list until destroyed (In reply to comment #8) > Is there a reason we need this instead of just relying on the existing > g_list_remove in dispose? No.
Created attachment 285899 [details] [review] window-actor: Keep in compositor's window list until destroyed (Remove spurious whitespace change left-over from previous patch version)
Review of attachment 285894 [details] [review]: OK. This matches the patch I had locally :)
Review of attachment 285899 [details] [review]: Whoops, wrong one. This one's good.
Review of attachment 285871 [details] [review]: We only seem to use this function in one place: to minimize some extra work we do in js/ui/windowManager.js. I get what you want to do, but I'd point out that nothing important uses this function, so it won't fix anything immediately, it's just preparation for our changes to shell_global_get_window_actors.
Review of attachment 285872 [details] [review]: OK.
Review of attachment 285873 [details] [review]: OK.
Attachment 285871 [details] pushed as d50f8af - window-actor: Consider needs_destroy in is_destroyed() Attachment 285872 [details] pushed as 8d53ae8 - window-actor: Skip frame-sync when the corresponding window is gone Attachment 285899 [details] pushed as 98fa343 - window-actor: Keep in compositor's window list until destroyed
Attachment 285873 [details] pushed as 93205ee - global: Filter out destroyed actors from get_window_actors()
*** Bug 736770 has been marked as a duplicate of this bug. ***