Bug 493037 - "aNumLines must be non-zero" assertion hit on mouse wheel input. r=emaijala.
authorJim Mathies <jmathies@mozilla.com>
Tue, 30 Jun 2009 01:02:07 -0500
changeset 29842 f4d72fac17b4c46bd42b2087e8ddf41d7e434882
parent 29841 9f0e541d6656a3f314c90beb99f33bb499406ecd
child 29843 90cb997e99270c9b9e02cca758e6ec6715ef4632
push idunknown
push userunknown
push dateunknown
reviewersemaijala
bugs493037
milestone1.9.2a1pre
Bug 493037 - "aNumLines must be non-zero" assertion hit on mouse wheel input. r=emaijala.
widget/src/windows/nsWindow.cpp
--- a/widget/src/windows/nsWindow.cpp
+++ b/widget/src/windows/nsWindow.cpp
@@ -5007,16 +5007,19 @@ PRBool nsWindow::OnMouseWheel(UINT msg, 
       currentHDelta += (short) HIWORD (wParam);
       if (PR_ABS(currentHDelta) >= iDeltaPerChar) {
         scrollEvent.delta = currentHDelta / iDeltaPerChar;
         currentHDelta %= iDeltaPerChar;
       }
     }
   }
 
+  if (!scrollEvent.delta)
+    break;
+
   scrollEvent.isShift   = IS_VK_DOWN(NS_VK_SHIFT);
   scrollEvent.isControl = IS_VK_DOWN(NS_VK_CONTROL);
   scrollEvent.isMeta    = PR_FALSE;
   scrollEvent.isAlt     = IS_VK_DOWN(NS_VK_ALT);
   InitEvent(scrollEvent);
   if (nsnull != mEventCallback) {
     result = DispatchWindowEvent(&scrollEvent);
   }