Phosphor
Qt6 / Wayland library suite for window-management tools
Loading...
Searching...
No Matches
PhosphorRules::ExclusionRules Namespace Reference

Functions

PHOSPHORRULES_EXPORT RuleSet excludeRulesFrom (const RuleSet &source)
 Slice source down to rules with a terminal Exclude action — the BLANKET-only shape.
PHOSPHORRULES_EXPORT RuleSet excludePlacementRulesFrom (const RuleSet &source)
 Slice source down to rules carrying a terminal Exclude OR ExcludePlacement action — the full set of rules that make a window unmanaged by the placement engines (snapping, autotile, scrolling).
PHOSPHORRULES_EXPORT RuleSet excludeDecorationsRulesFrom (const RuleSet &source)
 Slice source down to rules carrying a terminal Exclude OR ExcludeDecorations action — the set the KWin effect's shouldDecorateWindow gate binds.
PHOSPHORRULES_EXPORT RuleSet excludeAnimationsRulesFrom (const RuleSet &source)
 Slice source down to rules with a terminal ExcludeAnimations action — the action the v4 fold introduced for the legacy animationExcludedApplications / animationExcludedWindowClasses lists.
PHOSPHORRULES_EXPORT QStringList applicationExcludePatternsFrom (const RuleSet &source)
 Return the AppId pattern of every AppId AppIdMatches <pattern> leaf that lives on an enabled Exclude- or ExcludePlacement-action rule in source (both shapes make the window unmanaged by placement, and the placement prune this feeds is a placement concern).

Function Documentation

◆ applicationExcludePatternsFrom()

PHOSPHORRULES_EXPORT QStringList PhosphorRules::ExclusionRules::applicationExcludePatternsFrom ( const RuleSet & source)

Return the AppId pattern of every AppId AppIdMatches <pattern> leaf that lives on an enabled Exclude- or ExcludePlacement-action rule in source (both shapes make the window unmanaged by placement, and the placement prune this feeds is a placement concern).

Mirrors the deleted runtime bridge's flat-string output so a consumer that needs a flat list of patterns (the WTA placement prune) can derive one from the unified store.

Only the simple shape "single AppId AppIdMatches leaf" is recognised — the v4 migration produces exactly that shape, and a hand-authored Exclude rule with a different match (WindowClass Contains "steam", a composite, an AppId Equals leaf) cannot map to a single canonical AppId pattern and is silently skipped. The snap-engine and drag gate still fire on the rule (they bind the full Exclude slice to a RuleEvaluator, not the harvested string list), but the placement prune cannot see it. Practical consequence: a user authoring a WindowClass Contains "steam" Exclude rule keeps Steam windows out of layouts (good), but stale placement records for Steam on disk are NOT pruned (they stay until a real snap-engine matching cycle re-checks them and discards them as excluded). A future widening of this harvest, or a switch to evaluating the RuleSet directly against each stored WindowQuery, would close that gap.

Empty / whitespace-only / disabled rules are dropped, and duplicate patterns are collapsed (first occurrence wins) — a blanket Exclude and a scoped ExcludePlacement rule for the same app harvest one entry.

◆ excludeAnimationsRulesFrom()

PHOSPHORRULES_EXPORT RuleSet PhosphorRules::ExclusionRules::excludeAnimationsRulesFrom ( const RuleSet & source)

Slice source down to rules with a terminal ExcludeAnimations action — the action the v4 fold introduced for the legacy animationExcludedApplications / animationExcludedWindowClasses lists.

Used by the KWin effect's shouldAnimateWindow gate to suppress animation overrides on matched windows. Same disabled-skip

◆ excludeDecorationsRulesFrom()

PHOSPHORRULES_EXPORT RuleSet PhosphorRules::ExclusionRules::excludeDecorationsRulesFrom ( const RuleSet & source)

Slice source down to rules carrying a terminal Exclude OR ExcludeDecorations action — the set the KWin effect's shouldDecorateWindow gate binds.

Blanket Exclude keeps stripping decorations (preserving the behavior from when the decoration path reused the snapping slice); the scoped ExcludeDecorations strips only decorations. Same disabled-skip + verbatim-preservation contract as excludeRulesFrom.

◆ excludePlacementRulesFrom()

PHOSPHORRULES_EXPORT RuleSet PhosphorRules::ExclusionRules::excludePlacementRulesFrom ( const RuleSet & source)

Slice source down to rules carrying a terminal Exclude OR ExcludePlacement action — the full set of rules that make a window unmanaged by the placement engines (snapping, autotile, scrolling).

This is the slice the daemon's engines and the KWin effect's drag gate bind: blanket Exclude keeps its historical placement effect, and the scoped ExcludePlacement joins it without also stripping decorations. Same disabled-skip + verbatim-preservation contract as excludeRulesFrom, which remains the Exclude-only slice for consumers that need the blanket shape alone.

◆ excludeRulesFrom()

PHOSPHORRULES_EXPORT RuleSet PhosphorRules::ExclusionRules::excludeRulesFrom ( const RuleSet & source)

Slice source down to rules with a terminal Exclude action — the BLANKET-only shape.

RETAINED PUBLIC API with no in-tree production consumer: the snap engine and the effect's drag gate migrated to the placement union slice below, so today only tests call this. It stays exported for the same reason the unread Tag:: constants do (see RuleAction.h's retained-API note) — this is installed LGPL API and a third-party consumer may legitimately want exactly the blanket slice. Disabled rules are skipped at slicing time so the derived set is the minimum admitted by the user — carrying disabled rules through the slice would inflate the downstream RuleEvaluator's priority-order index and would lie to !isEmpty() fast-path callers. Rule ids, priorities, and matches are preserved verbatim.