diff options
| author | Manolo Gouy <Manolo> | 2015-01-16 10:28:36 +0000 |
|---|---|---|
| committer | Manolo Gouy <Manolo> | 2015-01-16 10:28:36 +0000 |
| commit | 365c1524c0c59f0fb66bc00ec5b899bf7d24842f (patch) | |
| tree | b0e17e379e8c09636932432276dc12d500a39a95 | |
| parent | 7ad5091dbc26188a8a3a44054c265c279734b681 (diff) | |
Fix possible crash when calling Fl_Window::resize() on a non-mapped sub-window.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10522 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
| -rw-r--r-- | src/Fl_cocoa.mm | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/Fl_cocoa.mm b/src/Fl_cocoa.mm index 33d065956..17eaf8669 100644 --- a/src/Fl_cocoa.mm +++ b/src/Fl_cocoa.mm @@ -2987,6 +2987,8 @@ void Fl_X::make(Fl_Window* w) [pxid makeFirstResponder:[pxid contentView]]; } else { #if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_7 + // this is useful for menu/tooltip windows where no windowDidMove notification is received + // so they are drawn at high res already at first time compute_mapped_to_retina(w); x->changed_resolution(false); #endif @@ -2994,15 +2996,13 @@ void Fl_X::make(Fl_Window* w) } if (!w->parent()) { + // this may be useful for menu/tooltip windows where no windowDidMove notification is received crect = [[cw contentView] frame]; w->w(int(crect.size.width)); w->h(int(crect.size.height)); crect = [cw frame]; w->x(int(crect.origin.x)); w->y(int(main_screen_height - (crect.origin.y + w->h()))); -#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_7 - compute_mapped_to_retina(w); -#endif } int old_event = Fl::e_number; @@ -3154,7 +3154,7 @@ void Fl_Window::resize(int X,int Y,int W,int H) { x(X); y(Y); } } - if (this->parent()) { + if (this->parent() && shown()) { // make sure that subwindows don't leak out of their parent window parent = window(); CGRect prect = CGRectMake(0, 0, parent->w(), parent->h()); |
