|
| | DecorationManager (ICompositorBridge &bridge, QObject *parent=nullptr) |
| | bridge must outlive the manager (the KWin effect owns both, with the bridge destroyed after the manager).
|
| |
| | ~DecorationManager () override |
| | Breaks any in-flight drain chains' self-reference cycles — a chain interrupted by manager destruction would otherwise leak its heap closure (the queued QTimer continuations die with the QObject, so the chain's own cycle-break never runs).
|
| |
| void | acquire (const QString &windowId, const Owner &owner, Placement placement=Placement::AlreadyPlaced) |
| |
| void | release (const QString &windowId, const Owner &owner, Restore restore=Restore::Immediate) |
| |
| void | releaseKind (const QString &windowId, OwnerKind kind, Restore restore=Restore::Immediate) |
| | Release every owner of kind regardless of screen (float, fullscreen, window leaving the mode entirely).
|
| |
| void | releaseOthersOfKind (const QString &windowId, OwnerKind kind, const QString &keepScreenId) |
| | Cross-screen transfer: drop kind owners on every screen EXCEPT keepScreenId.
|
| |
| void | releaseAllOfKind (OwnerKind kind, Restore restore=Restore::Immediate) |
| | Per-mode hide-title-bars toggle OFF / whole-mode teardown.
|
| |
| void | restoreAll () |
| | Daemon loss / effect teardown: synchronously restore every window we hid to its prior state, then drop all tracking, timers, and any in-flight drain chains.
|
| |
| void | forgetWindow (const QString &windowId) |
| | Window destroyed: drop all state for it.
|
| |
| void | setRuleOverride (const QString &windowId, std::optional< bool > ruleValue) |
| | nullopt: rule has no opinion — clear Rule owner and veto.
|
| |
| void | clearAllRuleOverrides () |
| | Rules went away wholesale (rule set emptied / teardown): clear every Rule owner and veto, restoring where no mode owner remains.
|
| |
| void | drainPendingRestores () |
| | Drain queued restores, one decoration toggle per event-loop tick.
|
| |
| void | setFallbackIntervalForTesting (int ms) |
| | Test seam: shrink the fallback-retry interval (default 500 ms) so timer-interplay tests run in milliseconds.
|
| |
| void | setRestoreVeto (std::function< bool(const QString &windowId)> veto) |
| | Extra authoritative re-check evaluated per window at drain-step time (in addition to the built-in "window has owners again" check).
|
| |
| void | resyncWindow (const QString &windowId) |
| | The compositor can silently reset noBorder (KWin does on desktop switches).
|
| |
| bool | isBorderless (const QString &windowId) const |
| | True when we physically suppressed the window's decoration.
|
| |
| bool | isOwned (const QString &windowId) const |
| |
| bool | isOwnedBy (const QString &windowId, const Owner &owner) const |
| |
| bool | isVetoed (const QString &windowId) const |
| |
The single owner of server-side decoration (title-bar) state.
Every component that wants a window's title bar hidden — autotile retiles, snap commits, window rules — registers as an OWNER here instead of calling setNoBorder() itself. The decoration is hidden while at least one owner holds the window (and no veto pins it visible) and restored to its prior state when the last owner releases. This replaces the per-mode borderless sets and the web of cross-mode "is the other mode still using it?" guards that historically caused title-bar oscillation.
Invariants this class centralizes (previously duplicated and divergent):
- Capability gate: userCanSetNoBorder() — true for an SSD window even while it is CURRENTLY borderless (survives the autotile→snap handoff); false for CSD apps (GTK/Electron) and other non-toggleable windows, which are tracked as owned but never physically touched.
- Prior-state capture: a window that was already borderless when first acquired (user's own compositor rule) is restored to borderless, never force-decorated.
- Geometry preservation: the compositor holds the CLIENT size constant across a decoration change, so toggling the decoration on a placed window changes the frame height by the title-bar height. Hiding a placed window therefore captures moveResizeGeometry() — NOT frameGeometry(), which lags on Wayland until the client acks the configure — toggles, and re-asserts the target.
- Deferred restore: decoration restores are synchronous Wayland round-trips (30–120 ms each); bulk restores (mode toggles) are queued and drained one per event-loop tick so concurrent animations stay smooth, with a fallback timer in case the drain trigger never fires. A window re-acquired while queued keeps its decoration hidden.
| void PhosphorCompositor::DecorationManager::restoreAll |
( |
| ) |
|
Daemon loss / effect teardown: synchronously restore every window we hid to its prior state, then drop all tracking, timers, and any in-flight drain chains.
The installed restore veto deliberately survives: it is wired once at effect construction and stays valid for the next daemon session (the post-restoreAll queue is empty, so it is not consulted until new deferred releases arrive).
| void PhosphorCompositor::DecorationManager::setRestoreVeto |
( |
std::function< bool(const QString &windowId)> |
veto | ) |
|
Extra authoritative re-check evaluated per window at drain-step time (in addition to the built-in "window has owners again" check).
Returning true keeps the restore QUEUED (re-armed via the fallback timer) so a re-acquire that never lands still restores eventually — it must therefore only return true while a re-acquire is genuinely expected. The KWin effect installs "window's screen is autotiled,
hide-title-bars is on, and the window is not floating". The predicate MUST NOT call back into the manager (it runs between an entry lookup and writes through that entry; a re-entrant mutation could rehash the table under the held iterator).