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");
30}
31
35namespace Error {
36inline constexpr QLatin1String Busy("org.plasmazones.Error.Busy");
37inline constexpr QLatin1String Shutdown("org.plasmazones.Error.Shutdown");
38}
39
46namespace SettingProperty {
47inline constexpr QLatin1String ShaderProfileTree("shaderProfileTree");
48inline constexpr QLatin1String AnimationAppRules("animationAppRules");
49inline constexpr QLatin1String MotionProfileTree("motionProfileTree");
50inline constexpr QLatin1String AnimationShaderSearchPaths("animationShaderSearchPaths");
51}
52
56namespace Apps {
57namespace Settings {
58inline constexpr QLatin1String ServiceName("org.plasmazones.Settings.App");
59inline constexpr QLatin1String ObjectPath("/SettingsApp");
60inline constexpr QLatin1String Interface("org.plasmazones.SettingsController");
61}
62namespace Editor {
63inline constexpr QLatin1String ServiceName("org.plasmazones.Editor.App");
64inline constexpr QLatin1String ObjectPath("/EditorApp");
65inline constexpr QLatin1String Interface("org.plasmazones.EditorController");
66}
67}
68
69// Protocol version. Bumped when the D-Bus method/signal schema changes in a
70// backwards-incompatible way (e.g. dragStopped out-params changed, new
71// required signal). Both sides check the peer's version at bridge registration
72// and reject if below their minimum. The version is a simple integer string
73// ("1", "2", …) to keep comparison trivial.
74//
75// v1: original protocol (PlasmaZones v3.0–v3.x)
76// v2: split dragStopped + snapAssistReady signal (Phase C);
77// WindowGeometryEntry gained `screenId` (a(siiiis)) so the compositor
78// can seed its tracked-screen cache from the daemon's authoritative
79// answer instead of re-deriving from geometry (which races with VS
80// reconfig).
81// v3: setSnapAssistThumbnail signature changed from (s, s data:URL) to
82// (s, i, i, ay raw ARGB32) returning b. Thumbnail capture moved
83// out of the daemon and into the kwin-effect (OffscreenQuickScene
84// + WindowThumbnail through KWin's live compositor texture);
85// daemon ScreenShot2 D-Bus dependency and the matching
86// X-KDE-DBUS-Restricted-Interfaces gate are dropped. Mismatched
87// peers fail the bridge handshake instead of producing
88// method-not-found at first thumbnail post.
89//
90inline constexpr int ApiVersion = 3;
91inline constexpr int MinPeerApiVersion = 3;
92
93// Hard cap on blocking synchronous D-Bus calls from the editor/settings
94// apps to the daemon. Qt's default is 25 seconds, long enough to freeze
95// the UI for tens of seconds if the daemon event loop is busy. Daemon-side
96// settings/shader handlers are all in-memory hash lookups (sub-millisecond
97// in the healthy case), so 500 ms is generous while still degrading
98// gracefully to caller-side defaults when the daemon is unresponsive.
99inline constexpr int SyncCallTimeoutMs = 500;
100
101// Timeout for the kwin-effect's daemon-readiness probe (an Introspect call
102// fired against the org.plasmazones service to detect "daemon up but the
103// daemonReady signal was emitted before the effect connected"). 3 s gives
104// the daemon ample time to answer once its event loop is responsive while
105// still keeping the effect from hanging on a wedged daemon.
106inline constexpr int DaemonReadyProbeTimeoutMs = 3000;
107
108// Timeout for the kwin-effect's snap-assist thumbnail post (carries an
109// ARGB32 pixel payload). 2 s is "definitely something is wrong, drop the
110// watcher" rather than expected latency. Without it, the effect would
111// otherwise leak a watcher per snap-assist candidate per show until Qt's
112// default 25 s timeout expires, which under daemon stress turns a
113// transient hang into accumulated compositor-process state.
114inline constexpr int SnapAssistThumbnailPostTimeoutMs = 2000;
115
116// Shared cap for the snap-assist thumbnail LRU. The daemon sizes its
117// QCache<QString, QImage> against this; the kwin-effect mirrors it for the
118// "skip recently-posted handle" dedup window. Keeping the literal here
119// (rather than two unrelated `static constexpr int`s in the daemon and the
120// effect) means a future tuning bump moves both sides atomically — there
121// is no longer a window where the effect believes the daemon holds entries
122// the daemon has already evicted. 24 × 256² ARGB32 ≈ 6 MB on the daemon.
123inline constexpr int SnapAssistThumbnailCacheCapacity = 24;
124
125} // 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 AnimationShaderSearchPaths("animationShaderSearchPaths")
constexpr QLatin1String ShaderProfileTree("shaderProfileTree")
constexpr QLatin1String AnimationAppRules("animationAppRules")
constexpr QLatin1String MotionProfileTree("motionProfileTree")
Definition ServiceConstants.h:8
constexpr int MinPeerApiVersion
Definition ServiceConstants.h:91
constexpr int SyncCallTimeoutMs
Definition ServiceConstants.h:99
constexpr int SnapAssistThumbnailCacheCapacity
Definition ServiceConstants.h:123
constexpr int ApiVersion
Definition ServiceConstants.h:90
constexpr QLatin1String Name("org.plasmazones")
D-Bus service constants shared by all compositor plugins.
constexpr QLatin1String ObjectPath("/PlasmaZones")
constexpr int SnapAssistThumbnailPostTimeoutMs
Definition ServiceConstants.h:114
constexpr int DaemonReadyProbeTimeoutMs
Definition ServiceConstants.h:106