Repository navigation
Spike: KDE-Wayland active-window detection (focus watcher) #30
Copy link
Copy link
Closed
Labels
focus-watcherActive-window / app-awareness detectionActive-window / app-awareness detectionready-for-agentFully specified, ready for an AFK agentFully specified, ready for an AFK agentspikeDesign-doc spike work (input injection, focus watcher, etc.)Design-doc spike work (input injection, focus watcher, etc.)
Description
What to build
Investigate the most stable mechanism for getting the focused window on KDE Plasma (Wayland), in the same shape as the existing GNOME spike (#2 / docs/SPIKES.md). Candidate paths to evaluate:
org.kde.KWinD-Bus interface — does it expose the active client / caption directly?- A KWin script (analogous to the GNOME Shell extension
deckd-focus@local) publishing the active window over a session D-Bus name likeorg.deckd.Focus(so the daemon'sKdeFocusBackendcan re-use the same wire shape as the GNOME backend). wlr-foreign-toplevel-management-unstable-v1Wayland protocol — does KWin implement it? wlroots compositors do; KWin almost certainly does not, but confirm.- Hyprland / Sway / other wlroots compositors if relevant — note whether one wlroots backend could double-cover the family, but the deliverable of this spike is just KDE/KWin.
Pick one path, record the decision + evidence in docs/SPIKES.md. The output should be concrete enough that a follow-up implementation ticket can be written against it without re-investigation: chosen API, the D-Bus name / object path / method shape the KWin script should expose, install/enable steps for the script on a fresh KDE box, and any permissions / Wayland gotchas.
Acceptance criteria
- Each candidate above is evaluated and recorded as viable / rejected with a one-line reason.
- A clear recommendation is reached (one path), with the shape the daemon-side
KdeFocusBackendshould call (gdbusinvocation or Wayland client) noted. -
docs/SPIKES.mdupdated with a new "KDE-Wayland active-window detection" section parallel to the GNOME spike entry, OR a new spike file linked from it. - If a throwaway KWin script or
gdbussnippet is used during investigation, the minimal reproducible snippet is committed underpackaging/orscripts/so it can be referenced by the implementation ticket.
Blocked by
- None — can start immediately.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
focus-watcherActive-window / app-awareness detectionActive-window / app-awareness detectionready-for-agentFully specified, ready for an AFK agentFully specified, ready for an AFK agentspikeDesign-doc spike work (input injection, focus watcher, etc.)Design-doc spike work (input injection, focus watcher, etc.)
Activity
jonocodes commentedon Jul 19, 2026
Spike complete in commit ed6d3a2. Findings in
docs/spike-kde-wayland-focus.md(558 lines, primary-source-verified against the KWin tree). Recommendation: KWin script pushes the active-window JSON into a daemon-ownedorg.deckd.Focuscache viacallDBus;GnomeShellFocusBackendpolls unchanged → identical wire shape to GNOME. Key findings: KWin scripts can onlycallDBusoutbound (no name ownership), and KWin does not implementwlr-foreign-toplevel-management-v1/ext-foreign-toplevel-list-v1despite Wayland Explorer's claims. Committed a KWin script scaffold underpackaging/kwin-script/deckd-focus/for #31 to harden. Five open questions handed to #31 (bus-name gating, install UX, hot-start + persist, live introspection, wlroots backend). Implementation ticket #31 now unblocked.Promote X11 focus backend to supported (#29)
Spike: KDE-Wayland active-window detection (#30)
KDE Plasma Wayland focus backend (#31)
review (#31): KdeFocusBackend subclasses GnomeShellFocusBackend