[Qt][WK2] Set event timestamps on custom input events
authorabecsi@webkit.org <abecsi@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 2 Dec 2011 16:36:36 +0000 (16:36 +0000)
committerabecsi@webkit.org <abecsi@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 2 Dec 2011 16:36:36 +0000 (16:36 +0000)
Reviewed by Simon Hausmann.

Since r101791 WebEventFactoryQt uses input event timestamps for WebEvents,
thus set the timestamp on the custom events as well.

* UIProcess/qt/QtWebPageEventHandler.cpp:
(QtWebPageEventHandler::handleHoverLeaveEvent):
(QtWebPageEventHandler::handleHoverMoveEvent):
* UIProcess/qt/WebPopupMenuProxyQtDesktop.cpp:
(WebKit::WebPopupMenuProxyQtDesktop::showPopupMenu):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@101804 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebKit2/ChangeLog
Source/WebKit2/UIProcess/qt/QtWebPageEventHandler.cpp
Source/WebKit2/UIProcess/qt/WebPopupMenuProxyQtDesktop.cpp

index f187a18..62f9b97 100644 (file)
@@ -1,5 +1,20 @@
 2011-12-02  Andras Becsi  <andras.becsi@nokia.com>
 
+        [Qt][WK2] Set event timestamps on custom input events
+
+        Reviewed by Simon Hausmann.
+
+        Since r101791 WebEventFactoryQt uses input event timestamps for WebEvents,
+        thus set the timestamp on the custom events as well.
+
+        * UIProcess/qt/QtWebPageEventHandler.cpp:
+        (QtWebPageEventHandler::handleHoverLeaveEvent):
+        (QtWebPageEventHandler::handleHoverMoveEvent):
+        * UIProcess/qt/WebPopupMenuProxyQtDesktop.cpp:
+        (WebKit::WebPopupMenuProxyQtDesktop::showPopupMenu):
+
+2011-12-02  Andras Becsi  <andras.becsi@nokia.com>
+
         [Qt] [WK2] Use input event timestamps in WebEvents if available
         https://bugs.webkit.org/show_bug.cgi?id=73647
 
index 19d32f4..6b1fb5d 100644 (file)
@@ -192,6 +192,7 @@ bool QtWebPageEventHandler::handleHoverLeaveEvent(QHoverEvent* ev)
     // To get the correct behavior of mouseout, we need to turn the Leave event of our webview into a mouse move
     // to a very far region.
     QHoverEvent fakeEvent(QEvent::HoverMove, QPoint(INT_MIN, INT_MIN), ev->oldPos());
+    fakeEvent.setTimestamp(ev->timestamp());
     return handleHoverMoveEvent(&fakeEvent);
 }
 
@@ -199,6 +200,7 @@ bool QtWebPageEventHandler::handleHoverMoveEvent(QHoverEvent* ev)
 {
     QMouseEvent me(QEvent::MouseMove, ev->pos(), Qt::NoButton, Qt::NoButton, Qt::NoModifier);
     me.setAccepted(ev->isAccepted());
+    me.setTimestamp(ev->timestamp());
 
     return handleMouseMoveEvent(&me);
 }
index 71598a0..94fda6d 100644 (file)
@@ -34,6 +34,7 @@
 #include <QMouseEvent>
 #include <QStandardItemModel>
 #include "WebPopupItem.h"
+#include <wtf/CurrentTime.h>
 
 using namespace WebCore;
 
@@ -68,6 +69,7 @@ void WebPopupMenuProxyQtDesktop::showPopupMenu(const IntRect& rect, WebCore::Tex
 
     QMouseEvent event(QEvent::MouseButtonPress, QCursor::pos(), Qt::LeftButton,
                       Qt::LeftButton, Qt::NoModifier);
+    event.setTimestamp(static_cast<qint64>(WTF::currentTimeMS()));
     QCoreApplication::sendEvent(this, &event);
 }