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
commita1d97f80602b2ad96510e603fa359c2a3069d431 (patch)
tree44450b65eeda1893e6ff6e3deb5aae07d1d8d91b
parenta0cc83c4a4746656294c07b25e7e71785b47866b (diff)
downloadscintilla-mirror-a1d97f80602b2ad96510e603fa359c2a3069d431.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;
}