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

@ -56,8 +56,8 @@ void cycle_step(struct server *server, enum lab_cycle_dir direction);
/* Closes the OSD */
void cycle_finish(struct server *server, bool switch_focus);
/* Notify OSD about a destroying view */
void cycle_on_view_destroy(struct view *view);
/* Re-initialize the window switcher */
void cycle_reinitialize(struct server *server);
/* Focus the clicked window and close OSD */
void cycle_on_cursor_release(struct server *server, struct wlr_scene_node *node);