Phosphor
Qt6 / Wayland library suite for window-management tools
 
Loading...
Searching...
No Matches
TopologyCoordinator.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#include <PhosphorLayer/phosphorlayer_export.h>
7
8#include <QObject>
9
10#include <memory>
11
12namespace PhosphorLayer {
13
14class ILayerShellTransport;
15class IScreenProvider;
16
26{
27 int debounceMs = 200;
28 bool debugLogDiffs = false;
29};
30
50class PHOSPHORLAYER_EXPORT TopologyCoordinator : public QObject
51{
52 Q_OBJECT
53public:
57
59 QObject* parent = nullptr);
61
76 using SyncCallback = std::function<void()>;
77 using CallbackId = quint64;
80
81Q_SIGNALS:
85
88
93
94private:
95 class Impl;
96 std::unique_ptr<Impl> m_impl;
97};
98
99} // namespace PhosphorLayer
Abstracts the layer-shell protocol binding.
Definition ILayerShellTransport.h:111
Source-of-truth interface for the available QScreen set.
Definition IScreenProvider.h:62
Reacts to screen hot-plug / virtual-screen reconfiguration / compositor restart; drives surface recre...
Definition TopologyCoordinator.h:51
void compositorRestarted()
Transport signalled compositor loss (wlr-layer-shell global removed).
void detachSyncCallback(CallbackId id)
void screensChanged()
All sync callbacks have run; the screen set is stable again.
quint64 CallbackId
Definition TopologyCoordinator.h:77
std::function< void()> SyncCallback
Register a callback invoked whenever the coordinator decides the screen set has materially changed.
Definition TopologyCoordinator.h:76
TopologyCoordinator(IScreenProvider *screens, ILayerShellTransport *transport, TopologyConfig cfg={}, QObject *parent=nullptr)
CallbackId attachSyncCallback(SyncCallback cb)
void screensChanging()
Debounce fired; the consumer should snapshot any state that depends on the current screen set before ...
Definition SurfaceAnimator.h:26
Tunables for TopologyCoordinator.
Definition TopologyCoordinator.h:26
int debounceMs
Coalesce screensChanged bursts.
Definition TopologyCoordinator.h:27
bool debugLogDiffs
Definition TopologyCoordinator.h:28