Conversation
350c8eb to
976926a
Compare
3198ecc to
965cba3
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
On KDE Plasma + Wayland, window management is no longer possible through
X11 tools (xdotool, wmctrl). This commit introduces a KDE-specific backend
that uses KWin scripting and D-Bus to provide the same suspend/resume
functionality on that platform.
How it works:
KWin D-Bus API (org.kde.KWin).
list_windows_kde.jsenumerates all openwindows and pushes them to Nyrna over D-Bus.
active_window_kde.jssetsup a persistent workspace.windowActivated listener that sends every
subsequent focus change to Nyrna in real time.
codes.merritt.Nyrna) via agenerated
NyrnaDbusobject. The two KWin scripts call methods on thisservice (
updateWindows,updateActiveWindow) to deliver their data.KWin script to disk and loading it each time it is needed, because the KWin
scripting API does not expose a direct minimize/restore D-Bus call.
Architecture changes:
NativePlatform()is replaced by an asyncNativePlatform.initialize()factory. The extra async step is needed on Linux to resolve the session
type, set up D-Bus, and (on KDE Wayland) load the KWin scripts before the
rest of the app starts.
activeWindow()(async method) is replaced by anactiveWindowmutablefield updated by
checkActiveWindow(). On KDE Wayland the field is keptcurrent by the persistent D-Bus subscription, so
checkActiveWindow()onlyneeds to wait (poll up to 2 s) for the initial value.
SessionTypevalue type combinesDisplayProtocol(wayland / x11 /unknown) with
DesktopEnvironment(kde / gnome / xfce / unknown). It ispopulated once during
Linux.initialize()and exposed as a synchronousgetter, removing the need for async session-type checks later.
ActiveWindowServiceselects the X11 or Wayland code path based onSessionType.ActiveWindowX11andActiveWindowWaylandhold theplatform-specific logic.
Stringinstead ofintto accommodate KDE Wayland'sUUID-style
internalIdvalues. X11 integer IDs are stringified.NativePlatform.dispose()tears down D-Bus connections and cancels KWinscript subscriptions.
AppCubit.close()and the toggle-mode code path inmain()both call it.Wayland support can be extended in the future for other DEs, using the shared infrastructure introduced here.