cocoa: use mainScreen as a fallback for window constraining

This commit is contained in:
Stefano Pigozzi 2014-04-01 19:18:35 +02:00
parent 8eb7e2aa0b
commit fbc8ba5855
1 changed files with 1 additions and 1 deletions

View File

@ -128,7 +128,7 @@
return [super constrainFrameRect:nf toScreen:screen];
NSRect of = [self frame];
NSRect vf = [[self screen] visibleFrame];
NSRect vf = [screen ?: self.screen ?: [NSScreen mainScreen] visibleFrame];
NSRect ncf = [self contentRectForFrameRect:nf];
// Prevent the window's titlebar from exiting the screen on the top edge.