mirror of
https://github.com/labwc/labwc.git
synced 2026-02-26 01:40:22 -05:00
view: separate (un)minimize and (un)map logic
Map/unmap logic is currently re-used for minimize/unminimize, but lots of it doesn't actually apply in that case. This is both confusing and creates some extra complexity, such as: - extra "client_request" parameter to unmap(), in which case it has to still do some cleanup even if view->mapped is already false - various "view->mapped || view->minimized" checks when we really just mean "is the view mapped" To clean this all up, let's put the logic that really is common into a new view_update_visiblity() function, and stop using map/unmap for minimize/unminimize. Note that this changes the meaning of "view->mapped", which used to mean "mapped and not minimized" but now really just means "mapped". I left some "view->mapped" conditions as-is (rather than changing to "view->mapped && !view->minimized") where it seemed to make sense. v2: add view_update_visibility() as suggested by tokyo4j
This commit is contained in:
parent
20087e89b2
commit
b5e2eb216e
6 changed files with 75 additions and 110 deletions
|
|
@ -145,7 +145,7 @@ desktop_topmost_focusable_view(struct server *server)
|
|||
continue;
|
||||
}
|
||||
view = node_view_from_node(node);
|
||||
if (view->mapped && view_is_focusable(view)) {
|
||||
if (view_is_focusable(view) && !view->minimized) {
|
||||
return view;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue