changed processing of events to only process the events that were logged when entering wxMacProcessNotifierEvents, ignoring eventually added new ones during notifier processing
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@13577 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -115,22 +115,31 @@ void wxMacProcessNotifierEvents()
|
|||||||
// return ;
|
// return ;
|
||||||
|
|
||||||
gInProcessing = true ;
|
gInProcessing = true ;
|
||||||
while ( gMacNotificationEvents.top != gMacNotificationEvents.bottom )
|
if ( gMacNotificationEvents.top != gMacNotificationEvents.bottom )
|
||||||
{
|
{
|
||||||
// consume event at bottom
|
// we only should process the notifiers that were here when we entered it
|
||||||
short index = gMacNotificationEvents.bottom++ ;
|
// otherwise we might never get out...
|
||||||
if ( gMacNotificationEvents.bottom == kMaxEvents )
|
short count = gMacNotificationEvents.top - gMacNotificationEvents.bottom ;
|
||||||
gMacNotificationEvents.bottom = 0 ;
|
if ( count < 0 )
|
||||||
void* data = gMacNotificationEvents.data[index] ;
|
count += kMaxEvents ;
|
||||||
unsigned long event = gMacNotificationEvents.events[index] ;
|
|
||||||
wxMacNotificationProcPtr handler = gMacNotificationEvents.proc[index] ;
|
|
||||||
|
|
||||||
gMacNotificationEvents.data[index] = NULL ;
|
while ( count-- )
|
||||||
gMacNotificationEvents.events[index] = NULL ;
|
{
|
||||||
gMacNotificationEvents.proc[index] = NULL ;
|
// consume event at bottom
|
||||||
|
short index = gMacNotificationEvents.bottom++ ;
|
||||||
|
if ( gMacNotificationEvents.bottom == kMaxEvents )
|
||||||
|
gMacNotificationEvents.bottom = 0 ;
|
||||||
|
void* data = gMacNotificationEvents.data[index] ;
|
||||||
|
unsigned long event = gMacNotificationEvents.events[index] ;
|
||||||
|
wxMacNotificationProcPtr handler = gMacNotificationEvents.proc[index] ;
|
||||||
|
|
||||||
if ( handler )
|
gMacNotificationEvents.data[index] = NULL ;
|
||||||
handler( event , data ) ;
|
gMacNotificationEvents.events[index] = NULL ;
|
||||||
|
gMacNotificationEvents.proc[index] = NULL ;
|
||||||
|
|
||||||
|
if ( handler )
|
||||||
|
handler( event , data ) ;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
gInProcessing = false ;
|
gInProcessing = false ;
|
||||||
}
|
}
|
||||||
|
@@ -115,22 +115,31 @@ void wxMacProcessNotifierEvents()
|
|||||||
// return ;
|
// return ;
|
||||||
|
|
||||||
gInProcessing = true ;
|
gInProcessing = true ;
|
||||||
while ( gMacNotificationEvents.top != gMacNotificationEvents.bottom )
|
if ( gMacNotificationEvents.top != gMacNotificationEvents.bottom )
|
||||||
{
|
{
|
||||||
// consume event at bottom
|
// we only should process the notifiers that were here when we entered it
|
||||||
short index = gMacNotificationEvents.bottom++ ;
|
// otherwise we might never get out...
|
||||||
if ( gMacNotificationEvents.bottom == kMaxEvents )
|
short count = gMacNotificationEvents.top - gMacNotificationEvents.bottom ;
|
||||||
gMacNotificationEvents.bottom = 0 ;
|
if ( count < 0 )
|
||||||
void* data = gMacNotificationEvents.data[index] ;
|
count += kMaxEvents ;
|
||||||
unsigned long event = gMacNotificationEvents.events[index] ;
|
|
||||||
wxMacNotificationProcPtr handler = gMacNotificationEvents.proc[index] ;
|
|
||||||
|
|
||||||
gMacNotificationEvents.data[index] = NULL ;
|
while ( count-- )
|
||||||
gMacNotificationEvents.events[index] = NULL ;
|
{
|
||||||
gMacNotificationEvents.proc[index] = NULL ;
|
// consume event at bottom
|
||||||
|
short index = gMacNotificationEvents.bottom++ ;
|
||||||
|
if ( gMacNotificationEvents.bottom == kMaxEvents )
|
||||||
|
gMacNotificationEvents.bottom = 0 ;
|
||||||
|
void* data = gMacNotificationEvents.data[index] ;
|
||||||
|
unsigned long event = gMacNotificationEvents.events[index] ;
|
||||||
|
wxMacNotificationProcPtr handler = gMacNotificationEvents.proc[index] ;
|
||||||
|
|
||||||
if ( handler )
|
gMacNotificationEvents.data[index] = NULL ;
|
||||||
handler( event , data ) ;
|
gMacNotificationEvents.events[index] = NULL ;
|
||||||
|
gMacNotificationEvents.proc[index] = NULL ;
|
||||||
|
|
||||||
|
if ( handler )
|
||||||
|
handler( event , data ) ;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
gInProcessing = false ;
|
gInProcessing = false ;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user