Skip to content

fix: compositor dispatch edge cases, workspace scroll monitor match, tray hot-reload - #965

Open
dacrab wants to merge 1 commit into
MalpenZibo:mainfrom
dacrab:fix/workspace-scroll-niri-spawn-lua-escape
Open

fix: compositor dispatch edge cases, workspace scroll monitor match, tray hot-reload#965
dacrab wants to merge 1 commit into
MalpenZibo:mainfrom
dacrab:fix/workspace-scroll-niri-spawn-lua-escape

Conversation

@dacrab

@dacrab dacrab commented Sep 11, 2026

Copy link
Copy Markdown
Contributor

Part of the cleanup discussed in #964 — this is the standalone bug-fix slice (each fix independent, no behavior questions beyond what's described).

Workspaces: scroll monitor matching

Message::Scroll located the current workspace with name.contains(w.monitor.as_str()), while the view() filter a few lines below deliberately uses equality — its comment explains .contains() "falsely matches any pair where one name is a substring of the other — most commonly eDP-1 vs DP-1". The scroll handler apparently predated that fix. Consequence: scrolling the laptop (eDP-1) bar matched a DP-1 workspace as current and navigated the external monitor's workspaces. One-line change to ==, mirroring the view filter.

Niri: spawn custom dispatch

CustomDispatch("spawn", args) built Action::Spawn { command: vec![args] } — the whole args string as a single argv element, so spawn kitty --hold sh (or anything with flags) never worked. Split on whitespace like a shell would (no quoting support; happy to switch to shlex if you'd rather).

Hyprland: unescaped interpolation into Lua dispatch

toggle_special("…") / focus special:… / CustomDispatch interpolated user-controlled names straight into the generated Lua string. A special-workspace name containing " or \ (both legal in Hyprland config) produced a Lua syntax error and silently broke toggling on Lua-config systems. Adds a small escape_lua_string helper used at the three interpolation sites.

Tray: config hot-reload silently skipped

Tray was the only module with a config but no ConfigReloaded handling in App::refresh_config, so changing [tray] blocklist / right_click in config.toml did nothing until restart while every sibling hot-reloads. Adds the variant + update arm + wiring, mirroring how notifications/osd do it.

…tray hot-reload

- workspaces: scroll used substring monitor matching while the view
  filter deliberately uses equality — the eDP-1 bar scrolled the DP-1
  monitor's workspaces (same false match the view comment warns about)
- niri: CustomDispatch("spawn") passed the whole args string as one
  argv element, so any command with flags never worked; split on
  whitespace
- hyprland: Lua dispatch interpolated workspace/dispatcher names into
  the generated program unescaped; a name containing \ or " broke
  toggling on Lua-config systems
- tray: config hot-reload was silently skipped (only module without
  ConfigReloaded), so [tray] blocklist/right_click changes needed a
  restart
@github-actions github-actions Bot added the bug Something isn't working label Sep 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant