feat(desktop): add Hyprland support - #117
Conversation
|
@eklonofficial will definitely review this but might take some time for me to find a chance to test it. |
|
No problem, take your time! |
mmaher88
left a comment
There was a problem hiding this comment.
Validated locally: clean rebase onto master, full suite green (747 C++ / 72 QML). The event-socket approach is the cleanest of the three DE integrations — push-based via QLocalSocket with auto-reconnect, no polling or subprocess (KDE still falls back to a 500ms D-Bus poll). IDesktopIntegration change is a doc comment only, so KDE/GNOME paths are untouched. Tests are substantive (real QLocalServer simulating the compositor socket, focus de-duplication, modifier decoding, invalid-JSON handling) and the wiki docs match the implementation with no drift. Graceful degradation when HYPRLAND_INSTANCE_SIGNATURE/socket are absent is handled. Thanks — nice contribution.
Follow-up on my side: the README DE-support table still lists only KDE/GNOME/Other, so Hyprland currently falls under "Other DEs" which shows per-app profiles as unsupported. I'll open a separate PR to add the column.
Hyprland support landed in #117 but the README table still listed only KDE/GNOME/Other, so Hyprland fell under "Other DEs" — which shows per-app profiles and auto-switching as unsupported, understating what it does. Focus tracking is implemented over the compositor event socket, so per-app profiles and auto profile switching are supported. blockGlobalShortcuts is a documented no-op (Hyprland has no stable compositor-wide shortcut-block API), so that row is marked unsupported and the note explains the consequence.
Previously Hyprland fell back to
GenericDesktopwhich meant no active-window tracking and not per-app profile switching, this should fix that. It detects hyprland viaXDG_CURRENT_DESKTOPorHYPRLAND_INSTANCE_SIGNATURE, connects to hyprland's event socket, and listens for activewindow events, then routes them through the existing desktop-file resolution and theactiveWindowChangedsignal so the rest of the logic is untouched. For now, there's only 3 preset: close window, switch desktop left, and switch desktop right, and they only appear when a matching live Hyrpland keybind exists.