Phosphor
Qt6 / Wayland library suite for window-management tools
Loading...
Searching...
No Matches
PhosphorCompositor::DaemonClient Class Reference

#include <PhosphorCompositor/DaemonClient.h>

Inheritance diagram for PhosphorCompositor::DaemonClient:
[legend]

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)

Constructor & Destructor Documentation

◆ DaemonClient()

PhosphorCompositor::DaemonClient::DaemonClient ( QObject * parent = nullptr)
explicit

◆ ~DaemonClient()

PhosphorCompositor::DaemonClient::~DaemonClient ( )
override

Member Function Documentation

◆ beginDrag()

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.

◆ bridgeRegistered

void PhosphorCompositor::DaemonClient::bridgeRegistered ( const QString & sessionId,
int peerApiVersion )
signal

◆ bridgeRejected

void PhosphorCompositor::DaemonClient::bridgeRejected ( const QString & reason)
signal

◆ daemonDisconnected

void PhosphorCompositor::DaemonClient::daemonDisconnected ( )
signal

◆ daemonReady

void PhosphorCompositor::DaemonClient::daemonReady ( )
signal

◆ dragOutcomeReceived

void PhosphorCompositor::DaemonClient::dragOutcomeReceived ( const QString & windowId,
const PhosphorProtocol::DragOutcome & outcome )
signal

Daemon's reply to endDrag.

Not emitted if the call failed or the outcome did not validate.

◆ dragPolicyReceived

void PhosphorCompositor::DaemonClient::dragPolicyReceived ( const QString & windowId,
const PhosphorProtocol::DragPolicy & policy )
signal

Daemon's reply to beginDrag.

Not emitted if the call failed or the policy did not validate.

◆ endDrag()

void PhosphorCompositor::DaemonClient::endDrag ( const QString & windowId,
int cursorX,
int cursorY,
int modifiers = 0,
int mouseButtons = 0,
bool cancelled = false )

◆ floatingWindowsReceived

void PhosphorCompositor::DaemonClient::floatingWindowsReceived ( const QStringList & windowIds)
signal

◆ isDaemonReady()

bool PhosphorCompositor::DaemonClient::isDaemonReady ( ) const
inline

◆ notifyActiveWindowScreenChanged()

void PhosphorCompositor::DaemonClient::notifyActiveWindowScreenChanged ( const QString & windowId,
const QString & screenId )

The focused window moved to screenId without a new activation (WindowTracking.activeWindowScreenChanged).

◆ notifyCursorScreenChanged()

void PhosphorCompositor::DaemonClient::notifyCursorScreenChanged ( const QString & screenId)

◆ notifyPrimaryScreen()

void PhosphorCompositor::DaemonClient::notifyPrimaryScreen ( const QString & screenName)

◆ notifyWindowActivated()

void PhosphorCompositor::DaemonClient::notifyWindowActivated ( const QString & windowId,
const QString & screenId )

◆ notifyWindowClosed()

void PhosphorCompositor::DaemonClient::notifyWindowClosed ( const QString & windowId)

◆ notifyWindowOpened()

void PhosphorCompositor::DaemonClient::notifyWindowOpened ( const QString & windowId,
const QString & screenId,
int minWidth = 0,
int minHeight = 0 )

◆ notifyWindowOpenedBatch()

void PhosphorCompositor::DaemonClient::notifyWindowOpenedBatch ( const PhosphorProtocol::WindowOpenedList & windows)

◆ pendingRestoreGeometriesReceived

void PhosphorCompositor::DaemonClient::pendingRestoreGeometriesReceived ( const QString & json)
signal

◆ pendingRestoresAvailable

void PhosphorCompositor::DaemonClient::pendingRestoresAvailable ( )
signal

◆ probeDaemonAvailable()

void PhosphorCompositor::DaemonClient::probeDaemonAvailable ( int timeoutMs = PhosphorProtocol::Service::DaemonReadyProbeTimeoutMs)

◆ pruneStaleWindows()

void PhosphorCompositor::DaemonClient::pruneStaleWindows ( const QStringList & liveWindowIds)

◆ queryFloatingWindows()

void PhosphorCompositor::DaemonClient::queryFloatingWindows ( )

◆ queryPendingRestoreGeometries()

void PhosphorCompositor::DaemonClient::queryPendingRestoreGeometries ( )

◆ querySnappedWindows()

void PhosphorCompositor::DaemonClient::querySnappedWindows ( )

◆ queryVirtualScreens()

void PhosphorCompositor::DaemonClient::queryVirtualScreens ( const QString & screenId)

◆ reapplyGeometriesRequested

void PhosphorCompositor::DaemonClient::reapplyGeometriesRequested ( )
signal

◆ registerBridge()

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.

◆ runningWindowsRequested

void PhosphorCompositor::DaemonClient::runningWindowsRequested ( )
signal

◆ setDragHandler()

void PhosphorCompositor::DaemonClient::setDragHandler ( IDragHandler * handler)
inline
Parameters
handlerNot owned; caller retains lifetime. Must outlive this client.

◆ setGeometryHandler()

void PhosphorCompositor::DaemonClient::setGeometryHandler ( IGeometryHandler * handler)
inline
Parameters
handlerNot owned; caller retains lifetime. Must outlive this client.

◆ setLifecycleHandler()

void PhosphorCompositor::DaemonClient::setLifecycleHandler ( ILifecycleHandler * handler)
inline
Parameters
handlerNot owned; caller retains lifetime. Must outlive this client.

◆ settingsChanged

void PhosphorCompositor::DaemonClient::settingsChanged ( )
signal

◆ snapAssistReady

void PhosphorCompositor::DaemonClient::snapAssistReady ( const QString & windowId,
const QString & screenId,
const PhosphorProtocol::EmptyZoneList & zones )
signal

◆ snappedWindowsReceived

void PhosphorCompositor::DaemonClient::snappedWindowsReceived ( const QStringList & windowIds)
signal

◆ updateDragCursor()

void PhosphorCompositor::DaemonClient::updateDragCursor ( const QString & windowId,
int cursorX,
int cursorY,
int modifiers = 0,
int mouseButtons = 0 )

◆ virtualScreensChanged

void PhosphorCompositor::DaemonClient::virtualScreensChanged ( const QString & screenId)
signal

◆ virtualScreensReceived

void PhosphorCompositor::DaemonClient::virtualScreensReceived ( const QString & screenId,
const PhosphorProtocol::WindowGeometryList & geometries )
signal

The documentation for this class was generated from the following file: