diff options
| author | Manolo Gouy <Manolo> | 2011-11-14 15:15:03 +0000 |
|---|---|---|
| committer | Manolo Gouy <Manolo> | 2011-11-14 15:15:03 +0000 |
| commit | 74720fd2055a0ac599d7ad3c6c46d98bd38cf007 (patch) | |
| tree | aa27507d488731067a82d7f5d4ad7e3b285ed77d | |
| parent | 6b1db04a80864c7cf79616301a090e7513738554 (diff) | |
Mac OS: better window positioning on secondary displays at creation.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@9176 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
| -rw-r--r-- | src/Fl_cocoa.mm | 17 |
1 files changed, 2 insertions, 15 deletions
diff --git a/src/Fl_cocoa.mm b/src/Fl_cocoa.mm index 58cda0e71..cad2081ee 100644 --- a/src/Fl_cocoa.mm +++ b/src/Fl_cocoa.mm @@ -576,21 +576,7 @@ static void do_timer(CFRunLoopTimerRef timer, void* data) contentRect:(NSRect)rect styleMask:(NSUInteger)windowStyle { - NSScreen *gd = nil; // gd will point to the screen containing the bottom-left of rect - NSArray *a = [NSScreen screens]; - for(NSUInteger i = 0; i < [a count]; i++) { - NSRect r = [[a objectAtIndex:i] frame]; - if (rect.origin.x >= r.origin.x && rect.origin.x <= r.origin.x + r.size.width - && rect.origin.y >= r.origin.y && rect.origin.y <= r.origin.y + r.size.height) { - gd = [a objectAtIndex:i]; - rect.origin.x -= r.origin.x; // express rect relatively to gd's origin - rect.origin.y -= r.origin.y; - break; - } - } - // attempt to create the window on screen gd - self = [super initWithContentRect:rect styleMask:windowStyle backing:NSBackingStoreBuffered defer:NO - screen:gd]; + self = [super initWithContentRect:rect styleMask:windowStyle backing:NSBackingStoreBuffered defer:NO]; if (self) { w = flw; containsGLsubwindow = NO; @@ -2077,6 +2063,7 @@ void Fl_X::make(Fl_Window* w) FLWindow *cw = [[FLWindow alloc] initWithFl_W:w contentRect:crect styleMask:winstyle]; + [cw setFrameOrigin:crect.origin]; [cw setHasShadow:YES]; [cw setAcceptsMouseMovedEvents:YES]; x->xid = cw; |
