Commit graph

9 commits

Author SHA1 Message Date
tokyo4j
c4277ab507 cycle: update config to <osd output="all|cursor|focused">
I think `<windowSwitcher><osd output="keyboard">` is a bit unclear and
hard to interpret as "show OSD in the output with keyboard focus". Also,
we use "cursor" instead of "pointer" in other configurations like
`<placement policy="cursor">` and `<action name="ShowMenu" atCursor="">`.

So let's replace `output="all|pointer|keyboard"` with
`output="all|cursor|focused"`. In documentation, I reordered them to
`output="all|focused|cursor"` as "focused" feels like a bit more
sophisticated and general policy.
2025-12-02 17:09:54 +01:00
tokyo4j
9f5ff391cc cycle: remember cycled window list in server->cycle.views
This allows changing the cycled order in the future, e.g. focused order vs
created order.

Functionally, this commit also changes the initially selected window;
before this commit, the previous/next of the topmost window was always
selected, but now the previous/next of the active window is selected first
if it is in the cycled list. This won't change behaviors for most users,
but this ensures that the user can go back to the focused window with
Alt-Tab + Alt-Shift-Tab even when it is not the topmost window.

This commit fixes the TODO in the previous commit by trying to preserve
the selected view when a view is destroyed during window cycling.
2025-11-30 21:33:46 +00:00
tokyo4j
b6c1a9ea59 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.
2025-11-30 21:33:46 +00:00
tokyo4j
1783b805e1 cycle: factor out get_osd_impl() 2025-11-30 21:33:46 +00:00
tokyo4j
7527717caa cycle: move & rename destroy_osd_scenes() 2025-11-30 21:33:46 +00:00
tokyo4j
2b28c41b23 cycle: use dummy node to remember the scene position of previewed window
With this approach, we only need to store cycle->dummy_node instead of
cycle->preview_anchor and cycle->preview_parent and we don't need to care
about annoying cases like when the previewed window has no siblings or
when a window tracked by cycle->preview_anchor is destroyed.
2025-11-30 20:56:34 +09:00
tokyo4j
c1f3286cfe src/cycle/cycle.c: remove node->enabled check before _set_enabled()
wlr_scene_node_set_enabled() just returns early when it doesn't change
enabled state.
2025-11-30 20:56:34 +09:00
tokyo4j
4fcb873f6f Use "cycle" instead of "osd" across the codebase
We were using the word "osd" to describe the window switcher, but it can
be used with on-screen display (OSD) disabled by
`<windowSwitcher><osd show="false">`. Let's use "cycle" instead to avoid
confusion.
2025-11-30 16:20:16 +09:00
tokyo4j
65cc2e40ba Rename osd.{h,c} to cycle.{h,c} 2025-11-30 16:20:16 +09:00
Renamed from src/osd/osd.c (Browse further)