[SCM] WebKit Debian packaging branch, debian/unstable, updated. debian/1.1.15-1-40151-g37bb677

trey trey at 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Sat Sep 26 07:25:10 UTC 2009


The following commit has been merged in the debian/unstable branch:
commit 570f067407a262055b64793d05262de355dfe14d
Author: trey <trey at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Wed Feb 19 00:34:47 2003 +0000

    	3171982 - REGRESSION: onClick handlers run twice when button pressed (DSLReports.com forums)
    
    	My earlier changes added the codepath by which we let khtmlview fully process
    	a mouse up after a widget has done it's tracking, which leads to the second
    	onClick call.  Presumably that path does not exist in the native KDE case.
    	The change below reduces the impact of my hack, whereby instead of fully posting
    	a fake mouseup, we just note that the mouse has done up at the end of mousedown
    	handling, and clear the mousePressed state (state I also added).
    
            Reviewed by Darin.
    
            * khtml/khtmlview.cpp:
            (KHTMLView::viewportMousePressEvent):  Look for a current mouseUp at the end of
    	dispatching the mouse down.
            * kwq/KWQKHTMLPart.h:
            * kwq/KWQKHTMLPart.mm:
            (KWQKHTMLPart::passWidgetMouseDownEventToWidget):
    	Don't post a phony mouse up from here.
            (KWQKHTMLPart::lastEventIsMouseUp):
    	Utility routine to test for mouseUp.
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@3670 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog-2003-10-25 b/WebCore/ChangeLog-2003-10-25
index 6e51a6d..9faaae9 100644
--- a/WebCore/ChangeLog-2003-10-25
+++ b/WebCore/ChangeLog-2003-10-25
@@ -1,3 +1,26 @@
+2003-02-18  Trey Matteson  <trey at apple.com>
+
+	3171982 - REGRESSION: onClick handlers run twice when button pressed (DSLReports.com forums)
+
+	My earlier changes added the codepath by which we let khtmlview fully process
+	a mouse up after a widget has done it's tracking, which leads to the second
+	onClick call.  Presumably that path does not exist in the native KDE case.
+	The change below reduces the impact of my hack, whereby instead of fully posting
+	a fake mouseup, we just note that the mouse has done up at the end of mousedown
+	handling, and clear the mousePressed state (state I also added).
+
+        Reviewed by Darin.
+
+        * khtml/khtmlview.cpp:
+        (KHTMLView::viewportMousePressEvent):  Look for a current mouseUp at the end of
+	dispatching the mouse down.
+        * kwq/KWQKHTMLPart.h:
+        * kwq/KWQKHTMLPart.mm:
+        (KWQKHTMLPart::passWidgetMouseDownEventToWidget):
+	Don't post a phony mouse up from here.
+        (KWQKHTMLPart::lastEventIsMouseUp):
+	Utility routine to test for mouseUp.
+
 === Safari-62 ===
 
 2003-02-18  David Hyatt  <hyatt at apple.com>
diff --git a/WebCore/ChangeLog-2005-08-23 b/WebCore/ChangeLog-2005-08-23
index 6e51a6d..9faaae9 100644
--- a/WebCore/ChangeLog-2005-08-23
+++ b/WebCore/ChangeLog-2005-08-23
@@ -1,3 +1,26 @@
+2003-02-18  Trey Matteson  <trey at apple.com>
+
+	3171982 - REGRESSION: onClick handlers run twice when button pressed (DSLReports.com forums)
+
+	My earlier changes added the codepath by which we let khtmlview fully process
+	a mouse up after a widget has done it's tracking, which leads to the second
+	onClick call.  Presumably that path does not exist in the native KDE case.
+	The change below reduces the impact of my hack, whereby instead of fully posting
+	a fake mouseup, we just note that the mouse has done up at the end of mousedown
+	handling, and clear the mousePressed state (state I also added).
+
+        Reviewed by Darin.
+
+        * khtml/khtmlview.cpp:
+        (KHTMLView::viewportMousePressEvent):  Look for a current mouseUp at the end of
+	dispatching the mouse down.
+        * kwq/KWQKHTMLPart.h:
+        * kwq/KWQKHTMLPart.mm:
+        (KWQKHTMLPart::passWidgetMouseDownEventToWidget):
+	Don't post a phony mouse up from here.
+        (KWQKHTMLPart::lastEventIsMouseUp):
+	Utility routine to test for mouseUp.
+
 === Safari-62 ===
 
 2003-02-18  David Hyatt  <hyatt at apple.com>
