+void wxTopLevelWindowMac::MacPerformUpdates()
+{
+#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_3
+ // for composited windows this also triggers a redraw of all
+ // invalid views in the window
+ if ( UMAGetSystemVersion() >= 0x1030 )
+ HIWindowFlush((WindowRef) m_macWindow) ;
+ else
+#endif
+ {
+ // the only way to trigger the redrawing on earlier systems is to call
+ // ReceiveNextEvent
+
+ EventRef currentEvent = (EventRef) wxTheApp->MacGetCurrentEvent() ;
+ UInt32 currentEventClass = 0 ;
+ if ( currentEvent != NULL )
+ {
+ currentEventClass = ::GetEventClass( currentEvent ) ;
+ ::GetEventKind( currentEvent ) ;
+ }
+
+ if ( currentEventClass != kEventClassMenu )
+ {
+ // when tracking a menu, strange redraw errors occur if we flush now, so leave..
+ EventRef theEvent;
+ ReceiveNextEvent( 0 , NULL , kEventDurationNoWait , false , &theEvent ) ;
+ }
+ }
+}
+
+// Attracts the users attention to this window if the application is
+// inactive (should be called when a background event occurs)
+
+static pascal void wxMacNMResponse( NMRecPtr ptr )
+{
+ NMRemove( ptr ) ;
+ DisposePtr( (Ptr)ptr ) ;
+}
+
+void wxTopLevelWindowMac::RequestUserAttention(int flags )
+{
+ NMRecPtr notificationRequest = (NMRecPtr) NewPtr( sizeof( NMRec) ) ;
+ static wxMacNMUPP nmupp( wxMacNMResponse );
+
+ memset( notificationRequest , 0 , sizeof(*notificationRequest) ) ;
+ notificationRequest->qType = nmType ;
+ notificationRequest->nmMark = 1 ;
+ notificationRequest->nmIcon = 0 ;
+ notificationRequest->nmSound = 0 ;
+ notificationRequest->nmStr = NULL ;
+ notificationRequest->nmResp = nmupp ;
+
+ verify_noerr( NMInstall( notificationRequest ) ) ;
+}
+