#endif
}
+
bool wxGUIEventLoop::Dispatch()
{
if ( !wxTheApp )
void wxGUIEventLoop::WakeUp()
{
- NSEvent *event = [NSEvent otherEventWithType:NSApplicationDefined
+ NSEvent* cevent = [NSApp currentEvent];
+
+ // when already in a mouse event handler, don't add higher level event
+ if ( cevent != nil && [cevent type] < NSKeyDown )
+ {
+ wxCFEventLoop::WakeUp();
+ }
+ else
+ {
+ wxMacAutoreleasePool autoreleasepool;
+ NSEvent *event = [NSEvent otherEventWithType:NSApplicationDefined
location:NSMakePoint(0.0, 0.0)
modifierFlags:0
timestamp:0
windowNumber:0
context:nil
subtype:0 data1:0 data2:0];
- [NSApp postEvent:event atStart:FALSE];
+ [NSApp postEvent:event atStart:FALSE];
+ }
}
CFRunLoopRef wxGUIEventLoop::CFGetCurrentRunLoop() const
void wxModalEventLoop::DoStop()
{
- [NSApp stopModal];
+ [NSApp abortModal];
}
void wxGUIEventLoop::BeginModalSession( wxWindow* modalWindow )
}
m_modalEventLoop = (wxEventLoop*)wxEventLoopBase::GetActive();
- m_modalEventLoop->BeginModalSession(winToSkip);
+ if (m_modalEventLoop)
+ m_modalEventLoop->BeginModalSession(winToSkip);
}
wxWindowDisabler::~wxWindowDisabler()
if ( !m_disabled )
return;
- m_modalEventLoop->EndModalSession();
+ if (m_modalEventLoop)
+ m_modalEventLoop->EndModalSession();
wxWindowList::compatibility_iterator node;
for ( node = wxTopLevelWindows.GetFirst(); node; node = node->GetNext() )