Merge lp:~lukas-kde/unity8/highdpi-mousetouchadaptor into lp:unity8

Proposed by Lukáš Tinkl
Status: Merged
Approved by: Michael Zanetti
Approved revision: 1800
Merged at revision: 1826
Proposed branch: lp:~lukas-kde/unity8/highdpi-mousetouchadaptor
Merge into: lp:unity8
Diff against target: 42 lines (+6/-6)
1 file modified
src/MouseTouchAdaptor.cpp (+6/-6)
To merge this branch: bzr merge lp:~lukas-kde/unity8/highdpi-mousetouchadaptor
Reviewer Review Type Date Requested Status
PS Jenkins bot (community) continuous-integration Approve
Michael Zanetti (community) Approve
Review via email: mp+261330@code.launchpad.net

Commit message

respect target window's devicePixelRatio in MouseTouchAdaptor

Description of the change

respect target window's devicePixelRatio in MouseTouchAdaptor

this fixes the mouse events for highdpi displays when using
QT_DEVICE_PIXEL_RATIO != 1

test with various QT_DEVICE_PIXEL_RATIO values (1,2,unset)

 * Are there any related MPs required for this MP to build/function as expected? Please list.

No

 * Did you perform an exploratory manual test run of your code change and any related functionality?

Yes

 * Did you make sure that your branch does not contain spurious tags?

Yes

 * If you changed the packaging (debian), did you subscribe the ubuntu-unity team to this MP?

N/A

 * If you changed the UI, has there been a design review?

N/A

 * Did you have a look at the warnings when running tests? Can they be reduced?

Yes

To post a comment you must log in.
Revision history for this message
Michael Zanetti (mzanetti) wrote :

looks good to me. Please put the checklist into the description ;)

review: Needs Information
Revision history for this message
Lukáš Tinkl (lukas-kde) wrote :

> looks good to me. Please put the checklist into the description ;)

Fixed, thanks for pointing out :)

Revision history for this message
Michael Zanetti (mzanetti) wrote :

 * Did you perform an exploratory manual test run of the code change and any related functionality?

yes!

 * Did CI run pass? If not, please explain why.

CI not running for this user yet. Will try to fix that.

 * Did you make sure that the branch does not contain spurious tags?

yes

review: Approve
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/MouseTouchAdaptor.cpp'
2--- src/MouseTouchAdaptor.cpp 2015-03-02 12:41:17 +0000
3+++ src/MouseTouchAdaptor.cpp 2015-06-07 15:01:04 +0000
4@@ -104,10 +104,10 @@
5 if (button != Qt::LeftButton)
6 return true;
7
8- QPoint windowPos(pressEvent->event_x, pressEvent->event_y);
9-
10 QWindow *targetWindow = findQWindowWithXWindowID(static_cast<WId>(pressEvent->event));
11
12+ QPoint windowPos(pressEvent->event_x / targetWindow->devicePixelRatio(), pressEvent->event_y / targetWindow->devicePixelRatio());
13+
14 QTouchEventSequence touchEvent = QTest::touchEvent(targetWindow, m_touchDevice,
15 false /* autoCommit */);
16 touchEvent.press(0 /* touchId */, windowPos);
17@@ -125,10 +125,10 @@
18 if (button != Qt::LeftButton)
19 return true;
20
21- QPoint windowPos(releaseEvent->event_x, releaseEvent->event_y);
22-
23 QWindow *targetWindow = findQWindowWithXWindowID(static_cast<WId>(releaseEvent->event));
24
25+ QPoint windowPos(releaseEvent->event_x / targetWindow->devicePixelRatio(), releaseEvent->event_y / targetWindow->devicePixelRatio());
26+
27 QTouchEventSequence touchEvent = QTest::touchEvent(targetWindow, m_touchDevice,
28 false /* autoCommit */);
29 touchEvent.release(0 /* touchId */, windowPos);
30@@ -144,10 +144,10 @@
31 return true;
32 }
33
34- QPoint windowPos(event->event_x, event->event_y);
35-
36 QWindow *targetWindow = findQWindowWithXWindowID(static_cast<WId>(event->event));
37
38+ QPoint windowPos(event->event_x / targetWindow->devicePixelRatio(), event->event_y / targetWindow->devicePixelRatio());
39+
40 QTouchEventSequence touchEvent = QTest::touchEvent(targetWindow, m_touchDevice,
41 false /* autoCommit */);
42 touchEvent.move(0 /* touchId */, windowPos);

Subscribers

People subscribed via source and target branches