Skip to content

fix(hyprland): misc hardening with ipc socket and events#4910

Open
khaneliman wants to merge 4 commits intoAlexays:masterfrom
khaneliman:hyprland
Open

fix(hyprland): misc hardening with ipc socket and events#4910
khaneliman wants to merge 4 commits intoAlexays:masterfrom
khaneliman:hyprland

Conversation

@khaneliman
Copy link
Contributor

@khaneliman khaneliman commented Mar 7, 2026

Formatting handled in #4911

The Hyprland IPC helper cached the socket folder with the first instance
signature already appended, so later calls ignored their instanceSig argument
and always reused the first path. That made the helper violate its own API even
though most real Waybar sessions only talk to a single Hyprland instance.

Cache only the base socket directory and append the requested signature per
lookup. This fixes correctness for tests, nested or debug multi-instance
setups, and future code that needs to resolve a different signature, without
claiming support for one Waybar process managing multiple Hyprland sessions.

Signed-off-by: Austin Horstman <khaneliman12@gmail.com>
The window module re-entered the same shared_mutex while refreshing IPC state:
update() took the lock and then called queryActiveWorkspace(), which tried to
lock it again. That is undefined behavior for std::shared_mutex and could
manifest as a deadlock.

Remove the recursive lock path and reset the derived window state before each
IPC refresh. That keeps solo/floating/swallowing/fullscreen classes from
sticking around when the client lookup fails or a workspace becomes empty.

Signed-off-by: Austin Horstman <khaneliman12@gmail.com>
Hyprland workspace reloads could stack duplicate scroll-event connections,
causing a single wheel gesture to switch multiple workspaces after repeated
config reloads. The persistent-workspaces monitor-array form also created the
monitor name instead of the configured workspace name.

Disconnect and replace the scroll handler on reinit, fix the persistent
workspace name selection, normalize urgent-window address matching, and reject
malformed workspace payloads before they corrupt the local state machine.

Signed-off-by: Austin Horstman <khaneliman12@gmail.com>
The language and submap modules assumed their Hyprland payload delimiters were
always present. When that assumption is violated, the old code could perform
invalid iterator math or throw while slicing the event string.

Validate the expected separators up front and bail out with a warning when the
event is malformed so the modules degrade safely instead of crashing the update
path.

Signed-off-by: Austin Horstman <khaneliman12@gmail.com>
@khaneliman khaneliman force-pushed the hyprland branch 2 times, most recently from 8f1e01a to 3a26728 Compare March 7, 2026 00:49
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.

1 participant