51namespace AutotileStateHelpers {
62 auto it = savedGeometries.constFind(windowId);
63 if (it != savedGeometries.constEnd()) {
85 if (it.value().contains(windowId)) {
95 if (it.value().contains(windowId)) {
125 QVector<QRect> result;
128 result.append(it.value());
138 return geo.adjusted(borderWidth, borderWidth, -borderWidth, -borderWidth);
147 && geo.height() > border.
width * 2;
189 it.value().remove(windowId);
190 if (it.value().isEmpty()) {
197 it.value().remove(windowId);
198 if (it.value().isEmpty()) {
206 if (!screenId.isEmpty()) {
209 it->remove(windowId);
238 const bool removed = it.value().remove(windowId);
239 if (it.value().isEmpty()) {
253 const bool removed = it.value().remove(windowId);
254 if (it.value().isEmpty()) {
266 if (it.value().remove(windowId)) {
269 if (it.value().isEmpty()) {
276 if (it.value().remove(windowId)) {
279 if (it.value().isEmpty()) {
305 QVector<QPair<QString, QString>> result;
308 for (
const QString& wid : it.value()) {
309 result.append({wid, it.key()});
318 QVector<QPair<QString, QString>> result;
320 for (
const QString& wid : it.value()) {
321 result.append({wid, it.key()});
QSet< QString > tiledOnScreen(const BorderState &border, const QString &screenId)
Read-only view of the set of tiled windows on a given screen. Empty if none.
Definition AutotileState.h:289
QRect applyBorderInset(const QRect &geo, int borderWidth)
Apply border inset to a geometry (shrink by border width on all sides)
Definition AutotileState.h:136
bool shouldApplyBorderInset(const BorderState &border, const QString &windowId)
Definition AutotileState.h:109
QVector< QRect > allBorderZoneGeometries(const BorderState &border)
Definition AutotileState.h:123
bool shouldInsetForBorder(const BorderState &border, const QString &windowId, const QRect &geo)
Check if border inset should be applied for a window's geometry.
Definition AutotileState.h:144
void cleanupClosedWindowState(const QString &windowId, const QString &screenId, BorderState &border, AutotileWindowState &state)
Clean up all state tracking for a closed window.
Definition AutotileState.h:177
std::optional< QRect > borderZoneGeometry(const BorderState &border, const QString &windowId)
Definition AutotileState.h:114
bool hasSavedGeometryForWindow(const QHash< QString, QRectF > &savedGeometries, const QString &windowId)
Check if we already have saved geometry for this window.
Definition AutotileState.h:72
bool isBorderlessWindow(const BorderState &border, const QString &windowId)
Definition AutotileState.h:81
bool removeFromAllScreens(BorderState &border, const QString &windowId)
Remove a window from all screen buckets (both borderless and tiled).
Definition AutotileState.h:262
QVector< QPair< QString, QString > > allBorderlessPairs(const BorderState &border)
Collect every borderless (windowId, screenId) pair for bulk operations (feature disable,...
Definition AutotileState.h:303
bool shouldShowBorderForWindow(const BorderState &border, const QString &windowId)
Definition AutotileState.h:102
void addTiledOnScreen(BorderState &border, const QString &screenId, const QString &windowId)
Add a window to a screen's tiled bucket. Idempotent.
Definition AutotileState.h:225
void addBorderlessOnScreen(BorderState &border, const QString &screenId, const QString &windowId)
Add a window to a screen's borderless bucket. Idempotent.
Definition AutotileState.h:219
QString findSavedGeometryKey(const QHash< QString, QRectF > &savedGeometries, const QString &windowId)
Find key in saved geometries map for a window (exact match only)
Definition AutotileState.h:60
bool isTiledWindow(const BorderState &border, const QString &windowId)
Definition AutotileState.h:92
bool removeBorderlessOnScreen(BorderState &border, const QString &screenId, const QString &windowId)
Remove a window from a specific screen's borderless bucket.
Definition AutotileState.h:232
QSet< QString > borderlessOnScreen(const BorderState &border, const QString &screenId)
Read-only view of the set of borderless windows on a given screen. Empty if none.
Definition AutotileState.h:295
QVector< QPair< QString, QString > > allTiledPairs(const BorderState &border)
Same for tiled. Used by updateHideTitleBarsSetting's toggle-on path.
Definition AutotileState.h:316
bool removeTiledOnScreen(BorderState &border, const QString &screenId, const QString &windowId)
Remove a window from a specific screen's tiled bucket.
Definition AutotileState.h:247
Definition AutotileState.h:16
Bundles per-window state maps for cleanup operations.
Definition AutotileState.h:161
QSet< QString > & minimizeFloatedWindows
Definition AutotileState.h:164
QHash< QString, QString > & notifiedWindowScreens
Definition AutotileState.h:163
QHash< QString, QHash< QString, QRectF > > & preAutotileGeometries
Definition AutotileState.h:168
QSet< QString > & notifiedWindows
Definition AutotileState.h:162
QHash< QString, QRect > & centeredWaylandZones
Definition AutotileState.h:166
QHash< QString, QRect > & autotileTargetZones
Definition AutotileState.h:165
QSet< QString > & monocleMaximizedWindows
Definition AutotileState.h:167
Compositor-agnostic autotile border state.
Definition AutotileState.h:27
QHash< QString, QRect > zoneGeometries
PhosphorZones::Zone geometries remain windowId-keyed — a window only lives in one zone at a time,...
Definition AutotileState.h:36
QHash< QString, QSet< QString > > borderlessWindowsByScreen
windowId → screen bucket owning its borderless state.
Definition AutotileState.h:31
bool hideTitleBars
Definition AutotileState.h:37
bool showBorder
Definition AutotileState.h:38
QColor inactiveColor
Definition AutotileState.h:42
int width
Definition AutotileState.h:39
QColor color
Definition AutotileState.h:41
QHash< QString, QSet< QString > > tiledWindowsByScreen
Same shape for the full tiled set (superset of borderless).
Definition AutotileState.h:33
int radius
Definition AutotileState.h:40