Skip to content

Commit 7b65a0d

Browse files
committed
Disable shadows since it will boost GPU usage of WindowServer
1 parent 2a8e0c4 commit 7b65a0d

File tree

1 file changed

+11
-8
lines changed

1 file changed

+11
-8
lines changed

Core/Sources/SuggestionWidget/WidgetWindowsController.swift

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -479,7 +479,6 @@ extension WidgetWindowsController {
479479
)
480480

481481
if let suggestionPanelLocation = widgetLocation.suggestionPanelLocation {
482-
print(suggestionPanelLocation)
483482
windows.suggestionPanelWindow.setFrame(
484483
suggestionPanelLocation.frame,
485484
display: false,
@@ -705,7 +704,7 @@ public final class WidgetWindows {
705704
defer: false
706705
)
707706
it.isReleasedWhenClosed = false
708-
it.isOpaque = false
707+
it.isOpaque = true
709708
it.backgroundColor = .clear
710709
it.collectionBehavior = [.canJoinAllSpaces, .fullScreenAuxiliary, .transient]
711710
it.hasShadow = false
@@ -723,10 +722,10 @@ public final class WidgetWindows {
723722
defer: false
724723
)
725724
it.isReleasedWhenClosed = false
726-
it.isOpaque = false
725+
it.isOpaque = true
727726
it.backgroundColor = .clear
728727
it.level = widgetLevel(0)
729-
it.hasShadow = true
728+
it.hasShadow = false
730729
it.contentView = NSHostingView(
731730
rootView: WidgetView(
732731
store: store.scope(
@@ -749,11 +748,11 @@ public final class WidgetWindows {
749748
defer: false
750749
)
751750
it.isReleasedWhenClosed = false
752-
it.isOpaque = false
751+
it.isOpaque = true
753752
it.backgroundColor = .clear
754753
it.level = widgetLevel(2)
755754
it.hoveringLevel = widgetLevel(2)
756-
it.hasShadow = true
755+
it.hasShadow = false
757756
it.contentView = NSHostingView(
758757
rootView: SharedPanelView(
759758
store: store.scope(
@@ -783,10 +782,12 @@ public final class WidgetWindows {
783782
defer: false
784783
)
785784
it.isReleasedWhenClosed = false
786-
it.isOpaque = false
785+
it.isOpaque = true
787786
it.backgroundColor = .clear
788787
it.level = widgetLevel(2)
789-
it.hasShadow = true
788+
it.hasShadow = false
789+
it.menu = nil
790+
it.animationBehavior = .utilityWindow
790791
it.contentView = NSHostingView(
791792
rootView: SuggestionPanelView(
792793
store: store.scope(
@@ -881,6 +882,8 @@ class WidgetWindow: CanBecomeKeyWindow {
881882
}
882883

883884
var hoveringLevel: NSWindow.Level = widgetLevel(0)
885+
886+
override var isFloatingPanel: Bool { true }
884887

885888
var defaultCollectionBehavior: NSWindow.CollectionBehavior {
886889
[.fullScreenAuxiliary, .transient]

0 commit comments

Comments
 (0)