6#include <phosphorcompositor_export.h>
46 m_debounce.setSingleShot(
true);
47 m_debounce.setInterval(debounceMs);
48 connect(&m_debounce, &QTimer::timeout,
this, &DebouncedScreenAction::onDebounceTimeout);
66 if (m_hasLastGeometry && currentGeometry == m_lastGeometry && !m_pending) {
67 if (m_applyInProgress) {
72 m_lastGeometry = currentGeometry;
73 m_hasLastGeometry =
true;
84 if (m_applyInProgress) {
85 m_reapplyPending =
true;
88 Q_EMIT applyRequested();
96 m_applyInProgress =
true;
105 m_applyInProgress =
false;
106 if (m_reapplyPending) {
107 m_reapplyPending =
false;
108 QTimer::singleShot(0,
this, [
this]() {
109 Q_EMIT applyRequested();
116 return m_pending || m_applyInProgress;
121 m_lastGeometry = geo;
122 m_hasLastGeometry =
true;
130 void onDebounceTimeout()
135 Q_EMIT applyRequested();
140 QRect m_lastGeometry;
141 bool m_hasLastGeometry =
false;
142 bool m_pending =
false;
143 bool m_applyInProgress =
false;
144 bool m_reapplyPending =
false;
Compositor-agnostic debounced action with coalescing.
Definition DebouncedAction.h:35
void setLastGeometry(const QRect &geo)
Definition DebouncedAction.h:119
DebouncedScreenAction(int debounceMs, QObject *parent=nullptr)
Definition DebouncedAction.h:43
void applyRequested()
Emitted when an apply is requested (debounced change or explicit reapply)
void markApplyStarted()
Call when the apply operation starts (before async D-Bus call).
Definition DebouncedAction.h:94
void geometryChanged(const QRect ¤tGeometry)
Signal that the screen geometry has changed.
Definition DebouncedAction.h:64
void markApplyCompleted()
Call when the apply operation completes.
Definition DebouncedAction.h:103
void stop()
Definition DebouncedAction.h:51
bool isChangeInProgress() const
Definition DebouncedAction.h:114
void requestReapply()
Request a re-apply (e.g., daemon-triggered).
Definition DebouncedAction.h:82
Definition AutotileState.h:16