From c2e889169308b826f68becc4c2c14ede857689c3 Mon Sep 17 00:00:00 2001 From: Matthias Melcher Date: Sat, 2 Aug 2003 05:54:43 +0000 Subject: OS X: some changes to support Apples ProjectBuilder. OS X: FLTK now queries the true windows position from the window manager after creating a new window. This fixes the problem with popup menues showing up at the wrong position. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@3067 ea41ed52-d2ee-0310-a9c1-e6b18d33e121 --- src/Fl_mac.cxx | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/Fl_mac.cxx b/src/Fl_mac.cxx index e78f9a8e5..bfda9b7b1 100644 --- a/src/Fl_mac.cxx +++ b/src/Fl_mac.cxx @@ -1,5 +1,5 @@ // -// "$Id: Fl_mac.cxx,v 1.1.2.50 2003/07/21 05:38:16 matthiaswm Exp $" +// "$Id: Fl_mac.cxx,v 1.1.2.51 2003/08/02 05:54:43 matthiaswm Exp $" // // MacOS specific code for the Fast Light Tool Kit (FLTK). // @@ -666,6 +666,10 @@ static pascal OSStatus carbonWindowHandler( EventHandlerCallRef nextHandler, Eve switch ( kind ) { + case kEventWindowBoundsChanging: + GetEventParameter( event, kEventParamCurrentBounds, typeQDRectangle, NULL, sizeof(Rect), NULL, ¤tBounds ); + GetEventParameter( event, kEventParamOriginalBounds, typeQDRectangle, NULL, sizeof(Rect), NULL, &originalBounds ); + break; case kEventWindowDrawContent: handleUpdateEvent( fl_xid( window ) ); ret = noErr; @@ -1615,8 +1619,9 @@ void Fl_X::make(Fl_Window* w) { kEventClassWindow, kEventWindowActivated }, { kEventClassWindow, kEventWindowDeactivated }, { kEventClassWindow, kEventWindowClose }, + { kEventClassWindow, kEventWindowBoundsChanging }, { kEventClassWindow, kEventWindowBoundsChanged } }; - ret = InstallWindowEventHandler( x->xid, windowHandler, 7, windowEvents, w, 0L ); + ret = InstallWindowEventHandler( x->xid, windowHandler, 8, windowEvents, w, 0L ); ret = InstallTrackingHandler( dndTrackingHandler, x->xid, w ); ret = InstallReceiveHandler( dndReceiveHandler, x->xid, w ); } @@ -1637,6 +1642,11 @@ void Fl_X::make(Fl_Window* w) ShowWindow(x->xid); + Rect rect; + GetWindowBounds(x->xid, kWindowContentRgn, &rect); + w->x(rect.left); w->y(rect.top); + w->w(rect.right-rect.left); w->h(rect.bottom-rect.top); + w->handle(FL_SHOW); w->redraw(); // force draw to happen w->set_visible(); @@ -1867,6 +1877,6 @@ void Fl::paste(Fl_Widget &receiver, int clipboard) { // -// End of "$Id: Fl_mac.cxx,v 1.1.2.50 2003/07/21 05:38:16 matthiaswm Exp $". +// End of "$Id: Fl_mac.cxx,v 1.1.2.51 2003/08/02 05:54:43 matthiaswm Exp $". // -- cgit v1.2.3