Compositor-agnostic debounced action with coalescing. More...
#include <phosphor-compositor/include/PhosphorCompositor/DebouncedAction.h>
Signals | |
| void | applyRequested () |
| Emitted when an apply is requested (debounced change or explicit reapply) | |
Public Member Functions | |
| DebouncedScreenAction (int debounceMs, QObject *parent=nullptr) | |
| void | stop () |
| void | geometryChanged (const QRect ¤tGeometry) |
| Signal that the screen geometry has changed. | |
| void | requestReapply () |
| Request a re-apply (e.g., daemon-triggered). | |
| void | markApplyStarted () |
| Call when the apply operation starts (before async D-Bus call). | |
| void | markApplyCompleted () |
| Call when the apply operation completes. | |
| bool | isChangeInProgress () const |
| void | setLastGeometry (const QRect &geo) |
Compositor-agnostic debounced action with coalescing.
Debounces rapid-fire geometry change signals (e.g., screen connect/disconnect) and coalesces re-apply requests while a previous apply is in progress.
Shared by Wayfire plugin and future compositor integrations. KWin's ScreenChangeHandler has its own specialized debounce logic that also checks virtual screen SIZE (not just geometry) before triggering.
Note: geometryChanged() only detects actual geometry changes. If a monitor disconnects and reconnects at the same resolution, the geometry is unchanged and no action is triggered. Callers needing screen-count-change detection should handle that separately.
|
inlineexplicit |
| debounceMs | Debounce interval in milliseconds |
| parent | QObject parent for timer ownership |
|
signal |
Emitted when an apply is requested (debounced change or explicit reapply)
|
inline |
Signal that the screen geometry has changed.
Debounces and only triggers the action when geometry actually changes size.
| currentGeometry | Current virtual screen geometry |
|
inline |
|
inline |
Call when the apply operation completes.
Triggers re-apply if one was coalesced.
|
inline |
Call when the apply operation starts (before async D-Bus call).
|
inline |
Request a re-apply (e.g., daemon-triggered).
Coalesces if an apply is already in progress.
|
inline |
|
inline |