6#include "phosphorengine_export.h"
76 return m_currentDesktop;
80 return m_currentActivity;
84 return m_desktopContextEverSet;
88 return m_activityContextEverSet;
105 if (
const auto perOut = m_screenCurrentDesktop.constFind(screenId);
106 perOut != m_screenCurrentDesktop.constEnd()) {
107 return perOut.value();
117 if (
const auto parent =
119 parent != m_screenCurrentDesktop.constEnd()) {
120 return parent.value();
123 return m_currentDesktop;
142 m_screenCurrentDesktop.remove(screenId);
149 return m_screenDesktopOverride.contains(screenId);
163 m_screenDesktopOverride.insert(screenId, desktop);
171 return m_screenDesktopOverride.value(screenId, 0);
177 return m_screenDesktopOverride.take(screenId);
194 m_screenDesktopOverride.remove(screenId);
195 m_screenCurrentDesktop.remove(screenId);
234 m_screenDesktopOverride.remove(screenId);
271 int m_currentDesktop = 1;
272 QString m_currentActivity;
273 bool m_desktopContextEverSet =
false;
274 bool m_activityContextEverSet =
false;
281 QHash<QString, int> m_screenDesktopOverride;
288 QHash<QString, int> m_screenCurrentDesktop;
How KWin's desktop positions moved in one change of its desktop list: for each 1-based position in th...
Definition DesktopRemap.h:29
int stickyPinnedDesktop(const QString &screenId) const
The sticky-pin desktop for a screen, or 0 when it is not pinned.
Definition ScreenContextTracker.h:169
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:86
ContextChange setCurrentActivity(const QString &activity)
int highestDesktop() const
The highest desktop number any of the stored values names (the global desktop included),...
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:140
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:232
bool desktopContextEverSet() const noexcept
Definition ScreenContextTracker.h:82
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:158
const QString & currentActivity() const noexcept
Definition ScreenContextTracker.h:78
void removeScreen(const QString &screenId)
Drop both per-screen maps' entries for a screen leaving the engine's set.
Definition ScreenContextTracker.h:192
ScreenContextTracker()=default
bool hasStickyPin(const QString &screenId) const
Definition ScreenContextTracker.h:147
int takeStickyPin(const QString &screenId)
Remove and return the sticky-pin desktop for a screen (default-constructed int == 0 when absent,...
Definition ScreenContextTracker.h:175
void renumberDesktopsAfterRemoval(int removedDesktop)
Shift every stored desktop number ABOVE removedDesktop down by one, the global desktop included,...
void remapDesktops(const DesktopRemap &remap)
Move every stored desktop number through remap, for any change of KWin's desktop list (F763,...
int currentDesktop() const noexcept
Definition ScreenContextTracker.h:74
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:103
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 DesktopRemap.h:12
QString extractPhysicalId(const QString &screenId)
Extract the physical screen ID from a virtual screen ID.
Definition VirtualScreenId.h:39
bool isVirtual(const QString &screenId)
Check if a screen ID is a virtual screen ID (contains "/vs:").
Definition VirtualScreenId.h:31
Outcome of a context mutation on ScreenContextTracker.
Definition ScreenContextTracker.h:27
bool changed
The tracked current value actually changed (a real switch, not a same-value re-push that only establi...
Definition ScreenContextTracker.h:30
bool armSwitch
Value the engine should OR into its own context-switch flag: true only when a context had already bee...
Definition ScreenContextTracker.h:33
Identity of a per-screen placement state: a window's placement is scoped to the (screen,...
Definition EngineTypes.h:25