view: disallow minimizing unmapped view

This fixes that XDG clients which send xdg_toplevel.set_minimized before
mapping its surface don't get focused, because desktop_focus_view() in map
handler only unminimizes a minimized view rather than giving focus.
This commit is contained in:
tokyo4j 2025-04-16 09:04:20 +09:00
parent 4f42b7a12b
commit 3b2b2b6396

View file

@ -764,6 +764,11 @@ _minimize(struct view *view, bool minimized)
if (view->minimized == minimized) {
return;
}
if (!view->mapped && minimized) {
/* xdg_toplevel.set_minimized can be sent before mapping */
wlr_log(WLR_DEBUG, "not minimizing unmapped view");
return;
}
if (view->impl->minimize) {
view->impl->minimize(view, minimized);