diff --git a/quickshell/components/BarDrawer.qml b/quickshell/components/BarDrawer.qml index b45c97f..5f4b29a 100644 --- a/quickshell/components/BarDrawer.qml +++ b/quickshell/components/BarDrawer.qml @@ -35,10 +35,23 @@ Item { readonly property real revealed: unrolls ? Math.max(0, contentHeight * progress) : contentHeight // Drop moves down on the way in and on the way out. property real dropFrom: -1 - onOpenChanged: dropFrom = open ? -1 : 1 - // The drop is already empty below 0.02; unmapping there means Hyprland's - // fade-out has nothing left to fade. - readonly property bool shown: progress > (liquid ? 0.02 : 0.001) + // Hyprland fades out a layer's last frame when it unmaps. A fast close can + // jump from a visible bead straight to 0, so the drop stays mapped for a + // few frames after closing to present an empty frame first. + readonly property bool shown: progress > 0.001 || holdEmpty + property bool holdEmpty: false + onOpenChanged: { + dropFrom = open ? -1 : 1; + holdEmpty = !open && liquid && progress > 0.001; + emptyFrames.stop(); + } + onProgressChanged: if (holdEmpty && progress <= 0.001) + emptyFrames.restart() + Timer { + id: emptyFrames + interval: 60 + onTriggered: root.holdEmpty = false + } // NotchDrop's content fade: in once the panel has its size, out first. readonly property real dropContent: { const t = Math.min(1, Math.max(0, (progress - 0.82) / 0.18));