Bug 629334 - Back out changeset 84ed248b728d (ignore native events when in event tracking mode on Mac) due to menu bar weirdness. r=backout a=backout
authorPatrick Walton <pwalton@mozilla.com>
Thu, 27 Jan 2011 15:27:39 -0800
changeset 61415 a7b806aebf0920fba1ba9dca702fa37f25acc302
parent 61414 7bf7239c16b39caa3a961257092be6f74c1c8f76
child 61416 3211c8b1b76109ba025ec76afe57ad8a916749e0
push id18354
push userpwalton@mozilla.com
push dateThu, 27 Jan 2011 23:34:38 +0000
treeherdermozilla-central@3211c8b1b761 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbackout, backout
bugs629334
milestone2.0b11pre
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 629334 - Back out changeset 84ed248b728d (ignore native events when in event tracking mode on Mac) due to menu bar weirdness. r=backout a=backout
widget/src/cocoa/nsAppShell.mm
widget/src/xpwidgets/nsBaseAppShell.cpp
widget/src/xpwidgets/nsBaseAppShell.h
--- a/widget/src/cocoa/nsAppShell.mm
+++ b/widget/src/cocoa/nsAppShell.mm
@@ -389,25 +389,19 @@ nsAppShell::ProcessGeckoEvents(void* aIn
                                     windowNumber:0
                                          context:NULL
                                          subtype:0
                                            data1:0
                                            data2:0]
              atStart:NO];
   }
 
-  // During "event tracking" mode, we're in a nested event loop (and we're
-  // usually in a performance-critical section such as a window resize), so we
-  // block native events.
-  NSString *runLoopMode = [[NSRunLoop currentRunLoop] currentMode];
-  PRBool blockNativeEvents = runLoopMode == NSEventTrackingRunLoopMode;
-
   if (self->mSuspendNativeCount <= 0) {
     ++self->mNativeEventCallbackDepth;
-    self->NativeEventCallback(blockNativeEvents);
+    self->NativeEventCallback();
     --self->mNativeEventCallbackDepth;
   } else {
     self->mSkippedNativeCallback = PR_TRUE;
   }
 
   // Still needed to fix bug 343033 ("5-10 second delay or hang or crash
   // when quitting Cocoa Firefox").
   [NSApp postEvent:[NSEvent otherEventWithType:NSApplicationDefined
--- a/widget/src/xpwidgets/nsBaseAppShell.cpp
+++ b/widget/src/xpwidgets/nsBaseAppShell.cpp
@@ -88,20 +88,19 @@ nsBaseAppShell::Init()
 
   nsCOMPtr<nsIObserverService> obsSvc =
     mozilla::services::GetObserverService();
   if (obsSvc)
     obsSvc->AddObserver(this, NS_XPCOM_SHUTDOWN_OBSERVER_ID, PR_FALSE);
   return NS_OK;
 }
 
-// Called by nsAppShell's native event callback. Set aAlwaysBlockNative to true
-// to always block native events.
+// Called by nsAppShell's native event callback
 void
-nsBaseAppShell::NativeEventCallback(PRBool aAlwaysBlockNative)
+nsBaseAppShell::NativeEventCallback()
 {
   PRInt32 hasPending = PR_AtomicSet(&mNativeEventPending, 0);
   if (hasPending == 0)
     return;
 
   // If DoProcessNextNativeEvent is on the stack, then we assume that we can
   // just unwind and let nsThread::ProcessNextEvent process the next event.
   // However, if we are called from a nested native event loop (maybe via some
@@ -113,19 +112,17 @@ nsBaseAppShell::NativeEventCallback(PRBo
     return;
   }
 
   // nsBaseAppShell::Run is not being used to pump events, so this may be
   // our only opportunity to process pending gecko events.
 
   nsIThread *thread = NS_GetCurrentThread();
   PRBool prevBlockNativeEvent = mBlockNativeEvent;
-  if (aAlwaysBlockNative) {
-    mBlockNativeEvent = PR_TRUE;
-  } else if (mEventloopNestingState == eEventloopOther) {
+  if (mEventloopNestingState == eEventloopOther) {
     if (!NS_HasPendingEvents(thread))
       return;
     // We're in a nested native event loop and have some gecko events to
     // process.  While doing that we block processing native events from the
     // appshell - instead, we want to get back to the nested native event
     // loop ASAP (bug 420148).
     mBlockNativeEvent = PR_TRUE;
   }
--- a/widget/src/xpwidgets/nsBaseAppShell.h
+++ b/widget/src/xpwidgets/nsBaseAppShell.h
@@ -68,17 +68,17 @@ protected:
    * This method is called by subclasses when the app shell singleton is
    * instantiated.
    */
   nsresult Init();
 
   /**
    * Called by subclasses from a native event. See ScheduleNativeEventCallback.
    */
-  void NativeEventCallback(PRBool aAlwaysBlockNative = PR_FALSE);
+  void NativeEventCallback();
 
   /**
    * Make a decision as to whether or not NativeEventCallback will
    * trigger gecko event processing when there are pending gecko
    * events.
    */
   virtual void DoProcessMoreGeckoEvents();