KWin's virtual desktops, over org.kde.KWin.VirtualDesktopManager on the session bus. More...
#include <PhosphorWorkspaces/Plasma/KWinVirtualDesktopBackend.h>
Public Member Functions | |
| KWinVirtualDesktopBackend (QObject *parent=nullptr) | |
| ~KWinVirtualDesktopBackend () override | |
| bool | connectToSource () override |
| Probe KWin's interface. False on a session without KWin. | |
| bool | isReachable () const override |
| KWin's service is on the bus (QDBusInterface follows its owner). | |
| void | subscribe () override |
| Start and stop emitting the change signals. | |
| void | unsubscribe () override |
| std::optional< Snapshot > | readSnapshot () override |
| Read the whole list now, blocking the caller. | |
| void | readSnapshotAsync (SnapshotCallback done) override |
| Read the whole list without blocking. | |
| void | setCurrentDesktop (const QString &desktopId) override |
| Switch to the desktop with this id, without waiting for the switch: it arrives as currentChanged. | |
| void | createDesktop (uint position, const QString &name, AnswerCallback done) override |
| Create a desktop at a 0-based position. | |
| void | removeDesktop (const QString &desktopId, AnswerCallback done) override |
Remove a desktop. done as for createDesktop. | |
| void | setDesktopName (const QString &desktopId, const QString &name) override |
| Rename a desktop. The new name arrives as desktopDataChanged. | |
| Public Member Functions inherited from PhosphorWorkspaces::IVirtualDesktopBackend | |
| IVirtualDesktopBackend (QObject *parent=nullptr) | |
| ~IVirtualDesktopBackend () override=default | |
Additional Inherited Members | |
| Public Types inherited from PhosphorWorkspaces::IVirtualDesktopBackend | |
| using | SnapshotCallback = std::function<void(std::optional<Snapshot> snapshot)> |
| using | AnswerCallback = std::function<void(bool answered)> |
answered is false for an error or a timeout: a stall, not a refusal. | |
| Signals inherited from PhosphorWorkspaces::IVirtualDesktopBackend | |
| void | currentChanged (const QString &desktopId) |
| void | countChanged (int count) |
| The desktop count, which closes a create, a remove or a resize: every desktop signal of the change went out before it. | |
| void | desktopCreated (const QString &desktopId, int position, const QString &name) |
| void | desktopCreatedUnreadable (const QString &desktopId) |
| A desktop was created but its data could not be read. | |
| void | desktopDataChanged (const QString &desktopId, int position, const QString &name) |
A desktop was renamed or moved; position is its new one. | |
| void | desktopDataChangedUnreadable () |
| A desktop's data changed but could not be read. | |
| void | desktopRemoved (const QString &desktopId) |
| void | rowsChanged (int rows) |
| The grid's row count changed (a reshape moves no desktop). | |
KWin's virtual desktops, over org.kde.KWin.VirtualDesktopManager on the session bus.
Every call to KWin is bounded at a second. The list reads go through the connection KWin sends its desktop signals on, so a read's reply comes after every signal KWin sent before handling it.
|
explicit |
|
override |
|
overridevirtual |
Probe KWin's interface. False on a session without KWin.
Implements PhosphorWorkspaces::IVirtualDesktopBackend.
|
overridevirtual |
Create a desktop at a 0-based position.
done runs once the compositor answered, after any desktopCreated the call caused, and never after this backend is destroyed.
Implements PhosphorWorkspaces::IVirtualDesktopBackend.
|
overridevirtual |
KWin's service is on the bus (QDBusInterface follows its owner).
Implements PhosphorWorkspaces::IVirtualDesktopBackend.
|
overridevirtual |
Read the whole list now, blocking the caller.
nullopt when the read failed. Used only while the manager is not running (before start(), after stop()).
Implements PhosphorWorkspaces::IVirtualDesktopBackend.
|
overridevirtual |
Read the whole list without blocking.
done runs once, with nullopt when the read failed, and never after this backend is destroyed.
Implements PhosphorWorkspaces::IVirtualDesktopBackend.
|
overridevirtual |
Remove a desktop. done as for createDesktop.
Implements PhosphorWorkspaces::IVirtualDesktopBackend.
|
overridevirtual |
Switch to the desktop with this id, without waiting for the switch: it arrives as currentChanged.
Implements PhosphorWorkspaces::IVirtualDesktopBackend.
|
overridevirtual |
Rename a desktop. The new name arrives as desktopDataChanged.
Implements PhosphorWorkspaces::IVirtualDesktopBackend.
|
overridevirtual |
Start and stop emitting the change signals.
Each is called only when the other was last, so neither needs to guard against doubling.
Implements PhosphorWorkspaces::IVirtualDesktopBackend.
|
overridevirtual |
Implements PhosphorWorkspaces::IVirtualDesktopBackend.