Present an empty frame before a notch drop unmaps

A fast close jumps from a visible bead straight to 0 in one tick, and
hiding in that tick left the bead as the layer's last frame, which
Hyprland then faded out. Keep the drawer mapped for a few frames after
closing so an empty frame is drawn first.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
mxandClaude Opus 5.5 committed 2026-11-26 14:35:28 +01:00
1 parent 972ab1120e
commit 1e918414d1
1 file changed
+17 -4
+17 -4
View File
@@ -35,10 +35,23 @@ Item {
readonly property real revealed: unrolls ? Math.max(0, contentHeight * progress) : contentHeight readonly property real revealed: unrolls ? Math.max(0, contentHeight * progress) : contentHeight
// Drop moves down on the way in and on the way out. // Drop moves down on the way in and on the way out.
property real dropFrom: -1 property real dropFrom: -1
onOpenChanged: dropFrom = open ? -1 : 1 // Hyprland fades out a layer's last frame when it unmaps. A fast close can
// The drop is already empty below 0.02; unmapping there means Hyprland's // jump from a visible bead straight to 0, so the drop stays mapped for a
// fade-out has nothing left to fade. // few frames after closing to present an empty frame first.
readonly property bool shown: progress > (liquid ? 0.02 : 0.001) 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. // NotchDrop's content fade: in once the panel has its size, out first.
readonly property real dropContent: { readonly property real dropContent: {
const t = Math.min(1, Math.max(0, (progress - 0.82) / 0.18)); const t = Math.min(1, Math.max(0, (progress - 0.82) / 0.18));