make WakeUp variant explicit, too many errors using heuristics, like #14176

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@71343 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Stefan Csomor 2012-05-02 19:30:11 +00:00
parent 6e22db9e3e
commit 4b0a48dbac
2 changed files with 8 additions and 2 deletions

View File

@ -23,6 +23,9 @@ public:
virtual void WakeUp();
void OSXUseLowLevelWakeup(bool useIt)
{ m_osxLowLevelWakeUp = useIt ; }
protected:
virtual int DoDispatchTimeout(unsigned long timeout);
@ -39,6 +42,8 @@ protected:
WXWindow m_dummyWindow;
int m_modalNestedLevel;
bool m_osxLowLevelWakeUp;
};
#endif // _WX_OSX_COCOA_EVTLOOP_H_

View File

@ -109,6 +109,7 @@ wxGUIEventLoop::wxGUIEventLoop()
m_dummyWindow = nil;
m_modalNestedLevel = 0;
m_modalWindow = NULL;
m_osxLowLevelWakeUp = false;
}
wxGUIEventLoop::~wxGUIEventLoop()
@ -256,11 +257,11 @@ void wxGUIEventLoop::DoStop()
void wxGUIEventLoop::WakeUp()
{
// NSEvent* cevent = [NSApp currentEvent];
NSString* mode = [[NSRunLoop mainRunLoop] currentMode];
// NSString* mode = [[NSRunLoop mainRunLoop] currentMode];
// when already in a mouse event handler, don't add higher level event
// if ( cevent != nil && [cevent type] <= NSMouseMoved && )
if ( [NSEventTrackingRunLoopMode isEqualToString:mode] )
if ( m_osxLowLevelWakeUp /* [NSEventTrackingRunLoopMode isEqualToString:mode] */ )
{
// NSLog(@"event for wakeup %@ in mode %@",cevent,mode);
wxCFEventLoop::WakeUp();