QML singleton: the placement engine's geometry per screen. More...
#include <PhosphorShell/PlacementMap.h>
Signals | |
| void | availableChanged () |
Public Member Functions | |
| PlacementMap (QObject *parent=nullptr) | |
| Whether the daemon is on the session bus right now. | |
| ~PlacementMap () override | |
| PhosphorShell::PlacementMapScreen * | forScreen (const QString &screenName) |
| The map for a QScreen name (PanelWindow.screen.name). | |
| PhosphorShell::PlacementMapScreen * | forScreenDesktop (const QString &screenName, int desktopIndex) |
| The map for a QScreen name pinned to the 0-based desktopIndex (a row of Workspaces.model). | |
| bool | isAvailable () const |
| Workspaces * | workspaces () const |
| QHash< QString, QStringList > | occupancyForScreen (const QString &screenId) const |
| windowId → zone ids for non-floating windows on screenId. | |
| QList< PlacementMapParser::Occupant > | occupantsForScreen (const QString &screenId) const |
| The non-floating windows on screenId, oldest state change first, so the last occupant of a zone is its topmost window. | |
| QString | focusedWindowId () const |
| The window the daemon last asked the compositor to focus or activate, or empty. | |
| const QHash< QString, PlacementMapParser::WindowMeta > & | windowMetadata () const |
| WindowTracking.getWindowMetadata answers so far, by window id. | |
| const QSet< QString > & | urgentWindows () const |
| Windows demanding attention (getUrgentWindows seeded, then windowUrgencyChanged). | |
| QString | currentActivity () const |
| The current activity id (LayoutRegistry.getCurrentActivity). | |
Static Public Member Functions | |
| static PlacementMap * | create (QQmlEngine *engine, QJSEngine *scriptEngine) |
| QML-singleton factory hook. | |
QML singleton: the placement engine's geometry per screen.
import Phosphor.Shell readonly property var map: PlacementMap.forScreen(screen.name)
One PlacementMapScreen per QScreen name, created on first request, parented here and handed to QML under C++ ownership so the engine never collects it. The singleton holds the process's daemon subscriptions (one per QML engine) and the shared occupancy table; the screens hold their own geometry.
Registered imperatively in ShellEngine::load(), like Workspaces.
|
explicit |
Whether the daemon is on the session bus right now.
|
override |
|
signal |
|
staticnodiscard |
QML-singleton factory hook.
|
nodiscard |
The current activity id (LayoutRegistry.getCurrentActivity).
|
nodiscard |
The window the daemon last asked the compositor to focus or activate, or empty.
The focus proxy a screen falls back on until Tiling.managedFocusedWindow has answered for it; see the .cpp.
| PhosphorShell::PlacementMapScreen * PhosphorShell::PlacementMap::forScreen | ( | const QString & | screenName | ) |
The map for a QScreen name (PanelWindow.screen.name).
Same object every call; owned by this singleton.
| PhosphorShell::PlacementMapScreen * PhosphorShell::PlacementMap::forScreenDesktop | ( | const QString & | screenName, |
| int | desktopIndex ) |
The map for a QScreen name pinned to the 0-based desktopIndex (a row of Workspaces.model).
The CURRENT desktop's map is the live one, so this answers forScreen(screenName) for it (and for a negative index); every other desktop gets its own screen object, cached per (screen, desktop) and owned here like the live ones.
That choice is made PER CALL, not maintained. A screen handed back for a non-current desktop stays pinned for its whole life, so switching to that desktop does not turn it into the live map — it keeps tracking through its own refetch rather than the engine's focus and tile edges. A consumer that wants the live map to follow the active desktop must call again when Workspaces.activeIndex changes; binding through that property is enough to re-run this.
|
nodiscard |
|
nodiscard |
windowId → zone ids for non-floating windows on screenId.
|
nodiscard |
The non-floating windows on screenId, oldest state change first, so the last occupant of a zone is its topmost window.
|
nodiscard |
Windows demanding attention (getUrgentWindows seeded, then windowUrgencyChanged).
|
nodiscard |
WindowTracking.getWindowMetadata answers so far, by window id.
|
nodiscard |