RESOLVED FIXED 83091
[Qt][WK2] Click, mouse and links rely on touch mocking
https://bugs.webkit.org/show_bug.cgi?id=83091
Summary [Qt][WK2] Click, mouse and links rely on touch mocking
Noam Rosenthal
Reported 2012-04-03 16:18:14 PDT
When loading an HTML file from QML without MiniBrowser, in "mobile" mode, links and mouse-events don't work. Those start to work again when using touch-mocking, or when disabling Flickable. This makes the mobile-version of QQuickWebView unusable without MiniBrowser.
Attachments
QML loader (105 bytes, text/x-qml)
2012-04-03 16:20 PDT, Noam Rosenthal
no flags
HTML file with some mouse/links. (405 bytes, text/html)
2012-04-03 16:21 PDT, Noam Rosenthal
no flags
proposed patch (14.39 KB, patch)
2012-07-30 07:55 PDT, Andras Becsi
hausmann: review-
proposed patch (14.67 KB, patch)
2012-08-02 07:20 PDT, Andras Becsi
no flags
Noam Rosenthal
Comment 1 2012-04-03 16:20:41 PDT
Created attachment 135448 [details] QML loader QML file showing the problem
Noam Rosenthal
Comment 2 2012-04-03 16:21:14 PDT
Created attachment 135449 [details] HTML file with some mouse/links.
Noam Rosenthal
Comment 3 2012-04-03 17:21:30 PDT
Andras Becsi
Comment 4 2012-04-04 08:37:14 PDT
(In reply to comment #0) > When loading an HTML file from QML without MiniBrowser, in "mobile" mode, links and mouse-events don't work. > Those start to work again when using touch-mocking, or when disabling Flickable. Subclassing from flickable should not change the behaviour for links so I wonder why it fixed your issue. In "mobile" mode on a device which has only touch events clicking on links happens with tap gestures. If this does not work with touch events then there is something wrong with the tap gesture recognizer. The mouse events are disabled for the flickable webview for now, since it would select text when panning, but after http://codereview.qt-project.org/21896 we can enable it again.
Noam Rosenthal
Comment 5 2012-04-04 10:31:25 PDT
> Subclassing from flickable should not change the behaviour for links so I wonder why it fixed your issue. It didn't, I tested again. Might have been a testing error. > In "mobile" mode on a device which has only touch events clicking on links happens with tap gestures. There's no way to disable mobile mode > If this does not work with touch events then there is something wrong with the tap gesture recognizer. > > The mouse events are disabled for the flickable webview for now, since it would select text when panning, but after http://codereview.qt-project.org/21896 we can enable it again. So, right now, there's still no way to get pages with links running with pure QML... Let's see if that gets fixed after that Qt bug is in.
Caio Marcelo de Oliveira Filho
Comment 6 2012-05-31 13:04:53 PDT
(In reply to comment #4) > The mouse events are disabled for the flickable webview for now, since it would select text when panning, but after http://codereview.qt-project.org/21896 we can enable it again. For the record: the mentioned change was abandoned in favor of another one https://codereview.qt-project.org/#change,24189
Andras Becsi
Comment 7 2012-07-30 07:55:22 PDT
Created attachment 155290 [details] proposed patch
Andras Becsi
Comment 8 2012-07-30 08:23:49 PDT
(In reply to comment #7) > Created an attachment (id=155290) [details] > proposed patch Simon, is this similar to what you had in mind when we were discussing this issue?
Simon Hausmann
Comment 9 2012-08-02 05:03:01 PDT
Comment on attachment 155290 [details] proposed patch View in context: https://bugs.webkit.org/attachment.cgi?id=155290&action=review Looks good in general, a couple of small issues and questions :) > Source/WebKit2/UIProcess/qt/QtWebPageEventHandler.cpp:460 > + isMouseEvent = true; > case QEvent::TouchBegin: I think between those two lines we usually add a "// Fall through" comment, to indicate that the "fall through" is deliberate. > Source/WebKit2/UIProcess/qt/QtWebPageEventHandler.cpp:463 > + m_isMouseButtonPressed = true; Shouldn't this be set in QEvent::MouseButtonPress? > Source/WebKit2/UIProcess/qt/QtWebPageEventHandler.cpp:476 > + isMouseEvent = true; > case QEvent::TouchUpdate: Fall through comment. > Source/WebKit2/UIProcess/qt/QtWebPageEventHandler.cpp:483 > + isMouseEvent = true; > case QEvent::TouchEnd: And here :) > Source/WebKit2/UIProcess/qt/QtWebPageEventHandler.cpp:484 > + m_isMouseButtonPressed = false; Same question as above: Should this be in case QEvent::MouseButtonRelease? > Source/WebKit2/UIProcess/qt/QtWebPageEventHandler.cpp:515 > + currentTouchPoint.setId(mouseEvent->buttons()); Maybe worth a comment, it's easy to overlook this trick when glancing through the code :) > Source/WebKit2/UIProcess/qt/QtWebPageEventHandler.cpp:517 > + currentTouchPoint.setRect(QRectF(mouseEvent->localPos(), QSizeF(40, 40))); Hm, why 40, 40 instead of 1, 1?
Andras Becsi
Comment 10 2012-08-02 07:20:31 PDT
Created attachment 156077 [details] proposed patch
Simon Hausmann
Comment 11 2012-08-02 07:38:50 PDT
Comment on attachment 156077 [details] proposed patch r=me nice :)
Andras Becsi
Comment 12 2012-08-02 07:42:44 PDT
Comment on attachment 156077 [details] proposed patch Clearing flags on attachment: 156077 Committed r124455: <http://trac.webkit.org/changeset/124455>
Andras Becsi
Comment 13 2012-08-02 07:42:51 PDT
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.