desktop: harden window stacking order while window switching

This commit moves the check against server->input_mode from the callers
of desktop_focus_view() into desktop_focus_view() itself. This
eliminates code duplications and makes it harder to mess up the window
stacking order while window switching.

I also added the same check in view_minimize() so that minimize requests
from panels never messes up the window stacking order (I think only this
should be described in the release note).
This commit is contained in:
tokyo4j 2025-02-24 21:40:46 +09:00 committed by Johan Malm
parent cf759ec183
commit 270b45da88
6 changed files with 13 additions and 25 deletions

View file

@ -803,6 +803,12 @@ void
view_minimize(struct view *view, bool minimized)
{
assert(view);
if (view->server->input_mode == LAB_INPUT_STATE_WINDOW_SWITCHER) {
wlr_log(WLR_ERROR, "not minimizing window while window switching");
return;
}
/*
* Minimize the root window first because some xwayland clients send a
* request-unmap to sub-windows at this point (for example gimp and its