mirror of
https://github.com/labwc/labwc.git
synced 2026-06-13 14:33:18 -04:00
When cycle mode is active (Alt+Tab held), scrolling the mouse wheel cycles through windows. Scroll down advances to the next window, scroll up goes to the previous window. This uses the same LAB_CYCLE_DIR_FORWARD/BACKWARD constants as the keyboard handler, ensuring consistent navigation behavior. No configuration needed - always active during cycle mode.
1.2 KiB
1.2 KiB
Scroll Wheel Support for Window Cycle (Alt+Tab)
Summary
Add mouse scroll wheel support to the Alt+Tab window switcher. When cycle mode is active (Alt+Tab held), scrolling the mouse wheel cycles through windows — scroll down for next, scroll up for previous.
Usage
- Press and hold Alt+Tab to enter cycle mode
- Scroll wheel down → cycle to the next window
- Scroll wheel up → cycle to the previous window
- Release Alt to focus the selected window
No configuration needed — this behavior is always active during cycle mode.
Technical Details
The patch intercepts WL_POINTER_AXIS_VERTICAL_SCROLL events in handle_axis() when server.input_mode == LAB_INPUT_STATE_CYCLE. It maps:
- Negative delta (scroll up) →
LAB_CYCLE_DIR_BACKWARD - Positive delta (scroll down) →
LAB_CYCLE_DIR_FORWARD
These are the same direction constants used by the keyboard handler (handle_cycle_view_key() in keyboard.c), ensuring consistent behavior between keyboard and mouse navigation.
The event is consumed (not forwarded to clients or processed as mouse bindings) when cycle mode is active.
Files Changed
src/input/cursor.c— Added scroll wheel interception inhandle_axis()