Skip to content

Commit a80721b

Browse files
committed
feat: improve responsiveness in showing switcher (closes #4959)
1 parent 4e065b9 commit a80721b

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

src/ui/App.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,6 @@ class App: AppCenterApplication {
221221
if isFirstSummon || shortcutIndex != self.shortcutIndex {
222222
MainMenu.toggle(enabled: false)
223223
NSScreen.updatePreferred()
224-
Applications.manuallyRefreshAllWindows()
225224
if isVeryFirstSummon {
226225
Windows.sortByLevel()
227226
isVeryFirstSummon = false

src/ui/main-window/ThumbnailsPanel.swift

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import Cocoa
33
class ThumbnailsPanel: NSPanel {
44
var thumbnailsView = ThumbnailsView()
55
override var canBecomeKey: Bool { true }
6+
private var didDisplayOnce = false
67

78
convenience init() {
89
self.init(contentRect: .zero, styleMask: .nonactivatingPanel, backing: .buffered, defer: false)
@@ -42,6 +43,7 @@ class ThumbnailsPanel: NSPanel {
4243
}
4344

4445
override func orderOut(_ sender: Any?) {
46+
didDisplayOnce = false
4547
if Preferences.fadeOutAnimation {
4648
NSAnimationContext.runAnimationGroup(
4749
{ _ in animator().alphaValue = 0 },
@@ -52,6 +54,16 @@ class ThumbnailsPanel: NSPanel {
5254
}
5355
}
5456

57+
override func displayIfNeeded() {
58+
super.displayIfNeeded()
59+
if !didDisplayOnce {
60+
didDisplayOnce = true
61+
DispatchQueue.main.async {
62+
Applications.manuallyRefreshAllWindows()
63+
}
64+
}
65+
}
66+
5567
func show() {
5668
updateAppearance()
5769
alphaValue = 1

0 commit comments

Comments
 (0)