Phosphor
Qt6 / Wayland library suite for window-management tools
 
Loading...
Searching...
No Matches
OverflowManager.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: 2026 fuddlesworth
2// SPDX-License-Identifier: LGPL-2.1-or-later
3
4#pragma once
5
6// Project headers
7#include <phosphortileengine_export.h>
8
9// Qt headers
10#include <QHash>
11#include <QSet>
12#include <QString>
13#include <QStringList>
14
15// C++ headers
16#include <functional>
17
18namespace PhosphorTileEngine {
19
35class PHOSPHORTILEENGINE_EXPORT OverflowManager
36{
37public:
45 void markOverflow(const QString& windowId, const QString& screenId);
46
52 void clearOverflow(const QString& windowId);
53
58 bool isOverflow(const QString& windowId) const;
59
73 QStringList applyOverflow(const QString& screenId, const QStringList& windows, int tileCount);
74
90 QStringList recoverIfRoom(const QString& screenId, int tiledCount, int maxWindows,
91 const std::function<bool(const QString&)>& isFloating,
92 const std::function<bool(const QString&)>& containsWindow);
93
98 QSet<QString> takeForScreen(const QString& screenId);
99
109 void migrateWindow(const QString& windowId);
110
119 void clearForRemovedScreens(const QSet<QString>& activeScreens);
120
125 bool isEmpty() const;
126
127private:
128 QHash<QString, QSet<QString>> m_overflow; // screenId -> overflow window IDs
129 QHash<QString, QString> m_windowToScreen; // windowId -> screenId (reverse index)
130};
131
132} // namespace PhosphorTileEngine
Per-screen overflow window tracking (pure tracking — no PhosphorTiles::TilingState mutation)
Definition OverflowManager.h:36
void migrateWindow(const QString &windowId)
Clear overflow status when a window migrates between screens.
bool isEmpty() const
Check if there are any overflow windows tracked.
bool isOverflow(const QString &windowId) const
Check if a window is currently overflow-tracked.
QSet< QString > takeForScreen(const QString &screenId)
Take and remove all overflow entries for a screen.
void clearOverflow(const QString &windowId)
Clear overflow status for a window (any screen)
QStringList recoverIfRoom(const QString &screenId, int tiledCount, int maxWindows, const std::function< bool(const QString &)> &isFloating, const std::function< bool(const QString &)> &containsWindow)
Identify overflow windows that should be unfloated when room opens.
void clearForRemovedScreens(const QSet< QString > &activeScreens)
Clear overflow entries for windows on screens not in the active set.
QStringList applyOverflow(const QString &screenId, const QStringList &windows, int tileCount)
Identify windows beyond tileCount that should be auto-floated.
void markOverflow(const QString &windowId, const QString &screenId)
Mark a window as overflow on a specific screen.
Definition AutotileConfig.h:14