]> git.mdlowis.com Git - proto/labwc.git/commit
view: separate (un)minimize and (un)map logic
authorJohn Lindgren <john@jlindgren.net>
Fri, 21 Nov 2025 00:41:00 +0000 (19:41 -0500)
committerHiroaki Yamamoto <hrak1529@gmail.com>
Fri, 21 Nov 2025 05:01:48 +0000 (14:01 +0900)
commitb5e2eb216e3246f76ac5917b1d23897e8fd7921c
tree656ad72e5b711dc817315dd44cf43a66f0fcca80
parent20087e89b2718e51f770078237622b812fc146ba
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
include/view.h
src/desktop.c
src/view-impl-common.c
src/view.c
src/xdg.c
src/xwayland.c