diff options
author | Neil Hodgson <nyamatongwe@gmail.com> | 2014-02-20 13:56:46 +1100 |
---|---|---|
committer | Neil Hodgson <nyamatongwe@gmail.com> | 2014-02-20 13:56:46 +1100 |
commit | 9e381ff68a4833b998445bbee844e85cf094b6c7 (patch) | |
tree | e1210d17228ab684c30036bf3e53034864858f1e | |
parent | e0b0f5f0a72ec3de2656bd2571fbb753852638ab (diff) | |
download | scintilla-mirror-9e381ff68a4833b998445bbee844e85cf094b6c7.tar.gz |
When window is offscreen, use the main screen for screen max Y to prevent
the window disappearing.
-rw-r--r-- | cocoa/PlatCocoa.mm | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/cocoa/PlatCocoa.mm b/cocoa/PlatCocoa.mm index 304798cbb..28c0f8107 100644 --- a/cocoa/PlatCocoa.mm +++ b/cocoa/PlatCocoa.mm @@ -1121,6 +1121,8 @@ bool Window::HasFocus() static int ScreenMax(NSWindow* win) { NSScreen* screen = [win screen]; + if (!screen) + screen = [NSScreen mainScreen]; NSRect frame = [screen frame]; return frame.origin.y + frame.size.height; } |