From 52d4135495d0f7a4bad8481dd96512f9ca7e7849 Mon Sep 17 00:00:00 2001 From: Shx Guo Date: Thu, 8 Jan 2026 16:29:47 +0800 Subject: [PATCH 1/5] Tweak window performance --- OverlayWindow/Sources/OverlayWindow/OverlayPanel.swift | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/OverlayWindow/Sources/OverlayWindow/OverlayPanel.swift b/OverlayWindow/Sources/OverlayWindow/OverlayPanel.swift index 8a568256..d5583848 100644 --- a/OverlayWindow/Sources/OverlayWindow/OverlayPanel.swift +++ b/OverlayWindow/Sources/OverlayWindow/OverlayPanel.swift @@ -52,9 +52,9 @@ final class OverlayPanel: NSPanel { isReleasedWhenClosed = false menu = nil - isOpaque = false + isOpaque = true backgroundColor = .clear - hasShadow = true + hasShadow = false alphaValue = 1.0 collectionBehavior = [.fullScreenAuxiliary] isFloatingPanel = true From 2a8e0c464d7f2a0a0bfe5e5826ef6bfb458c95af Mon Sep 17 00:00:00 2001 From: Shx Guo Date: Thu, 8 Jan 2026 16:38:33 +0800 Subject: [PATCH 2/5] Make chat panel opaque --- Core/Sources/SuggestionWidget/ChatPanelWindow.swift | 3 --- 1 file changed, 3 deletions(-) diff --git a/Core/Sources/SuggestionWidget/ChatPanelWindow.swift b/Core/Sources/SuggestionWidget/ChatPanelWindow.swift index cf9a4690..022b424c 100644 --- a/Core/Sources/SuggestionWidget/ChatPanelWindow.swift +++ b/Core/Sources/SuggestionWidget/ChatPanelWindow.swift @@ -51,10 +51,7 @@ final class ChatPanelWindow: WidgetWindow { }()) titlebarAppearsTransparent = true isReleasedWhenClosed = false - isOpaque = false - backgroundColor = .clear level = widgetLevel(1) - hasShadow = true contentView = NSHostingView( rootView: ChatWindowView( From 7b65a0d1088e0cbe75c75371ded287c50851750e Mon Sep 17 00:00:00 2001 From: Shx Guo Date: Thu, 8 Jan 2026 17:02:22 +0800 Subject: [PATCH 3/5] Disable shadows since it will boost GPU usage of WindowServer --- .../WidgetWindowsController.swift | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/Core/Sources/SuggestionWidget/WidgetWindowsController.swift b/Core/Sources/SuggestionWidget/WidgetWindowsController.swift index 68e158c9..24f0d31d 100644 --- a/Core/Sources/SuggestionWidget/WidgetWindowsController.swift +++ b/Core/Sources/SuggestionWidget/WidgetWindowsController.swift @@ -479,7 +479,6 @@ extension WidgetWindowsController { ) if let suggestionPanelLocation = widgetLocation.suggestionPanelLocation { - print(suggestionPanelLocation) windows.suggestionPanelWindow.setFrame( suggestionPanelLocation.frame, display: false, @@ -705,7 +704,7 @@ public final class WidgetWindows { defer: false ) it.isReleasedWhenClosed = false - it.isOpaque = false + it.isOpaque = true it.backgroundColor = .clear it.collectionBehavior = [.canJoinAllSpaces, .fullScreenAuxiliary, .transient] it.hasShadow = false @@ -723,10 +722,10 @@ public final class WidgetWindows { defer: false ) it.isReleasedWhenClosed = false - it.isOpaque = false + it.isOpaque = true it.backgroundColor = .clear it.level = widgetLevel(0) - it.hasShadow = true + it.hasShadow = false it.contentView = NSHostingView( rootView: WidgetView( store: store.scope( @@ -749,11 +748,11 @@ public final class WidgetWindows { defer: false ) it.isReleasedWhenClosed = false - it.isOpaque = false + it.isOpaque = true it.backgroundColor = .clear it.level = widgetLevel(2) it.hoveringLevel = widgetLevel(2) - it.hasShadow = true + it.hasShadow = false it.contentView = NSHostingView( rootView: SharedPanelView( store: store.scope( @@ -783,10 +782,12 @@ public final class WidgetWindows { defer: false ) it.isReleasedWhenClosed = false - it.isOpaque = false + it.isOpaque = true it.backgroundColor = .clear it.level = widgetLevel(2) - it.hasShadow = true + it.hasShadow = false + it.menu = nil + it.animationBehavior = .utilityWindow it.contentView = NSHostingView( rootView: SuggestionPanelView( store: store.scope( @@ -881,6 +882,8 @@ class WidgetWindow: CanBecomeKeyWindow { } var hoveringLevel: NSWindow.Level = widgetLevel(0) + + override var isFloatingPanel: Bool { true } var defaultCollectionBehavior: NSWindow.CollectionBehavior { [.fullScreenAuxiliary, .transient] From e20d282f4c469f78e0799bcf6b4179ca650f1c8d Mon Sep 17 00:00:00 2001 From: Shx Guo Date: Thu, 8 Jan 2026 17:02:32 +0800 Subject: [PATCH 4/5] Make OverlayPanel public --- .../Sources/OverlayWindow/OverlayPanel.swift | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/OverlayWindow/Sources/OverlayWindow/OverlayPanel.swift b/OverlayWindow/Sources/OverlayWindow/OverlayPanel.swift index d5583848..ed60f239 100644 --- a/OverlayWindow/Sources/OverlayWindow/OverlayPanel.swift +++ b/OverlayWindow/Sources/OverlayWindow/OverlayPanel.swift @@ -1,7 +1,7 @@ import AppKit +import Logger import Perception import SwiftUI -import Logger struct OverlayFrameEnvironmentKey: EnvironmentKey { static let defaultValue: CGRect = .zero @@ -24,7 +24,7 @@ public extension EnvironmentValues { } @MainActor -final class OverlayPanel: NSPanel { +public final class OverlayPanel: NSPanel { @MainActor @Perceptible final class PanelState { @@ -35,7 +35,7 @@ final class OverlayPanel: NSPanel { let panelState: PanelState = .init() private var _canBecomeKey = true - init( + public init( contentRect: NSRect, @ViewBuilder content: @escaping () -> Content ) { @@ -71,21 +71,21 @@ final class OverlayPanel: NSPanel { ) } - override var canBecomeKey: Bool { + override public var canBecomeKey: Bool { return _canBecomeKey } - override var canBecomeMain: Bool { + override public var canBecomeMain: Bool { return false } - - override func setIsVisible(_ visible: Bool) { + + override public func setIsVisible(_ visible: Bool) { _canBecomeKey = false defer { _canBecomeKey = true } super.setIsVisible(visible) } - func moveToActiveSpace() { + public func moveToActiveSpace() { collectionBehavior = [.fullScreenAuxiliary, .moveToActiveSpace] Task { @MainActor in try await Task.sleep(nanoseconds: 50_000_000) From f524675d97590c481c10935998bfff59233e0b7f Mon Sep 17 00:00:00 2001 From: Shx Guo Date: Thu, 8 Jan 2026 17:52:08 +0800 Subject: [PATCH 5/5] Bump version --- Version.xcconfig | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Version.xcconfig b/Version.xcconfig index be9bca5c..2f199135 100644 --- a/Version.xcconfig +++ b/Version.xcconfig @@ -1,4 +1,4 @@ -APP_VERSION = 0.37.3 -APP_BUILD = 492 +APP_VERSION = 0.37.4 +APP_BUILD = 494 RELEASE_CHANNEL = RELEASE_NUMBER = 1