]> git.saurik.com Git - wxWidgets.git/blobdiff - src/mac/carbon/toplevel.cpp
cleanup for 10.5
[wxWidgets.git] / src / mac / carbon / toplevel.cpp
index d0251e111e04ed62988e3defdebbb4613c12b69a..6a5284d6da69e2e28d53503c61f203f8bf2da855 100644 (file)
@@ -81,8 +81,6 @@ END_EVENT_TABLE()
 // Carbon Events
 // ---------------------------------------------------------------------------
 
-extern long wxMacTranslateKey(unsigned char key, unsigned char code) ;
-
 static const EventTypeSpec eventList[] =
 {
     // TODO: remove control related event like key and mouse (except for WindowLeave events)
@@ -884,8 +882,7 @@ typedef struct
     wxPoint m_position ;
     wxSize m_size ;
     bool m_wasResizable ;
-}
-FullScreenData ;
+} FullScreenData ;
 
 void wxTopLevelWindowMac::Init()
 {
@@ -1176,6 +1173,11 @@ void  wxTopLevelWindowMac::MacCreateRealWindow(
 
     wxCHECK_RET( err == noErr, wxT("Mac OS error when trying to create new window") );
 
+    // setup a separate group for each window, so that overlays can be handled easily
+    verify_noerr( CreateWindowGroup( kWindowGroupAttrMoveTogether | kWindowGroupAttrLayerTogether | kWindowGroupAttrHideOnCollapse, &group ));
+    verify_noerr( SetWindowGroupParent( group, GetWindowGroup( (WindowRef) m_macWindow )));
+    verify_noerr( SetWindowGroup( (WindowRef) m_macWindow , group ));
+  
     // the create commands are only for content rect,
     // so we have to set the size again as structure bounds
     SetWindowBounds(  (WindowRef) m_macWindow , kWindowStructureRgn , &theBoundsRect ) ;
@@ -1530,19 +1532,17 @@ void wxTopLevelWindowMac::MacPerformUpdates()
 
         EventRef currentEvent = (EventRef) wxTheApp->MacGetCurrentEvent() ;
         UInt32 currentEventClass = 0 ;
-        UInt32 currentEventKind = 0 ;
         if ( currentEvent != NULL )
         {
             currentEventClass = ::GetEventClass( currentEvent ) ;
-            currentEventKind = ::GetEventKind( currentEvent ) ;
+            ::GetEventKind( currentEvent ) ;
         }
 
         if ( currentEventClass != kEventClassMenu )
         {
             // when tracking a menu, strange redraw errors occur if we flush now, so leave..
             EventRef theEvent;
-            OSStatus status = noErr ;
-            status = ReceiveNextEvent( 0 , NULL , kEventDurationNoWait , false , &theEvent ) ;
+            ReceiveNextEvent( 0 , NULL , kEventDurationNoWait , false , &theEvent ) ;
         }
     }
 }