Cocoa: fix delaying issue for events that were fired outside the processEvents function
authorDamien Plisson <damien.plisson@yahoo.fr>
Wed, 2 Dec 2009 10:10:20 +0000 (10:10 +0000)
committerDamien Plisson <damien.plisson@yahoo.fr>
Wed, 2 Dec 2009 10:10:20 +0000 (10:10 +0000)
An example of a visible issue was a delayed wm resize when switching to/from fullscreen mode

intern/ghost/intern/GHOST_SystemCocoa.mm

index 573b815..0aa9f8d 100644 (file)
@@ -746,8 +746,6 @@ bool GHOST_SystemCocoa::processEvents(bool waitForEvent)
        bool anyProcessed = false;
        NSEvent *event;
        
-       m_outsideLoopEventProcessed = false;
-       
        //      SetMouseCoalescingEnabled(false, NULL);
        //TODO : implement timer ??
        
@@ -844,9 +842,12 @@ bool GHOST_SystemCocoa::processEvents(bool waitForEvent)
                } while (event!= nil);          
        //} while (waitForEvent && !anyProcessed); Needed only for timer implementation
        
+       if (m_outsideLoopEventProcessed) {
+               m_outsideLoopEventProcessed = false;
+               return true;
+       }
        
-       
-    return anyProcessed || m_outsideLoopEventProcessed;
+    return anyProcessed;
 }
 
 //Note: called from NSApplication delegate