core: Avoid notifying the stack manager of frame reparents during unmanaging

This may result in a view of the stack in MetaStackManager that does not correspond
to reality, since the window is already being unmanaged, there is no point either in
notifying the stack manager about it.

This slight divergence with reality in the MetaStackManager may produce a non-accurate
view if querying its state has to go through the predicted branches. Later synchronization
with the X11 stack may even this out, but the result really depends on when it is asked.
Fixes some intermittent failures in the stacking/closed-transient-only-take-focus-parents
unit test.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2175>
This commit is contained in:
Carlos Garnacho 2022-11-21 12:59:42 +01:00 committed by Marge Bot
parent a60863838e
commit dae981cc5c

View File

@ -193,10 +193,13 @@ meta_window_destroy_frame (MetaWindow *window)
}
if (!x11_display->closing)
{
if (!window->unmanaging)
{
meta_stack_tracker_record_add (window->display->stack_tracker,
window->xwindow,
XNextRequest (x11_display->xdisplay));
}
XReparentWindow (x11_display->xdisplay,
window->xwindow,