@@ -240,35 +240,31 @@ final class DockObserver {
240240
241241 guard Defaults [ . enableDockPreviews] else { return }
242242
243- if cachedWindows. isEmpty {
244- guard Self . isSpecialControlsApp ( currentApp. bundleIdentifier) , Defaults [ . showSpecialAppControls] else {
245- return
246- }
247- }
248-
249243 let mouseScreen = NSScreen . screenContainingMouse ( currentMouseLocation)
250244 let convertedMouseLocation = DockObserver . nsPointFromCGPoint ( currentMouseLocation, forScreen: mouseScreen)
251-
252- previewCoordinator. showWindow (
253- appName: currentAppInfo. localizedName ?? " Unknown " ,
254- windows: cachedWindows,
255- mouseLocation: convertedMouseLocation,
256- mouseScreen: mouseScreen,
257- dockItemElement: dockItemElement,
258- overrideDelay: false ,
259- onWindowTap: { [ weak self] in
260- self ? . hideWindowAndResetLastApp ( )
261- } ,
262- bundleIdentifier: currentAppInfo. bundleIdentifier
263- )
264-
265- previousStatus = . success( currentApp)
266-
267245 let screenOrigin = mouseScreen. frame. origin
268246 let currentAppPID = currentApp. processIdentifier
269- let currentAppIsHidden = currentApp. isHidden
270247 let currentAppBundleId = currentApp. bundleIdentifier
271248
249+ let shouldShowCachedPreview = !cachedWindows. isEmpty ||
250+ ( Self . isSpecialControlsApp ( currentApp. bundleIdentifier) && Defaults [ . showSpecialAppControls] )
251+
252+ if shouldShowCachedPreview {
253+ previewCoordinator. showWindow (
254+ appName: currentAppInfo. localizedName ?? " Unknown " ,
255+ windows: cachedWindows,
256+ mouseLocation: convertedMouseLocation,
257+ mouseScreen: mouseScreen,
258+ dockItemElement: dockItemElement,
259+ overrideDelay: false ,
260+ onWindowTap: { [ weak self] in
261+ self ? . hideWindowAndResetLastApp ( )
262+ } ,
263+ bundleIdentifier: currentAppInfo. bundleIdentifier
264+ )
265+ previousStatus = . success( currentApp)
266+ }
267+
272268 Task . detached { [ weak self] in
273269 guard let self else { return }
274270
0 commit comments