1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2026-08-02 19:48:27 -04:00
Files
DankMaterialShell/quickshell/Common/FrameTransitionState.qml
T
purian23 57d08f6b3b refactor(Xray): Update Xray & standalone to frame transitions
- Fix dbar autohide with Xray options that could have blocked bar area content
- Fixes #2729
2026-07-01 21:39:47 -04:00

57 lines
1.5 KiB
QML

pragma Singleton
pragma ComponentBehavior: Bound
import QtQuick
import Quickshell
Singleton {
id: root
property int revision: 0
property int appliedRevision: 0
readonly property bool ready: appliedRevision >= revision
// Latched: surfaces render the last compositor-acknowledged state until the atomic flip on ack
property bool effectiveFrameEnabled: false
property string effectiveFrameMode: "connected"
readonly property bool effectiveConnectedFrameModeActive: effectiveFrameEnabled && effectiveFrameMode === "connected"
signal transitionRequested(int revision)
function begin() {
revision++;
transitionRequested(revision);
return revision;
}
function acknowledge(requestRevision) {
if (requestRevision > appliedRevision)
appliedRevision = requestRevision;
}
function syncEffective() {
effectiveFrameEnabled = SettingsData.frameEnabled;
effectiveFrameMode = SettingsData.frameMode;
}
onReadyChanged: {
if (ready)
syncEffective();
}
// Tracks settings-load changes; live toggles begin() first (ready false) so the latch holds
Connections {
target: SettingsData
function onFrameEnabledChanged() {
if (root.ready)
root.syncEffective();
}
function onFrameModeChanged() {
if (root.ready)
root.syncEffective();
}
}
Component.onCompleted: syncEffective()
}