Skip to content

fix(hyprland): detect the Lua protocol with eval instead of systeminfo - #5421

Open
Fiwex wants to merge 1 commit into
Alexays:masterfrom
Fiwex:fix/hyprland-eval-protocol-probe
Open

Fiwex wants to merge 1 commit into
Alexays:masterfrom
Fiwex:fix/hyprland-eval-protocol-probe

Conversation

@Fiwex

@Fiwex Fiwex commented Oct 27, 2026

Copy link
Copy Markdown
Contributor

What does this PR do?

The first click on a hyprland/workspaces button resolves the dispatch protocol with a systeminfo request. Hyprland answers it by running lspci -vnn synchronously on its main thread (src/helpers/SystemInfo.cpp), and reading the PCI config space of a runtime-suspended discrete GPU wakes it up. On hybrid-GPU laptops the whole compositor freezes until the dGPU has resumed. That matches #5286: the first click freezes the system, later clicks are fine, and it comes back when Waybar restarts. Keybinds and gestures don't go through Waybar, so they never trigger it.

This replaces the probe with eval return nil:

  • Only the Lua config manager runs eval and answers ok.
  • The legacy manager answers eval is only supported with the lua config manager. eval landed in 0.55 together with the Lua manager, so this still covers a 0.55+ instance started with a hyprland.conf.
  • Hyprland < 0.55 answers unknown request.

So the result is the same as with the configProvider check. In Lua mode, Hyprland runs a dispatch request through the same eval path, so the probe adds no side effect the click doesn't already have.

Measured on Hyprland 0.56.2, Ryzen 5000 (Cezanne) + RTX 3050 Ti Mobile, 3 runs each, starting with the dGPU runtime-suspended:

request time dGPU afterwards
systeminfo 1640–1659 ms woken up
eval return nil 9–26 ms still suspended

isLuaConfigProvider and its tests are replaced by isLuaEvalReply, tested on the replies Hyprland actually sends.

Related issues

Closes #5286

Checklist

I reproduced the freeze, tested the fix on my machine, and reviewed the diff. With the help of Claude Code for both the code, and this description.

Hyprland answers "systeminfo" by running lspci on its main thread, which
wakes a runtime-suspended dGPU: on hybrid-GPU laptops the first workspace
click froze the compositor for over a second. A no-op "eval" is answered
"ok" only by the Lua config manager and touches no hardware.

Closes Alexays#5286

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@EldinBegano

Copy link
Copy Markdown

i just tested your fix on 0.57 and it worked for me

@FarukOfCulture

Copy link
Copy Markdown

Works for me as well on 0.57

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

System freezes for a few seconds on first workspace switch via mouse click in hyprland/workspaces

3 participants