From a765eef35fa0b614948b16de469b799acdc91319 Mon Sep 17 00:00:00 2001 From: Stefan Csomor Date: Mon, 8 Mar 2010 11:08:10 +0000 Subject: [PATCH] pending events detected didn't work properly, go the safe route now, fixes #11797 git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@63652 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/osx/cocoa/evtloop.mm | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/osx/cocoa/evtloop.mm b/src/osx/cocoa/evtloop.mm index ecd63279c2..d22e47a0e0 100644 --- a/src/osx/cocoa/evtloop.mm +++ b/src/osx/cocoa/evtloop.mm @@ -99,13 +99,21 @@ CFRunLoopRef wxGUIEventLoop::CFGetCurrentRunLoop() const bool wxGUIEventLoop::Pending() const { +#if 0 + // this code doesn't reliably detect pending events + // so better return true and have the dispatch deal with it + // as otherwise we end up in a tight loop when idle events are responded + // to by RequestMore(true) wxMacAutoreleasePool autoreleasepool; - // a pointer to the event is returned if there is one, or nil if not + return [[NSApplication sharedApplication] nextEventMatchingMask: NSAnyEventMask untilDate: nil inMode: NSDefaultRunLoopMode - dequeue: NO]; + dequeue: NO] != nil; +#else + return true; +#endif } bool wxGUIEventLoop::Dispatch() -- 2.50.0