]> git.saurik.com Git - wxWidgets.git/blobdiff - src/mac/toplevel.cpp
faster portsetting backpatched
[wxWidgets.git] / src / mac / toplevel.cpp
index f5598a3c9f069377647acfbcf545f2e64e619331..67b1307bd7576753a8cfe89a8b00fa1996db5e5a 100644 (file)
@@ -242,7 +242,7 @@ static pascal OSStatus KeyboardEventHandler( EventHandlerCallRef handler , Event
     return result ;
 }
 
-static pascal OSStatus MouseEventHandler( EventHandlerCallRef handler , EventRef event , void *data )
+pascal OSStatus MouseEventHandler( EventHandlerCallRef handler , EventRef event , void *data )
 {
     OSStatus result = eventNotHandledErr ;
 
@@ -267,7 +267,10 @@ static pascal OSStatus MouseEventHandler( EventHandlerCallRef handler , EventRef
     WindowRef window ;
     short windowPart = ::FindWindow(point, &window);
 
-    if ( IsWindowActive(window) && windowPart == inContent )
+    // either we really are active or we are capturing mouse events
+
+    if ( (IsWindowActive(window) && windowPart == inContent) || 
+        (wxTheApp->s_captureWindow && wxTheApp->s_captureWindow->MacGetTopLevelWindow() == toplevelWindow) )
     {
         switch ( GetEventKind( event ) )
         {
@@ -1067,12 +1070,13 @@ void wxTopLevelWindowMac::DoMoveWindow(int x, int y, int width, int height)
     {
         m_x = actualX ;
         m_y = actualY ;
-        m_width = actualWidth ;
-        m_height = actualHeight ;
 
         if ( doMove )
             ::MoveWindow((WindowRef)m_macWindow, m_x, m_y  , false); // don't make frontmost
 
+        m_width = actualWidth ;
+        m_height = actualHeight ;
+
         if ( doResize )
             ::SizeWindow((WindowRef)m_macWindow, m_width, m_height  , true);