From 6fa34069129ddbe99fc70899c2c0e7c215f82ec5 Mon Sep 17 00:00:00 2001 From: Gellert Hegyi Date: Thu, 23 Jul 2020 02:54:32 +0200 Subject: [PATCH] fix: remove corner mask override to increase window resize performance (#24642) * fix: remove corner mask override to increase window resize performance * uses corner mask only for vibrant view --- shell/browser/ui/cocoa/electron_ns_window.mm | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/shell/browser/ui/cocoa/electron_ns_window.mm b/shell/browser/ui/cocoa/electron_ns_window.mm index 8da315c8f6bd..9a0674b31381 100644 --- a/shell/browser/ui/cocoa/electron_ns_window.mm +++ b/shell/browser/ui/cocoa/electron_ns_window.mm @@ -17,6 +17,10 @@ bool ScopedDisableResize::disable_resize_ = false; } // namespace electron +@interface NSWindow (PrivateAPI) +- (NSImage*)_cornerMask; +@end + @implementation ElectronNSWindow @synthesize acceptsFirstMouse; @@ -158,7 +162,11 @@ bool ScopedDisableResize::disable_resize_ = false; // By overriding this built-in method the corners of the vibrant view (if set) // will be smooth. - (NSImage*)_cornerMask { - return [self cornerMask]; + if (self.vibrantView != nil) { + return [self cornerMask]; + } else { + return [super _cornerMask]; + } } // Quicklook methods