Browse Source

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
pull/168/head
Matthias Melcher 19 years ago
parent
commit
30f4aebe8a
  1. 2
      CHANGES
  2. 2
      src/Fl.cxx
  3. 28
      src/Fl_mac.cxx

2
CHANGES

@ -1,5 +1,7 @@ @@ -1,5 +1,7 @@
CHANGES IN FLTK 1.1.8
- Fixed Fl_Window::visible() and shown() for OS X
(STR #1341)
- Fixed Fl_Window::copy_label() losing copy (STR #1332)
- Documentation fixes (STR #1336, STR #1329, STR #1339,
STR #1340)

2
src/Fl.cxx

@ -1023,10 +1023,8 @@ int Fl_Window::handle(int ev) @@ -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__

28
src/Fl_mac.cxx

@ -871,6 +871,12 @@ static pascal OSStatus carbonWindowHandler( EventHandlerCallRef nextHandler, Eve @@ -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) @@ -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) @@ -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) @@ -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) @@ -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) @@ -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(); }
}

Loading…
Cancel
Save