X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/427ff66291af2d8dd34ff5ee68c81436997144a1..0728199b911be9095406cf05059a5a180e707778:/src/mac/carbon/macnotfy.cpp diff --git a/src/mac/carbon/macnotfy.cpp b/src/mac/carbon/macnotfy.cpp index 36d7fb3e61..8d22be40fd 100644 --- a/src/mac/carbon/macnotfy.cpp +++ b/src/mac/carbon/macnotfy.cpp @@ -7,6 +7,8 @@ * ------------------------------------------------------------------------- */ +#include "wx/wxprec.h" + #include "wx/wx.h" #include "wx/mac/private.h" @@ -26,38 +28,10 @@ struct wxMacNotificationEvents } ; typedef struct wxMacNotificationEvents wxMacNotificationEvents ; -wxMacNotificationEvents gMacNotificationEvents ; +static wxMacNotificationEvents gMacNotificationEvents ; ProcessSerialNumber gAppProcess ; -void wxMacWakeUp() -{ - ProcessSerialNumber psn ; - Boolean isSame ; - psn.highLongOfPSN = 0 ; - psn.lowLongOfPSN = kCurrentProcess ; - SameProcess( &gAppProcess , &psn , &isSame ) ; - if ( isSame ) - { -#if TARGET_CARBON - EventRef dummyEvent ; - OSStatus err = MacCreateEvent(nil, 'WXMC', 'WXMC', GetCurrentEventTime(), - kEventAttributeNone, &dummyEvent); - if (err == noErr) - { - err = PostEventToQueue(GetMainEventQueue(), dummyEvent, - kEventPriorityHigh); - } -#else - PostEvent( nullEvent , 0 ) ; -#endif - } - else - { - WakeUpProcess( &gAppProcess ) ; - } -} - void wxMacCreateNotifierTable() { GetCurrentProcess(&gAppProcess); @@ -66,7 +40,7 @@ void wxMacCreateNotifierTable() for ( int i = 0 ; i < kMaxEvents ; ++i ) { gMacNotificationEvents.proc[i] = NULL ; - gMacNotificationEvents.events[i] = NULL ; + gMacNotificationEvents.events[i] = 0 ; gMacNotificationEvents.data[i] = NULL ; } } @@ -112,11 +86,11 @@ void wxMacRemoveAllNotifiersForData( wxMacNotifierTableRef table , void* data ) while ( e->top != index ) { - if ( index == kMaxEvents ) - index = 0 ; if ( e->data[index] == data ) e->data[index] = NULL ; index++ ; + if ( index == kMaxEvents ) + index = 0 ; } } @@ -145,7 +119,7 @@ void wxMacProcessNotifierEvents() wxMacNotificationProcPtr handler = gMacNotificationEvents.proc[index] ; gMacNotificationEvents.data[index] = NULL ; - gMacNotificationEvents.events[index] = NULL ; + gMacNotificationEvents.events[index] = 0 ; gMacNotificationEvents.proc[index] = NULL ; if ( handler )