Phosphor
Qt6 / Wayland library suite for window-management tools
 
Loading...
Searching...
No Matches
PhosphorZones::AssignmentEntry Struct Reference

Explicit per-context assignment entry storing both mode fields. More...

#include <phosphor-zones/include/PhosphorZones/AssignmentEntry.h>

Public Types

enum  Mode { Snapping = 0 , Autotile = 1 , Scrolling = 2 }
 Per-context engine selection. More...
 

Public Member Functions

QString activeLayoutId () const
 
bool isValid () const
 
bool operator== (const AssignmentEntry &other) const
 

Static Public Member Functions

static AssignmentEntry fromLayoutId (const QString &layoutId, const AssignmentEntry &existing)
 Update an existing AssignmentEntry from a layoutId, preserving the "other" field.
 
static AssignmentEntry fromLayoutId (const QString &layoutId)
 Create a fresh AssignmentEntry from a layoutId string.
 

Public Attributes

Mode mode = Snapping
 
QString snappingLayout
 
QString tilingAlgorithm
 

Detailed Description

Explicit per-context assignment entry storing both mode fields.

Each screen/desktop/activity context stores an explicit Mode, SnappingLayout (UUID), and PhosphorTiles::TilingAlgorithm. Toggling between modes only flips the mode field — the other field is preserved, eliminating the need for shadow assignments.

Member Enumeration Documentation

◆ Mode

Per-context engine selection.

The v4 rule store persists the WIRE STRINGS produced by modeToWireString ("snapping", "autotile", "scrolling") — ContextRuleBridge::makeDisableRule writes them and disableRuleMode reads them back. The legacy v3→v4 config migration (configmigration.cpp) does still read the int side via Display.<screen>:Mode, so NEVER renumber existing values — a renumber would silently swap engines for v3 disable lists that haven't been migrated yet. Append new modes at the end.

Enumerator
Snapping 
Autotile 
Scrolling 

Reserved engine slot for a future scrolling-workspace engine.

The settings UI exposes the mode and persists per-mode disable lists / config groups, but the router currently has no engine to hand windows to — see ScreenModeRouter::engineFor for the passthrough fallback (returns nullptr for Scrolling) that lets KWin place the window naturally rather than blocking on a missing engine. A real engine implementer adds an adapter to the router and removes the passthrough; no daemon-internal switch needs to be edited because the (Mode, Family) settings table here drives all downstream config routing.

Member Function Documentation

◆ activeLayoutId()

QString PhosphorZones::AssignmentEntry::activeLayoutId ( ) const
inline

◆ fromLayoutId() [1/2]

static AssignmentEntry PhosphorZones::AssignmentEntry::fromLayoutId ( const QString &  layoutId)
inlinestatic

Create a fresh AssignmentEntry from a layoutId string.

◆ fromLayoutId() [2/2]

static AssignmentEntry PhosphorZones::AssignmentEntry::fromLayoutId ( const QString &  layoutId,
const AssignmentEntry existing 
)
inlinestatic

Update an existing AssignmentEntry from a layoutId, preserving the "other" field.

Mode IS set from the layoutId type — batch operations from the KCM send a single layout ID per context, and that ID determines the active mode. The non-matching field is preserved for easy mode toggling.

◆ isValid()

bool PhosphorZones::AssignmentEntry::isValid ( ) const
inline

◆ operator==()

bool PhosphorZones::AssignmentEntry::operator== ( const AssignmentEntry other) const
inline

Member Data Documentation

◆ mode

Mode PhosphorZones::AssignmentEntry::mode = Snapping

◆ snappingLayout

QString PhosphorZones::AssignmentEntry::snappingLayout

◆ tilingAlgorithm

QString PhosphorZones::AssignmentEntry::tilingAlgorithm

The documentation for this struct was generated from the following file: