Using MiniBrowser i noticed it is firing twice the QDesktopWebView::mousePressEvent method when the moused is pressed anywhere on the screen.
Created attachment 103291 [details] Patch. Proposed patch
Comment on attachment 103291 [details] Patch. View in context: https://bugs.webkit.org/attachment.cgi?id=103291&action=review > Tools/MiniBrowser/qt/MiniBrowserApplication.cpp:107 > if (m_touchPoints.contains(touchPoint.id())) > touchPoint.setState(Qt::TouchPointMoved); > - else > - touchPoint.setState(Qt::TouchPointPressed); > + else { > + if (mouseEvent->modifiers().testFlag(Qt::ControlModifier)) > + touchPoint.setState(Qt::TouchPointPressed); > + } It seems to me that the problem might be that m_touchPoints.contains(touchPoint.id()) == false. If the touchpoint is still active because, it should be in m_touchPoints.
Created attachment 103384 [details] Test Case Adding Test case.
Probably we are talking about two different things. I added a test case where onmousedown event is firing two times the callback. It happens because QDesktopWebView::mousePressEvent is called twice. (In reply to comment #2) > (From update of attachment 103291 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=103291&action=review > > > Tools/MiniBrowser/qt/MiniBrowserApplication.cpp:107 > > if (m_touchPoints.contains(touchPoint.id())) > > touchPoint.setState(Qt::TouchPointMoved); > > - else > > - touchPoint.setState(Qt::TouchPointPressed); > > + else { > > + if (mouseEvent->modifiers().testFlag(Qt::ControlModifier)) > > + touchPoint.setState(Qt::TouchPointPressed); > > + } > > It seems to me that the problem might be that m_touchPoints.contains(touchPoint.id()) == false. > If the touchpoint is still active because, it should be in m_touchPoints.
Created attachment 103418 [details] Patch Updating proposed patch with a better ChangeLog explaining the modifications.
Attachment 103418 [details] did not pass style-queue: Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'Tools/ChangeLog', u'Tools/MiniBrowser/qt/M..." exit_code: 1 Tools/MiniBrowser/qt/MiniBrowserApplication.cpp:104: Missing space before ( in if( [whitespace/parens] [5] Total errors found: 1 in 2 files If any of these errors are false positives, please file a bug against check-webkit-style.
Created attachment 103419 [details] Patch Proposed patch.
Comment on attachment 103419 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=103419&action=review This has nothing to do with the ControlModifier. The problem is we still send the original mouse event after we send the touch events. QWidget also generate a fake mouse event for the touch event so we end up with 2 mouse events. The original event should be discarded when a touch event is generated. > Tools/ChangeLog:9 > + On some windowing systems, mouse events are also sent for the primary touch point. This > + means it is possible for your widget to receive both QTouchEvent and QMouseEvent for the > + same user interaction point. MiniBrowser when setting the Qt::TouchPointPressed for a touch Qt is supposed to always give you a mouse event for the primary touch point. > Tools/ChangeLog:12 > + to be called twice for a single mouse click. Now the Qt::TouchPointPressed is used just > + when Ctrl modifier is pressed. This is not at all the intended behavior of the code of touch mocking.
Created attachment 103500 [details] Patch Proposed patch.
Created attachment 103509 [details] Patch Updated patch.
Created attachment 103513 [details] Patch
Shouldn't this approach just work?
Comment on attachment 103513 [details] Patch I cq-, let's not land that before Igor has a look.
Created attachment 103520 [details] Patch
Comment on attachment 103520 [details] Patch Looks OK. If this solves it, r=me
Comment on attachment 103520 [details] Patch Let's land that. Freaking QWidget hacks... :)
Comment on attachment 103520 [details] Patch Clearing flags on attachment: 103520 Committed r92799: <http://trac.webkit.org/changeset/92799>
All reviewed patches have been landed. Closing bug.