Phosphor
Qt6 / Wayland library suite for window-management tools
 
Loading...
Searching...
No Matches
ServiceConstants.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: 2026 fuddlesworth
2// SPDX-License-Identifier: LGPL-2.1-or-later
3
4#pragma once
5
6#include <QLatin1String>
7
9
16inline constexpr QLatin1String Name("org.plasmazones");
17inline constexpr QLatin1String ObjectPath("/PlasmaZones");
18
19namespace Interface {
20inline constexpr QLatin1String Settings("org.plasmazones.Settings");
21inline constexpr QLatin1String WindowDrag("org.plasmazones.WindowDrag");
22inline constexpr QLatin1String WindowTracking("org.plasmazones.WindowTracking");
23inline constexpr QLatin1String Overlay("org.plasmazones.Overlay");
24inline constexpr QLatin1String Autotile("org.plasmazones.Autotile");
25inline constexpr QLatin1String LayoutRegistry("org.plasmazones.LayoutRegistry");
26inline constexpr QLatin1String Screen("org.plasmazones.Screen");
27inline constexpr QLatin1String ZoneDetection("org.plasmazones.ZoneDetection");
28inline constexpr QLatin1String CompositorBridge("org.plasmazones.CompositorBridge");
29inline constexpr QLatin1String Snap("org.plasmazones.Snap");
30inline constexpr QLatin1String WindowRules("org.plasmazones.WindowRules");
31}
32
36namespace Error {
37inline constexpr QLatin1String Busy("org.plasmazones.Error.Busy");
38inline constexpr QLatin1String Shutdown("org.plasmazones.Error.Shutdown");
39}
40
47namespace SettingProperty {
48inline constexpr QLatin1String ShaderProfileTree("shaderProfileTree");
49inline constexpr QLatin1String MotionProfileTree("motionProfileTree");
50inline constexpr QLatin1String AnimationShaderSearchPaths("animationShaderSearchPaths");
51}
52
59namespace WindowMetadataKey {
60inline constexpr QLatin1String IsMinimized("isMinimized");
61inline constexpr QLatin1String IsFullscreen("isFullscreen");
62inline constexpr QLatin1String IsSticky("isSticky");
63inline constexpr QLatin1String IsMaximized("isMaximized");
64inline constexpr QLatin1String IsFocused("isFocused");
65inline constexpr QLatin1String IsTransient("isTransient");
66inline constexpr QLatin1String IsNotification("isNotification");
67inline constexpr QLatin1String KeepAbove("keepAbove");
68inline constexpr QLatin1String KeepBelow("keepBelow");
69inline constexpr QLatin1String SkipTaskbar("skipTaskbar");
70inline constexpr QLatin1String SkipPager("skipPager");
71inline constexpr QLatin1String SkipSwitcher("skipSwitcher");
72inline constexpr QLatin1String IsModal("isModal");
73inline constexpr QLatin1String HasDecoration("hasDecoration");
74inline constexpr QLatin1String IsResizable("isResizable");
75inline constexpr QLatin1String Width("width");
76inline constexpr QLatin1String Height("height");
77inline constexpr QLatin1String PositionX("positionX");
78inline constexpr QLatin1String PositionY("positionY");
79inline constexpr QLatin1String CaptionNormal("captionNormal");
80}
81
85namespace Apps {
86namespace Settings {
87inline constexpr QLatin1String ServiceName("org.plasmazones.Settings.App");
88inline constexpr QLatin1String ObjectPath("/SettingsApp");
89inline constexpr QLatin1String Interface("org.plasmazones.SettingsController");
90}
91namespace Editor {
92inline constexpr QLatin1String ServiceName("org.plasmazones.Editor.App");
93inline constexpr QLatin1String ObjectPath("/EditorApp");
94inline constexpr QLatin1String Interface("org.plasmazones.EditorController");
95}
96}
97
98// Protocol version. Bumped when the D-Bus method/signal schema changes in a
99// backwards-incompatible way (e.g. dragStopped out-params changed, new
100// required signal). Both sides check the peer's version at bridge registration
101// and reject if below their minimum. The version is a simple integer string
102// ("1", "2", …) to keep comparison trivial.
103//
104// v1: original protocol (Phosphor v3.0–v3.x)
105// v2: split dragStopped + snapAssistReady signal (Phase C);
106// WindowGeometryEntry gained `screenId` (a(siiiis)) so the compositor
107// can seed its tracked-screen cache from the daemon's authoritative
108// answer instead of re-deriving from geometry (which races with VS
109// reconfig).
110// v3: setSnapAssistThumbnail signature changed from (s, s data:URL) to
111// (s, i, i, ay raw ARGB32) returning b. Thumbnail capture moved
112// out of the daemon and into the kwin-effect (OffscreenQuickScene
113// + WindowThumbnail through KWin's live compositor texture);
114// daemon ScreenShot2 D-Bus dependency and the matching
115// X-KDE-DBUS-Restricted-Interfaces gate are dropped. Mismatched
116// peers fail the bridge handshake instead of producing
117// method-not-found at first thumbnail post.
118// v4: setWindowMetadata widened from 4 args (instanceId, appId,
119// desktopFile, title) to 10: adds windowRole, pid, virtualDesktop,
120// activity, windowType, plus a trailing a{sv} (QVariantMap) carrying the
121// extended window-property snapshot (state flags, geometry, accessory
122// flags, captionNormal — see WindowMetadataKey) so the daemon's
123// window-rule resolvers match the same KWin-property fields the effect
124// path resolves live. A stale effect sending an older form would fail
125// marshalling, so the bridge handshake rejects mismatched peers up front.
126//
127inline constexpr int ApiVersion = 4;
128inline constexpr int MinPeerApiVersion = 4;
129
130// Hard cap on blocking synchronous D-Bus calls from the editor/settings
131// apps to the daemon. Qt's default is 25 seconds, long enough to freeze
132// the UI for tens of seconds if the daemon event loop is busy. Daemon-side
133// settings/shader handlers are all in-memory hash lookups (sub-millisecond
134// in the healthy case), so 500 ms is generous while still degrading
135// gracefully to caller-side defaults when the daemon is unresponsive.
136inline constexpr int SyncCallTimeoutMs = 500;
137
138// Timeout for the kwin-effect's daemon-readiness probe (an Introspect call
139// fired against the org.plasmazones service to detect "daemon up but the
140// daemonReady signal was emitted before the effect connected"). 3 s gives
141// the daemon ample time to answer once its event loop is responsive while
142// still keeping the effect from hanging on a wedged daemon.
143inline constexpr int DaemonReadyProbeTimeoutMs = 3000;
144
145// Timeout for the kwin-effect's snap-assist thumbnail post (carries an
146// ARGB32 pixel payload). 2 s is "definitely something is wrong, drop the
147// watcher" rather than expected latency. Without it, the effect would
148// otherwise leak a watcher per snap-assist candidate per show until Qt's
149// default 25 s timeout expires, which under daemon stress turns a
150// transient hang into accumulated compositor-process state.
151inline constexpr int SnapAssistThumbnailPostTimeoutMs = 2000;
152
153// Shared cap for the snap-assist thumbnail LRU. The daemon sizes its
154// QCache<QString, QImage> against this; the kwin-effect mirrors it for the
155// "skip recently-posted handle" dedup window. Keeping the literal here
156// (rather than two unrelated `static constexpr int`s in the daemon and the
157// effect) means a future tuning bump moves both sides atomically — there
158// is no longer a window where the effect believes the daemon holds entries
159// the daemon has already evicted. 24 × 256² ARGB32 ≈ 6 MB on the daemon.
160inline constexpr int SnapAssistThumbnailCacheCapacity = 24;
161
162} // namespace PhosphorProtocol::Service
constexpr QLatin1String ObjectPath("/EditorApp")
constexpr QLatin1String ServiceName("org.plasmazones.Editor.App")
constexpr QLatin1String ObjectPath("/SettingsApp")
constexpr QLatin1String Interface("org.plasmazones.SettingsController")
constexpr QLatin1String ServiceName("org.plasmazones.Settings.App")
constexpr QLatin1String Shutdown("org.plasmazones.Error.Shutdown")
constexpr QLatin1String Busy("org.plasmazones.Error.Busy")
constexpr QLatin1String LayoutRegistry("org.plasmazones.LayoutRegistry")
constexpr QLatin1String Screen("org.plasmazones.Screen")
constexpr QLatin1String Overlay("org.plasmazones.Overlay")
constexpr QLatin1String Snap("org.plasmazones.Snap")
constexpr QLatin1String ZoneDetection("org.plasmazones.ZoneDetection")
constexpr QLatin1String WindowTracking("org.plasmazones.WindowTracking")
constexpr QLatin1String CompositorBridge("org.plasmazones.CompositorBridge")
constexpr QLatin1String Autotile("org.plasmazones.Autotile")
constexpr QLatin1String Settings("org.plasmazones.Settings")
constexpr QLatin1String WindowDrag("org.plasmazones.WindowDrag")
constexpr QLatin1String WindowRules("org.plasmazones.WindowRules")
constexpr QLatin1String AnimationShaderSearchPaths("animationShaderSearchPaths")
constexpr QLatin1String ShaderProfileTree("shaderProfileTree")
constexpr QLatin1String MotionProfileTree("motionProfileTree")
constexpr QLatin1String IsResizable("isResizable")
constexpr QLatin1String IsMaximized("isMaximized")
constexpr QLatin1String CaptionNormal("captionNormal")
constexpr QLatin1String PositionY("positionY")
constexpr QLatin1String HasDecoration("hasDecoration")
constexpr QLatin1String KeepAbove("keepAbove")
constexpr QLatin1String IsTransient("isTransient")
constexpr QLatin1String IsModal("isModal")
constexpr QLatin1String IsFullscreen("isFullscreen")
constexpr QLatin1String IsSticky("isSticky")
constexpr QLatin1String IsNotification("isNotification")
constexpr QLatin1String KeepBelow("keepBelow")
constexpr QLatin1String IsMinimized("isMinimized")
constexpr QLatin1String PositionX("positionX")
constexpr QLatin1String SkipPager("skipPager")
constexpr QLatin1String SkipTaskbar("skipTaskbar")
constexpr QLatin1String SkipSwitcher("skipSwitcher")
constexpr QLatin1String IsFocused("isFocused")
Definition ServiceConstants.h:8
constexpr int MinPeerApiVersion
Definition ServiceConstants.h:128
constexpr int SyncCallTimeoutMs
Definition ServiceConstants.h:136
constexpr int SnapAssistThumbnailCacheCapacity
Definition ServiceConstants.h:160
constexpr int ApiVersion
Definition ServiceConstants.h:127
constexpr QLatin1String Name("org.plasmazones")
D-Bus service constants shared by all compositor plugins.
constexpr QLatin1String ObjectPath("/PlasmaZones")
constexpr int SnapAssistThumbnailPostTimeoutMs
Definition ServiceConstants.h:151
constexpr int DaemonReadyProbeTimeoutMs
Definition ServiceConstants.h:143