From dae981cc5c63b05225b4e1dcc2d544adb917ccfb Mon Sep 17 00:00:00 2001 From: Carlos Garnacho Date: Mon, 21 Nov 2022 12:59:42 +0100 Subject: [PATCH] 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: --- src/core/frame.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/core/frame.c b/src/core/frame.c index 9c8cbb946..f995ca2c3 100644 --- a/src/core/frame.c +++ b/src/core/frame.c @@ -194,9 +194,12 @@ meta_window_destroy_frame (MetaWindow *window) if (!x11_display->closing) { - meta_stack_tracker_record_add (window->display->stack_tracker, - window->xwindow, - XNextRequest (x11_display->xdisplay)); + if (!window->unmanaging) + { + meta_stack_tracker_record_add (window->display->stack_tracker, + window->xwindow, + XNextRequest (x11_display->xdisplay)); + } XReparentWindow (x11_display->xdisplay, window->xwindow,