diff --git a/WebCore/khtml/khtmlview.cpp b/WebCore/khtml/khtmlview.cpp
index 8dad6e7..a44e824 100644
--- a/WebCore/khtml/khtmlview.cpp
+++ b/WebCore/khtml/khtmlview.cpp
@@ -472,7 +472,16 @@ void KHTMLView::viewportMousePressEvent( QMouseEvent *_mouse )
     if (!swallowEvent) {
 	khtml::MousePressEvent event( _mouse, xm, ym, mev.url, mev.target, mev.innerNode );
 	QApplication::sendEvent( m_part, &event );
-
+#if APPLE_CHANGES
+        // Many AK widgets run their own event loops and consume events while the mouse is down.
+        // When they finish, currentEvent is the mouseUp that they exited on.  We need to update
+        // the khtml state with this mouseUp, which khtml never saw.
+        // If this event isn't a mouseUp, we assume that the mouseUp will be coming later.  There
+        // is a hole here if the widget consumes the mouseUp and subsequent events.
+        if (KWQ(m_part)->lastEventIsMouseUp()) {
+            d->mousePressed = false;
+        }
+#endif        
 	emit m_part->nodeActivated(mev.innerNode);
     }
 }
diff --git a/WebCore/kwq/KWQKHTMLPart.h b/WebCore/kwq/KWQKHTMLPart.h
index 7bcecd9..3cc0adf 100644
--- a/WebCore/kwq/KWQKHTMLPart.h
+++ b/WebCore/kwq/KWQKHTMLPart.h
@@ -164,7 +164,8 @@ public:
     void doFakeMouseUpAfterWidgetTracking(NSEvent *downEvent);
     void mouseMoved(NSEvent *);
     bool keyEvent(NSEvent *);
-    
+    bool lastEventIsMouseUp();
+
     void clearTimers();
     static void clearTimers(KHTMLView *);
     
diff --git a/WebCore/kwq/KWQKHTMLPart.mm b/WebCore/kwq/KWQKHTMLPart.mm
index e19f3a3..575923f 100644
--- a/WebCore/kwq/KWQKHTMLPart.mm
+++ b/WebCore/kwq/KWQKHTMLPart.mm
@@ -967,21 +967,24 @@ bool KWQKHTMLPart::passWidgetMouseDownEventToWidget(RenderWidget *renderWidget)
     _mouseDownView = view;
     _mouseDownWasInSubframe = false;
 
+    return true;
+}
+
+bool KWQKHTMLPart::lastEventIsMouseUp()
+{
     // Many AK widgets run their own event loops and consume events while the mouse is down.
     // When they finish, currentEvent is the mouseUp that they exited on.  We need to update
-    // the khtml state with this mouseUp, which khtml never saw.
-    // If this event isn't a mouseUp, we assume that the mouseUp will be coming later.  There
-    // is a hole here if the widget consumes the mouseUp and subsequent events.
+    // the khtml state with this mouseUp, which khtml never saw.  This method lets us detect
+    // that state.
     NSEvent *currentEventAfterHandlingMouseDown = [NSApp currentEvent];
     if (_currentEvent != currentEventAfterHandlingMouseDown) {
         if ([currentEventAfterHandlingMouseDown type] == NSLeftMouseUp) {
-            mouseUp(currentEventAfterHandlingMouseDown);
+            return true;
         }
     }
-    
-    return true;
+    return false;
 }
-
+    
 // Note that this does the same kind of check as [target isDescendantOf:superview].
 // There are two differences: This is a lot slower because it has to walk the whole
 // tree, and this works in cases where the target has already been deallocated.

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list