From 8d1d2df0c2088c14de281e60b2694bc4352ef63d Mon Sep 17 00:00:00 2001 From: Manolo Gouy Date: Wed, 9 Dec 2015 12:52:17 +0000 Subject: Mac OS: using true system windows for FLTK sub-Fl_Window's. Improved handling of the situations where a subwindow is created, hidden, the parent window resized, and the subwindow shown, with a new size. This change no longer sends setFrame: or setFrameOrigin: messages to hidden subwindows. Instead, subwindows acquire their correct size and position when they are shown again and Fl_X::map() is called. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10954 ea41ed52-d2ee-0310-a9c1-e6b18d33e121 --- src/Fl_cocoa.mm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/Fl_cocoa.mm b/src/Fl_cocoa.mm index ab6652f96..5f0c32f0e 100644 --- a/src/Fl_cocoa.mm +++ b/src/Fl_cocoa.mm @@ -735,7 +735,7 @@ void Fl::remove_timeout(Fl_Timeout_Handler cb, void* data) if (!NSEqualRects(rp, [self frame])) { [self setFrame:rp display:YES]; } - if (w->visible_r() && ![self parentWindow]) { + if (![self parentWindow]) { [pxid addChildWindow:self ordered:NSWindowAbove]; // needs OS X 10.2 [self orderWindow:NSWindowAbove relativeTo:[pxid windowNumber]]; // necessary under 10.3 } @@ -3236,7 +3236,7 @@ void Fl_Window::resize(int X,int Y,int W,int H) { parent = parent->window(); } NSRect r = NSMakeRect(bx, main_screen_height - (by + H), W, H + (border()?bt:0)); - [fl_xid(this) setFrame:r display:YES]; + if (visible_r()) [fl_xid(this) setFrame:r display:YES]; } else { bx = X; by = Y; parent = window(); @@ -3246,7 +3246,7 @@ void Fl_Window::resize(int X,int Y,int W,int H) { parent = parent->window(); } NSPoint pt = NSMakePoint(bx, main_screen_height - (by + H)); - [fl_xid(this) setFrameOrigin:pt]; // set cocoa coords to FLTK position + if (visible_r()) [fl_xid(this) setFrameOrigin:pt]; // set cocoa coords to FLTK position } } else { -- cgit v1.2.3