Skip to content

[ryoku] wm: read Hyprland state over the request socket - #548

Merged
neur0map merged 4 commits into
Ryoku-dev:unstable-devfrom
itsKontra:perf/hyprland-provider-reads
Oct 25, 2026
Merged

neur0map merged 4 commits into
Ryoku-dev:unstable-devfrom
itsKontra:perf/hyprland-provider-reads

Conversation

@itsKontra

@itsKontra itsKontra commented Oct 25, 2026 •

Copy link
Copy Markdown
Contributor

What changed

The Hyprland provider read compositor state by forking hyprctl, and two providers ran side by side. A workspace switch cost six process launches. Reads now use the request socket, and Ryogami subscribes to windows only when a pause rule reads them.

  • New query (wm/hyprland/query.go) sends j/<args> to .socket.sock. The watch reads and the act reads use it. Commands that change state stay on hyprctl.
  • The geometry poll shares the same path, which removes readWindowsDirect/controlQuery.
  • Ryogami streams windows only while a fullscreen, maximized or full-width pause rule is on, or while the caps probe has not answered yet. A playback.* setting change restarts the stream with the new kinds.

Fixes itsKontra#220

Estimated improvement

About 6 hyprctl launches per workspace switch, and ~900 launches/min under title churn, drop to near zero. With one fewer provider following windows, its CPU (2 × 0.33%) and wakeups (2 × ~360/s) should roughly halve or better. The before figures come from the issue; the after is an estimate, not measured.

Area

ryoku

How it was tested

  • go build, go vet and go test pass in ryoku/wm and ryoku/shell/ryogami/daemon, and gofmt is clean.
  • New tests cover the socket request, the watch kinds and which rules need windows.
  • Not yet tested on a running system. To check on Hyprland: the bar and workspaces stay current; summon, window.place and touchpad still work; toggling the Ryogami pause rules works; the process-launch count per switch is near zero.

Follow-up: geometry is still polled at 4 Hz while a floating window is visible, now over the socket. Making it on-demand needs a contract change.

Checklist

  • One logical change, with a clear [area] scope: summary commit subject.
  • Matching CHANGELOG.md updated in the area I touched.
  • The git hooks pass locally; I did not use --no-verify.
  • Lua parses (luac -p), shell scripts pass bash -n, and QML passes
    qmllint where applicable.
  • No duplicated config, no dead code, no commented-out code, no em-dash.
  • Docs updated if behavior or layout changed.

Every watch refresh forked hyprctl for monitors, workspaces, clients and
devices, so a workspace switch launched three processes per provider.
Reads now go through one query choke point that speaks the -j request on
the compositor's request socket; commands that change state stay on
hyprctl. The geometry poll shares the same path.

Note: Fixed: Switching workspaces or retitling windows on Hyprland no longer launches helper processes for every update
Ryogami asked its provider for the window list even when no playback
rule looks at it, so every title change and floating window cost a
second refresh beside the shell's. The stream now carries windows only
while a fullscreen, maximised or full-width rule is on, and restarts
with the new kinds when those settings change.

Note: Fixed: The wallpaper daemon no longer tracks every window when no window-based pause rule is enabled
A full-width pause rule needs the window list only where the compositor
fills columns, which Ryogami learns from the caps probe. If that probe
failed when the stream started, the rule went blind until a setting
changed. Unknown caps now keep the list in the stream.

Note: Fixed: The full-width wallpaper pause works when the compositor answers late at login
@neur0map
neur0map merged commit b05f9d1 into Ryoku-dev:unstable-dev Oct 25, 2026
19 checks passed
@neur0map

Copy link
Copy Markdown
Member

Thanks for the work here, this ships in the next v1 release.

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.

2 participants