Compositor-agnostic floating window state cache. More...
#include <phosphor-compositor/include/PhosphorCompositor/FloatingCache.h>
Public Member Functions | |
| bool | isFloating (const QString &windowId) const |
| bool | setFloating (const QString &windowId, bool floating) |
Set windowId's floating state. | |
| void | clear () |
| int | size () const |
| Total entries across BOTH keyspaces (instance floats + app-wide floats). | |
| bool | insert (const QString &windowId) |
| Convenience alias for setFloating(windowId, true). | |
| bool | remove (const QString &windowId) |
| Convenience alias for setFloating(windowId, false). | |
Compositor-agnostic floating window state cache.
Tracks which windows are floating, dual-keyed so both float kinds resolve:
ZoneCache. A window's appId can mutate mid-session (Electron / CEF apps rename their window class), changing the composite appId|instanceId but never the instanceId — keying by it keeps a floated window resolvable across that rename.isFloating. Unlike the instanceId keyspace, this one is NOT class-mutation-safe: a bare-appId entry inserted as slack is not resolved by a later Slack. This matches the authoritative daemon's own appId-keyed markers (same exposure); the rename-robustness guarantee covers only the instance keyspace above.Mirrors the authoritative WindowTrackingService::setFloating: unfloating a specific instance ALSO drops the coarse app-wide (bare appId) entry. Still- floating siblings keep their own instance entries, so this never clears them; it only removes the session-restore appId marker (matching the daemon, which removes the appId entry unconditionally on instance unfloat — no sibling scan, which would not survive a mid-session class rename anyway).
|
inline |
|
inline |
Convenience alias for setFloating(windowId, true).
Kept symmetric with remove() so both entry points share the same guard logic. Returns true iff a tracked entry was actually added.
|
inline |
|
inline |
Convenience alias for setFloating(windowId, false).
Returns true iff a tracked entry was actually removed.
|
inline |
Set windowId's floating state.
Returns true iff a tracked entry was actually added or removed, so a caller can drive a side effect (e.g. re-resolving IsFloating rules) only when the tracked set changed.
|
inline |
Total entries across BOTH keyspaces (instance floats + app-wide floats).
Not a window count: an app floated both app-wide and per-instance counts in each. Diagnostics that want "how many windows did the daemon report floating" should log the source list size, not this.