Bug 111430 - [Qt][MiniBrowser] Touch mocking broken for chained getures
Summary: [Qt][MiniBrowser] Touch mocking broken for chained getures
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Andras Becsi
URL:
Keywords:
Depends on: 111429
Blocks:
  Show dependency treegraph
 
Reported: 2013-03-05 05:56 PST by Andras Becsi
Modified: 2013-03-06 06:10 PST (History)
1 user (show)

See Also:


Attachments
Patch (3.80 KB, patch)
2013-03-05 05:57 PST, Andras Becsi
no flags Details | Formatted Diff | Diff
Patch (2.48 KB, patch)
2013-03-05 07:25 PST, Andras Becsi
no flags Details | Formatted Diff | Diff
Patch (3.15 KB, patch)
2013-03-05 07:45 PST, Andras Becsi
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Andras Becsi 2013-03-05 05:56:17 PST
[Qt][MiniBrowser] Touch mocking broken for chained getures
Comment 1 Andras Becsi 2013-03-05 05:57:24 PST
Created attachment 191479 [details]
Patch
Comment 2 Jocelyn Turcotte 2013-03-05 07:05:16 PST
Comment on attachment 191479 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=191479&action=review

> Tools/MiniBrowser/qt/MiniBrowserApplication.cpp:134
> +        QSet<int> currentlyHeldTouchPoints;

Could you do it the other way?
- if (m_touchPoints.contains(id) && !m_pressedMouseButtons.testFlag(Qt::MouseButton(id))) { ...; m_heldTouchPoints.remove(id); }
- Remove the call to m_heldTouchPoints.clear();

> Tools/MiniBrowser/qt/MiniBrowserApplication.cpp:137
> +            if (m_touchPoints.contains(id) && !m_pressedMouseButtons.testFlag(Qt::MouseButton(id)))

Did you try with QGuiApplication::mouseButtons()?
I know at some point it wasn't working well, but if it does it would be cleaner.
Comment 3 Jocelyn Turcotte 2013-03-05 07:06:02 PST
(In reply to comment #2)
> Did you try with QGuiApplication::mouseButtons()?
> I know at some point it wasn't working well, but if it does it would be cleaner.

At least on Mac I recall it not working well pre 5.0.0
Comment 4 Andras Becsi 2013-03-05 07:25:10 PST
Created attachment 191495 [details]
Patch
Comment 5 Andras Becsi 2013-03-05 07:36:57 PST
(In reply to comment #3)
> (In reply to comment #2)
> > Did you try with QGuiApplication::mouseButtons()?
> > I know at some point it wasn't working well, but if it does it would be cleaner.
> 
> At least on Mac I recall it not working well pre 5.0.0
It works on Linux, I didn't test it on Mac, but from looking at the code in qguiapplication it should work on Mac too.
Comment 6 Andras Becsi 2013-03-05 07:45:28 PST
Created attachment 191496 [details]
Patch
Comment 7 Andras Becsi 2013-03-05 07:47:19 PST
(In reply to comment #6)
> Created an attachment (id=191496) [details]
> Patch

Also updated to use QGuiApplication::keyboardModifiers() for m_holdingControl, since it works now in Qt5.
Comment 8 Jocelyn Turcotte 2013-03-05 08:05:45 PST
Comment on attachment 191496 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=191496&action=review

r=me

> Tools/MiniBrowser/qt/MiniBrowserApplication.cpp:113
> +    m_holdingControl = QGuiApplication::keyboardModifiers().testFlag(Qt::ControlModifier);

Nit: could be worth mentioning in the ChangeLog
Comment 9 Andras Becsi 2013-03-06 06:08:48 PST
Committed r144915: <http://trac.webkit.org/changeset/144915>