Skip to content

KDE-Wayland focus backend (KWin) #31

Closed

Description

@jonocodes

What to build

Implement KdeFocusBackend(PlatformBackend) for KDE Plasma on Wayland, analogous to the existing GnomeShellFocusBackend in daemon/deckd/platform.py. The shape of the backend (D-Bus names, polling cadence, returned AppInfo fields: app_id, wm_class, title, pid) should follow whatever spike #30 decides.

End-to-end behaviour: a user on KDE Plasma Wayland installs the deckd focus counterpart (KWin script or however the spike decides), runs the daemon with no GNOME extension, focuses a window, and the connected client flips to that app's layout automatically. just watch-focus reports sensible output on KDE.

Acceptance criteria

  • KdeFocusBackend exists in daemon/deckd/platform.py and returns an AppInfo with the same fields the GNOME backend does (app_id / wm_class / title / pid where available).
  • default_backend() dispatches to KdeFocusBackend on KDE Plasma Wayland sessions (detect via XDG_CURRENT_DESKTOP=KDE + XDG_SESSION_TYPE=wayland, per the spike).
  • Backend handles the focus source missing (no script installed) gracefully — log a clear install hint analogous to the GNOME case, do not crash the daemon.
  • Tests in tests/ exercise the KDE backend against a faked D-Bus / focus source, mirroring the GNOME backend's test shape.
  • A just recipe (e.g. install-focus-kwin or similar) installs + enables the KWin script / counterpart, mirroring just install-focus-extension.
  • The focus-watcher counterpart under packaging/ (e.g. packaging/kwin/) committed, licensed and structured to match repo conventions.
  • README Focus watcher section updated to describe the KDE install/enable flow + just watch-focus usage on KDE.
  • docs/SPIKES.md cross-references this delivery from the spike entry.

Blocked by

Activity

  1. added
    enhancementNew feature or request
    focus-watcherActive-window / app-awareness detection
    ready-for-agentFully specified, ready for an AFK agent
    on Jul 18, 2026
  2. jonocodes commented on Jul 19, 2026

    @jonocodes
    OwnerAuthor

    Verified end-to-end on real KDE Plasma 6.5.5 Wayland (aarch64). All acceptance criteria met:

    • KdeFocusBackend returns AppInfo with app_id/wm_class/title/pid ✅
    • default_backend() dispatches on XDG_CURRENT_DESKTOP=KDE + XDG_SESSION_TYPE=wayland ✅
    • Graceful install-hint when the KWin script / bus owner is missing ✅
    • Faked-D-Bus tests in tests/test_focus.py ✅
    • just install-focus-kwin recipe ✅
    • packaging/kwin-script/deckd-focus committed ✅
    • README focus flow + docs/SPIKES.md cross-reference ✅

    Live behaviour confirmed: workspace.windowActivated fires on real focus changes (Konsole → System Monitor → Firefox) and the client layout follows; just watch-focus reports correct output.

    Real-hardware testing surfaced one bug in the install recipe (kpackagetool6 -u fails on a first-ever install) plus aarch64 key-injection gaps — fixed in #34.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestfocus-watcherActive-window / app-awareness detectionready-for-agentFully specified, ready for an AFK agent

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions