From d5f5cdb45ab122a1d6b8e9290ef4b3b26764f5b3 Mon Sep 17 00:00:00 2001 From: Daniel Pham Date: Sat, 5 Mar 2016 01:39:13 -0500 Subject: [PATCH] :apple:Fix 'isMaximized()' for non resizable windows --- atom/browser/native_window_mac.mm | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/atom/browser/native_window_mac.mm b/atom/browser/native_window_mac.mm index 9d9f2a2392d1..46448594c365 100644 --- a/atom/browser/native_window_mac.mm +++ b/atom/browser/native_window_mac.mm @@ -583,7 +583,16 @@ void NativeWindowMac::Unmaximize() { } bool NativeWindowMac::IsMaximized() { - return [window_ isZoomed]; + if (([window_ styleMask] & NSResizableWindowMask) != 0) { + return [window_ isZoomed]; + } else { + NSRect rectScreen = [[NSScreen mainScreen] visibleFrame]; + NSRect rectWindow = [window_ frame]; + return (rectScreen.origin.x == rectWindow.origin.x && + rectScreen.origin.y == rectWindow.origin.y && + rectScreen.size.width == rectWindow.size.width && + rectScreen.size.height == rectWindow.size.height); + } } void NativeWindowMac::Minimize() {