#include <PhosphorCompositor/DaemonClient.h>
Signals | |
| void | daemonReady () |
| void | daemonDisconnected () |
| void | bridgeRegistered (const QString &sessionId, int peerApiVersion) |
| void | bridgeRejected (const QString &reason) |
| void | floatingWindowsReceived (const QStringList &windowIds) |
| void | snappedWindowsReceived (const QStringList &windowIds) |
| void | pendingRestoreGeometriesReceived (const QString &json) |
| void | virtualScreensReceived (const QString &screenId, const PhosphorProtocol::WindowGeometryList &geometries) |
| void | settingsChanged () |
| void | virtualScreensChanged (const QString &screenId) |
| void | dragPolicyReceived (const QString &windowId, const PhosphorProtocol::DragPolicy &policy) |
| Daemon's reply to beginDrag. | |
| void | dragOutcomeReceived (const QString &windowId, const PhosphorProtocol::DragOutcome &outcome) |
| Daemon's reply to endDrag. | |
| void | snapAssistReady (const QString &windowId, const QString &screenId, const PhosphorProtocol::EmptyZoneList &zones) |
| void | pendingRestoresAvailable () |
| void | reapplyGeometriesRequested () |
| void | runningWindowsRequested () |
Public Member Functions | |
| DaemonClient (QObject *parent=nullptr) | |
| ~DaemonClient () override | |
| bool | isDaemonReady () const |
| void | setDragHandler (IDragHandler *handler) |
| void | setGeometryHandler (IGeometryHandler *handler) |
| void | setLifecycleHandler (ILifecycleHandler *handler) |
| void | registerBridge (const QString &compositorId, int apiVersion, const QStringList &capabilities) |
| Register this client as THE compositor bridge. | |
| void | notifyWindowOpened (const QString &windowId, const QString &screenId, int minWidth=0, int minHeight=0) |
| void | notifyWindowOpenedBatch (const PhosphorProtocol::WindowOpenedList &windows) |
| void | notifyWindowClosed (const QString &windowId) |
| void | notifyWindowActivated (const QString &windowId, const QString &screenId) |
| void | notifyActiveWindowScreenChanged (const QString &windowId, const QString &screenId) |
The focused window moved to screenId without a new activation (WindowTracking.activeWindowScreenChanged). | |
| void | beginDrag (const QString &windowId, const QRect &frameGeometry, const QString &startScreenId, int mouseButtons=0) |
| Canonical drag surface, mirroring org.phosphor_works.Placement.WindowDrag. | |
| void | updateDragCursor (const QString &windowId, int cursorX, int cursorY, int modifiers=0, int mouseButtons=0) |
| void | endDrag (const QString &windowId, int cursorX, int cursorY, int modifiers=0, int mouseButtons=0, bool cancelled=false) |
| void | notifyCursorScreenChanged (const QString &screenId) |
| void | notifyPrimaryScreen (const QString &screenName) |
| void | queryFloatingWindows () |
| void | querySnappedWindows () |
| void | queryPendingRestoreGeometries () |
| void | queryVirtualScreens (const QString &screenId) |
| void | pruneStaleWindows (const QStringList &liveWindowIds) |
| void | probeDaemonAvailable (int timeoutMs=PhosphorProtocol::Service::DaemonReadyProbeTimeoutMs) |
|
explicit |
|
override |
| void PhosphorCompositor::DaemonClient::beginDrag | ( | const QString & | windowId, |
| const QRect & | frameGeometry, | ||
| const QString & | startScreenId, | ||
| int | mouseButtons = 0 ) |
Canonical drag surface, mirroring org.phosphor_works.Placement.WindowDrag.
The daemon decides and the plugin applies the verdict verbatim, so both ends of the drag are round trips: beginDrag delivers its DragPolicy through dragPolicyReceived and endDrag its DragOutcome through dragOutcomeReceived. Wire those signals before starting a drag. A payload that fails its own validationError() is dropped with a warning rather than emitted. updateDragCursor is the fire-and-forget hot path; the caller throttles it (~30Hz) and only sends it when the policy asked for streaming. On updateDragCursor and endDrag, modifiers / mouseButtons are the compositor's live keyboard/button state, 0 when unknown; beginDrag takes only mouseButtons.
|
signal |
|
signal |
|
signal |
|
signal |
|
signal |
Daemon's reply to endDrag.
Not emitted if the call failed or the outcome did not validate.
|
signal |
Daemon's reply to beginDrag.
Not emitted if the call failed or the policy did not validate.
| void PhosphorCompositor::DaemonClient::endDrag | ( | const QString & | windowId, |
| int | cursorX, | ||
| int | cursorY, | ||
| int | modifiers = 0, | ||
| int | mouseButtons = 0, | ||
| bool | cancelled = false ) |
|
signal |
|
inline |
| void PhosphorCompositor::DaemonClient::notifyActiveWindowScreenChanged | ( | const QString & | windowId, |
| const QString & | screenId ) |
The focused window moved to screenId without a new activation (WindowTracking.activeWindowScreenChanged).
| void PhosphorCompositor::DaemonClient::notifyCursorScreenChanged | ( | const QString & | screenId | ) |
| void PhosphorCompositor::DaemonClient::notifyPrimaryScreen | ( | const QString & | screenName | ) |
| void PhosphorCompositor::DaemonClient::notifyWindowActivated | ( | const QString & | windowId, |
| const QString & | screenId ) |
| void PhosphorCompositor::DaemonClient::notifyWindowClosed | ( | const QString & | windowId | ) |
| void PhosphorCompositor::DaemonClient::notifyWindowOpened | ( | const QString & | windowId, |
| const QString & | screenId, | ||
| int | minWidth = 0, | ||
| int | minHeight = 0 ) |
| void PhosphorCompositor::DaemonClient::notifyWindowOpenedBatch | ( | const PhosphorProtocol::WindowOpenedList & | windows | ) |
|
signal |
|
signal |
| void PhosphorCompositor::DaemonClient::probeDaemonAvailable | ( | int | timeoutMs = PhosphorProtocol::Service::DaemonReadyProbeTimeoutMs | ) |
| void PhosphorCompositor::DaemonClient::pruneStaleWindows | ( | const QStringList & | liveWindowIds | ) |
| void PhosphorCompositor::DaemonClient::queryFloatingWindows | ( | ) |
| void PhosphorCompositor::DaemonClient::queryPendingRestoreGeometries | ( | ) |
| void PhosphorCompositor::DaemonClient::querySnappedWindows | ( | ) |
| void PhosphorCompositor::DaemonClient::queryVirtualScreens | ( | const QString & | screenId | ) |
|
signal |
| void PhosphorCompositor::DaemonClient::registerBridge | ( | const QString & | compositorId, |
| int | apiVersion, | ||
| const QStringList & | capabilities ) |
Register this client as THE compositor bridge.
Answers through bridgeRegistered or bridgeRejected.
ORDERING: the daemon admits the compositor reports below (every notify*, beginDrag / updateDragCursor / endDrag and pruneStaleWindows) only from the bus name that registered the bridge, and answers any other caller with AccessDenied. Send none of them before bridgeRegistered. This client refuses them itself until then, with one warning per registration, because a fire-and-forget call would never see the daemon's refusal. The queries are not gated.
COMPOSITOR PROCESS ONLY: the daemon accepts a registration only from a bus connection owned by the compositor's own process, the one on the far end of the daemon's Wayland connection (or a direct child of it when that process is kwin_wayland_wrapper). A DaemonClient in any other process is answered with a REJECTED session, which arrives here as bridgeRejected, so a bridge has to run inside the compositor.
ONE BRIDGE AT A TIME: while a registered bridge's bus name is still on the bus, a registration from another name is answered with a REJECTED session, which arrives here as bridgeRejected. The same name registering again, and any name once the old one has left the bus, are accepted.
|
signal |
|
inline |
| handler | Not owned; caller retains lifetime. Must outlive this client. |
|
inline |
| handler | Not owned; caller retains lifetime. Must outlive this client. |
|
inline |
| handler | Not owned; caller retains lifetime. Must outlive this client. |
|
signal |
|
signal |
|
signal |
| void PhosphorCompositor::DaemonClient::updateDragCursor | ( | const QString & | windowId, |
| int | cursorX, | ||
| int | cursorY, | ||
| int | modifiers = 0, | ||
| int | mouseButtons = 0 ) |
|
signal |
|
signal |