cycle: clarify the lifecycle of window switcher

This commit clarifies the lifecycle of the window switcher (cycle) by:
- init_cycle(): initializes the window switcher (e.g. OSD).
- update_cycle(): updates the window switcher states including OSD,
  preview and outlines.
- destroy_cycle(): clears all the window switcher states.

This commit temporarily regresses by not trying to preserve the selected
view when a view is destroyed. This will be addressed in the next commit.
This commit is contained in:
tokyo4j 2025-11-30 22:10:58 +09:00 committed by Johan Malm
parent 1783b805e1
commit b6c1a9ea59
3 changed files with 65 additions and 64 deletions

View file

@ -2616,7 +2616,9 @@ view_destroy(struct view *view)
zfree(view->tiled_region_evacuate);
}
cycle_on_view_destroy(view);
/* TODO: call this on map/unmap instead */
cycle_reinitialize(server);
undecorate(view);
view_set_icon(view, NULL, NULL);