Fix toast view stutter

This commit is contained in:
Leon Böttger committed 2026-02-22 19:37:10 +01:00
1 parent b16556dd1b
commit 093390084f
3 files changed
+5 -5

No files matched your search

+1 -1
View File
@@ -21,7 +21,7 @@
"en" : {
"stringUnit" : {
"state" : "new",
"value" : "QuickDrop"
"value" : "QuickDropGitHub"
}
}
},
@@ -276,7 +276,6 @@ struct QuickDropToastHostView: View {
.opacity(isVisible ? 1 : hiddenOpacity)
.blur(radius: isVisible ? 0 : hiddenBlur)
.animation(animation, value: receiveModel.toastIsVisible)
.animation(animation, value: receiveModel.toastDismissStyle)
.frame(maxWidth: .infinity, maxHeight: .infinity, alignment: .trailing)
.padding(.trailing, toastTrailingPadding)
}
+4 -3
View File
@@ -431,7 +431,7 @@ class ReceiveModel: ObservableObject, InboundAppDelegate {
// MARK: - macOS Progress Overlay
#if os(macOS)
private func scheduleToastReveal(for window: NSWindow, delay: TimeInterval = 0.1) {
private func scheduleToastReveal(for window: NSWindow) {
toastRevealTask?.cancel()
toastRevealTask = nil
@@ -443,7 +443,8 @@ class ReceiveModel: ObservableObject, InboundAppDelegate {
}
toastRevealTask = revealTask
DispatchQueue.main.asyncAfter(deadline: .now() + delay, execute: revealTask)
// Reveal on the next run-loop tick to avoid pop-in without timer jitter.
DispatchQueue.main.async(execute: revealTask)
}
func showQuickDropToast(for connectionID: String) {
@@ -461,10 +462,10 @@ class ReceiveModel: ObservableObject, InboundAppDelegate {
toastRevealTask = nil
if let window = toastWindow {
window.makeKeyAndOrderFront(nil)
toastDismissStyle = .slide
if !toastIsVisible {
window.makeKeyAndOrderFront(nil)
scheduleToastReveal(for: window)
}
return