diff options
| author | Matthias Melcher <fltk@matthiasm.com> | 2006-07-16 20:37:41 +0000 |
|---|---|---|
| committer | Matthias Melcher <fltk@matthiasm.com> | 2006-07-16 20:37:41 +0000 |
| commit | 30f4aebe8af22faa6d399396856b640006ad272a (patch) | |
| tree | ee5a5645c211e4b103f28d18bdaf2dbe30cd19e4 /src | |
| parent | d20a41681d9e50c6516b1543e443f5909b25ff96 (diff) | |
STR #1341: Fixed Fl_Window::visible() and shown() for OS X
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@5257 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'src')
| -rw-r--r-- | src/Fl.cxx | 2 | ||||
| -rw-r--r-- | src/Fl_mac.cxx | 28 |
2 files changed, 18 insertions, 12 deletions
diff --git a/src/Fl.cxx b/src/Fl.cxx index d1a6ee812..922443c6d 100644 --- a/src/Fl.cxx +++ b/src/Fl.cxx @@ -1023,10 +1023,8 @@ int Fl_Window::handle(int ev) } #ifdef __APPLE_QD__ hide(); - set_visible(); #elif defined(__APPLE_QUARTZ__) hide(); - set_visible(); #else XUnmapWindow(fl_display, fl_xid(this)); #endif // __APPLE__ diff --git a/src/Fl_mac.cxx b/src/Fl_mac.cxx index 5c102e32e..15d86f1f9 100644 --- a/src/Fl_mac.cxx +++ b/src/Fl_mac.cxx @@ -871,6 +871,12 @@ static pascal OSStatus carbonWindowHandler( EventHandlerCallRef nextHandler, Eve if (!Fl_X::first) QuitAppleEventHandler( 0, 0, 0 ); ret = noErr; // returning noErr tells Carbon to stop following up on this event break; + case kEventWindowCollapsed: + window->clear_visible(); + break; + case kEventWindowExpanded: + window->set_visible(); + break; } fl_unlock_function(); @@ -1715,7 +1721,6 @@ void Fl_X::make(Fl_Window* w) x->gc = 0; // stay 0 for Quickdraw; fill with CGContext for Quartz Fl_Window *win = w->window(); Fl_X *xo = Fl_X::i(win); - w->set_visible(); if (xo) { x->xidNext = xo->xidChildren; x->xidChildren = 0L; @@ -1842,7 +1847,6 @@ void Fl_X::make(Fl_Window* w) x->wait_for_expose = 1; x->next = Fl_X::first; Fl_X::first = x; - w->set_visible(); { // Install Carbon Event handlers OSStatus ret; EventHandlerUPP mousewheelHandler = NewEventHandlerUPP( carbonMousewheelHandler ); // will not be disposed by Carbon... @@ -1873,6 +1877,8 @@ void Fl_X::make(Fl_Window* w) { kEventClassWindow, kEventWindowActivated }, { kEventClassWindow, kEventWindowDeactivated }, { kEventClassWindow, kEventWindowClose }, + { kEventClassWindow, kEventWindowCollapsed }, + { kEventClassWindow, kEventWindowExpanded }, { kEventClassWindow, kEventWindowBoundsChanging }, { kEventClassWindow, kEventWindowBoundsChanged } }; ret = InstallWindowEventHandler( x->xid, windowHandler, 8, windowEvents, w, 0L ); @@ -1887,16 +1893,19 @@ void Fl_X::make(Fl_Window* w) if ( err==noErr ) SetFrontProcess( &psn ); } - if (fl_show_iconic) { - fl_show_iconic = 0; - CollapseWindow( x->xid, true ); // \todo Mac ; untested - } else if (winclass != kHelpWindowClass) { + if (w->size_range_set) w->size_range_(); + + if (winclass != kHelpWindowClass) { Fl_Tooltip::enter(0); + ShowWindow(x->xid); + if (fl_show_iconic) { + fl_show_iconic = 0; + CollapseWindow( x->xid, true ); // \todo Mac ; untested + } else { + w->set_visible(); + } } - if (w->size_range_set) w->size_range_(); - ShowWindow(x->xid); - Rect rect; GetWindowBounds(x->xid, kWindowContentRgn, &rect); w->x(rect.left); w->y(rect.top); @@ -1906,7 +1915,6 @@ void Fl_X::make(Fl_Window* w) w->handle(Fl::e_number = FL_SHOW); Fl::e_number = old_event; w->redraw(); // force draw to happen - w->set_visible(); if (w->modal()) { Fl::modal_ = w; fl_fix_focus(); } } |
