fix(hyprland/workspaces): adapt dispatch commands for Lua IPC protocol#5013
Conversation
Hyprland 0.54 replaced the text-based dispatch socket protocol with a Lua-based one. Commands like "dispatch workspace 1" are now interpreted as invalid Lua (return hl.dispatch(workspace 1)), breaking workspace clicks and scroll navigation. Add IPC::dispatch() that probes the running Hyprland on first call and routes commands through the new hl.dsp Lua API when the Lua protocol is detected, falling back to the old text format otherwise.
@zjeffer thanks for the review! I've checked |
I misread, I thought they used getSocket1Reply. Nevermind. I just noticed we have tests in test/hyprland/backend.cpp, can you add tests for the new backend functions (where possible)? |
Move buildLuaDispatch and isLuaProtocol from private to protected/public so IPCTestHelper can access them. Add 7 tests covering all buildLuaDispatch branches, dispatch error path, and isLuaProtocol cache behavior.
@zjeffer done — added 7 unit tests for the new backend functions. Had to move |
|
Hey @Alexays, since this fix is very important for hyprland users and addresses a breaking change, I was wondering if it would be possible to release v0.15.1, which would be really helpful. Thanks in advance |
Hyprland 0.54 replaced the text-based dispatch socket protocol with a Lua-based one. Commands like "dispatch workspace 1" are now interpreted as invalid Lua (return hl.dispatch(workspace 1)), breaking workspace clicks and scroll navigation.
Add IPC::dispatch() that probes the running Hyprland on first call and routes commands through the new hl.dsp Lua API when the Lua protocol is detected, falling back to the old text format otherwise.
Affected dispatchers:
workspace,focusworkspaceoncurrentmonitor,togglespecialworkspace