aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorNeil Hodgson <nyamatongwe@gmail.com>2014-02-20 13:56:46 +1100
committerNeil Hodgson <nyamatongwe@gmail.com>2014-02-20 13:56:46 +1100
commit9e381ff68a4833b998445bbee844e85cf094b6c7 (patch)
treee1210d17228ab684c30036bf3e53034864858f1e
parente0b0f5f0a72ec3de2656bd2571fbb753852638ab (diff)
downloadscintilla-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.mm2
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;
}