feat: improve responsiveness in showing switcher (closes #4959)
This commit is contained in:
1 parent
4e065b9a80
commit
a80721b2d3
2 files changed
+12
-1
No files matched your search
@@ -221,7 +221,6 @@ class App: AppCenterApplication {
|
||||
if isFirstSummon || shortcutIndex != self.shortcutIndex {
|
||||
MainMenu.toggle(enabled: false)
|
||||
NSScreen.updatePreferred()
|
||||
Applications.manuallyRefreshAllWindows()
|
||||
if isVeryFirstSummon {
|
||||
Windows.sortByLevel()
|
||||
isVeryFirstSummon = false
|
||||
|
||||
@@ -3,6 +3,7 @@ import Cocoa
|
||||
class ThumbnailsPanel: NSPanel {
|
||||
var thumbnailsView = ThumbnailsView()
|
||||
override var canBecomeKey: Bool { true }
|
||||
private var didDisplayOnce = false
|
||||
|
||||
convenience init() {
|
||||
self.init(contentRect: .zero, styleMask: .nonactivatingPanel, backing: .buffered, defer: false)
|
||||
@@ -42,6 +43,7 @@ class ThumbnailsPanel: NSPanel {
|
||||
}
|
||||
|
||||
override func orderOut(_ sender: Any?) {
|
||||
didDisplayOnce = false
|
||||
if Preferences.fadeOutAnimation {
|
||||
NSAnimationContext.runAnimationGroup(
|
||||
{ _ in animator().alphaValue = 0 },
|
||||
@@ -52,6 +54,16 @@ class ThumbnailsPanel: NSPanel {
|
||||
}
|
||||
}
|
||||
|
||||
override func displayIfNeeded() {
|
||||
super.displayIfNeeded()
|
||||
if !didDisplayOnce {
|
||||
didDisplayOnce = true
|
||||
DispatchQueue.main.async {
|
||||
Applications.manuallyRefreshAllWindows()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func show() {
|
||||
updateAppearance()
|
||||
alphaValue = 1
|
||||
|
||||
Reference in new issue
Block a user