diff options
| author | Manolo Gouy <Manolo> | 2014-11-13 13:57:27 +0000 |
|---|---|---|
| committer | Manolo Gouy <Manolo> | 2014-11-13 13:57:27 +0000 |
| commit | d2072c818c2a297c9cabb16eb1e98755a6d6fc5f (patch) | |
| tree | 9be168c1bd46a21cb2441081556cd56e54593501 /src | |
| parent | b0c7a6f509b4ba0ddc9661dc2b19d987a8d72b33 (diff) | |
A subwindow in an Fl_Tile did not work well after recent addition of support for true Mac OS X subwindows.
The tile demo program runs correctly again.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10453 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'src')
| -rw-r--r-- | src/Fl_cocoa.mm | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/Fl_cocoa.mm b/src/Fl_cocoa.mm index 2674899d4..7a209985f 100644 --- a/src/Fl_cocoa.mm +++ b/src/Fl_cocoa.mm @@ -2609,9 +2609,11 @@ static void set_subwindow_frame(Fl_Window *w) { // maps a subwindow at its corre // subwindow coordinates are in screen units from bottom just like all windows rp.origin = NSMakePoint(rp.origin.x + w->x(), rp.origin.y + parent->h() - w->y() - w->h()); rp.size = NSMakeSize(w->w(), w->h()); - [xid setFrame:rp display:YES]; - [pxid addChildWindow:xid ordered:NSWindowAbove]; // needs OS X 10.2 - [xid orderWindow:NSWindowAbove relativeTo:[pxid windowNumber]]; // necessary under 10.3 + if (!NSEqualRects(rp, [xid frame])) { + [xid setFrame:rp display:YES]; + [pxid addChildWindow:xid ordered:NSWindowAbove]; // needs OS X 10.2 + [xid orderWindow:NSWindowAbove relativeTo:[pxid windowNumber]]; // necessary under 10.3 + } } /* @@ -2911,6 +2913,7 @@ void Fl_Window::resize(int X,int Y,int W,int H) { size_range(W, H, W, H); } Fl_Group::resize(X,Y,W,H); + if (parent()) set_subwindow_frame(this); // make sure that subwindows of this window don't leak out of their parent window NSArray *children = [fl_xid(this) childWindows]; // 10.2 NSEnumerator *enumerator = [children objectEnumerator]; |
