6#include <phosphorengine_export.h>
73 return m_currentDesktop;
77 return m_currentActivity;
81 return m_desktopContextEverSet;
85 return m_activityContextEverSet;
102 return m_screenCurrentDesktop.value(screenId, m_currentDesktop);
121 m_screenCurrentDesktop.remove(screenId);
128 return m_screenDesktopOverride.contains(screenId);
142 m_screenDesktopOverride.insert(screenId, desktop);
150 return m_screenDesktopOverride.value(screenId, 0);
156 return m_screenDesktopOverride.take(screenId);
173 m_screenDesktopOverride.remove(screenId);
174 m_screenCurrentDesktop.remove(screenId);
213 m_screenDesktopOverride.remove(screenId);
228 int m_currentDesktop = 1;
229 QString m_currentActivity;
230 bool m_desktopContextEverSet =
false;
231 bool m_activityContextEverSet =
false;
238 QHash<QString, int> m_screenDesktopOverride;
245 QHash<QString, int> m_screenCurrentDesktop;
Tracks the "current context" of each screen for a placement engine: the global current virtual deskto...
Definition ScreenContextTracker.h:46
int stickyPinnedDesktop(const QString &screenId) const
The sticky-pin desktop for a screen, or 0 when it is not pinned.
Definition ScreenContextTracker.h:148
void pruneDesktop(int removedDesktop)
Drop entries from both per-screen maps whose DESKTOP value equals removedDesktop (a virtual desktop w...
bool activityContextEverSet() const noexcept
Definition ScreenContextTracker.h:83
ContextChange setCurrentActivity(const QString &activity)
void removeScreensIf(const std::function< bool(const QString &)> &pred)
Drop entries from both per-screen maps whose SCREEN key matches pred (e.g.
void clearCurrentDesktopForScreen(const QString &screenId)
Drop a screen's per-output desktop entry, falling it back to the global.
Definition ScreenContextTracker.h:119
void releaseScreenOwnership(const QString &screenId)
Drop only the ENGINE-OWNED half for a screen leaving this engine's mode set, keeping the per-output d...
Definition ScreenContextTracker.h:211
bool desktopContextEverSet() const noexcept
Definition ScreenContextTracker.h:79
void setStickyPin(const QString &screenId, int desktop)
Pin a screen to a desktop, outranking both the per-output and the global value in currentKeyForScreen...
Definition ScreenContextTracker.h:137
const QString & currentActivity() const noexcept
Definition ScreenContextTracker.h:75
void removeScreen(const QString &screenId)
Drop both per-screen maps' entries for a screen leaving the engine's set.
Definition ScreenContextTracker.h:171
ScreenContextTracker()=default
bool hasStickyPin(const QString &screenId) const
Definition ScreenContextTracker.h:126
int takeStickyPin(const QString &screenId)
Remove and return the sticky-pin desktop for a screen (default-constructed int == 0 when absent,...
Definition ScreenContextTracker.h:154
int currentDesktop() const noexcept
Definition ScreenContextTracker.h:71
int screenDesktop(const QString &screenId) const
The screen's PER-OUTPUT desktop: its own entry if set, else the global current desktop.
Definition ScreenContextTracker.h:100
ContextChange setCurrentDesktopForScreen(const QString &screenId, int desktop)
ContextChange setCurrentDesktop(int desktop)
PlacementStateKey currentKeyForScreen(const QString &screenId) const
Construct the owning key for a screen in the current context.
Definition EngineTypes.h:14
Outcome of a context mutation on ScreenContextTracker.
Definition ScreenContextTracker.h:24
bool changed
The tracked current value actually changed (a real switch, not a same-value re-push that only establi...
Definition ScreenContextTracker.h:27
bool armSwitch
Value the engine should OR into its own context-switch flag: true only when a context had already bee...
Definition ScreenContextTracker.h:30
Identity of a per-screen placement state: a window's placement is scoped to the (screen,...
Definition EngineTypes.h:22