Merge lp:~dandrader/unity8/mouseWheel into lp:unity8

Proposed by Daniel d'Andrada on 2015-11-19
Status: Merged
Approved by: Lukáš Tinkl on 2015-11-20
Approved revision: 2040
Merged at revision: 2067
Proposed branch: lp:~dandrader/unity8/mouseWheel
Merge into: lp:unity8
Diff against target: 77 lines (+16/-4)
4 files modified
CMakeLists.txt (+1/-1)
debian/control (+3/-3)
plugins/Cursor/MousePointer.cpp (+11/-0)
plugins/Cursor/MousePointer.h (+1/-0)
To merge this branch: bzr merge lp:~dandrader/unity8/mouseWheel
Reviewer Review Type Date Requested Status
Lukáš Tinkl (community) 2015-11-19 Approve on 2015-11-20
PS Jenkins bot continuous-integration Needs Fixing on 2015-11-19
Review via email: mp+278009@code.launchpad.net

Commit Message

Cursor plugin: add scroll wheel handling

Description of the Change

* Are there any related MPs required for this MP to build/function as expected? Please list.
https://code.launchpad.net/~dandrader/qtmir/fixWheel/+merge/278007
https://code.launchpad.net/~dandrader/unity-api/mouseWheel/+merge/278008

* 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?
Not applicable

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

To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'CMakeLists.txt'
2--- CMakeLists.txt 2015-11-04 14:57:54 +0000
3+++ CMakeLists.txt 2015-11-19 14:24:05 +0000
4@@ -57,7 +57,7 @@
5 find_package(Qt5Concurrent 5.4 REQUIRED)
6 find_package(Qt5Sql 5.4 REQUIRED)
7
8-pkg_check_modules(APPLICATION_API REQUIRED unity-shell-application=10)
9+pkg_check_modules(APPLICATION_API REQUIRED unity-shell-application=11)
10
11 # Standard install paths
12 include(GNUInstallDirs)
13
14=== modified file 'debian/control'
15--- debian/control 2015-11-04 14:58:05 +0000
16+++ debian/control 2015-11-19 14:24:05 +0000
17@@ -29,7 +29,7 @@
18 libqt5xmlpatterns5-dev,
19 libsystemsettings-dev,
20 libudev-dev,
21- libunity-api-dev (>= 7.102),
22+ libunity-api-dev (>= 7.103),
23 libusermetricsoutput1-dev,
24 libxcb1-dev,
25 pkg-config,
26@@ -128,7 +128,7 @@
27 qtdeclarative5-ubuntu-ui-toolkit-plugin (>= 1.3.1627) | qtdeclarative5-ubuntu-ui-toolkit-plugin-gles (>= 1.3.1627),
28 qtdeclarative5-unity-notifications-plugin (>= 0.1.2) | unity-notifications-impl,
29 ubuntu-thumbnailer-impl-0,
30- unity-application-impl-10,
31+ unity-application-impl-11,
32 unity-notifications-impl-3,
33 unity-plugin-scopes | unity-scopes-impl,
34 unity-scopes-impl-7,
35@@ -174,7 +174,7 @@
36 Depends: ${misc:Depends},
37 ${shlibs:Depends},
38 Provides: unity-application-impl,
39- unity-application-impl-10,
40+ unity-application-impl-11,
41 Replaces: unity8-autopilot (<< 8.02+15.04.20150422-0ubuntu1)
42 Description: Fake environment for running Unity 8 shell
43 Provides fake implementations of some QML modules used by Unity 8 shell
44
45=== modified file 'plugins/Cursor/MousePointer.cpp'
46--- plugins/Cursor/MousePointer.cpp 2015-10-21 16:16:37 +0000
47+++ plugins/Cursor/MousePointer.cpp 2015-11-19 14:24:05 +0000
48@@ -62,6 +62,17 @@
49 buttons, modifiers);
50 }
51
52+void MousePointer::handleWheelEvent(ulong timestamp, QPoint angleDelta, Qt::KeyboardModifiers modifiers)
53+{
54+ if (!parentItem()) {
55+ return;
56+ }
57+
58+ QPointF scenePosition = mapToItem(nullptr, QPointF(0, 0));
59+ QWindowSystemInterface::handleWheelEvent(window(), timestamp, scenePosition /* local */, scenePosition /* global */,
60+ QPoint() /* pixelDelta */, angleDelta, modifiers, Qt::ScrollUpdate);
61+}
62+
63 void MousePointer::itemChange(ItemChange change, const ItemChangeData &value)
64 {
65 if (change == ItemSceneChange) {
66
67=== modified file 'plugins/Cursor/MousePointer.h'
68--- plugins/Cursor/MousePointer.h 2015-10-21 16:16:37 +0000
69+++ plugins/Cursor/MousePointer.h 2015-11-19 14:24:05 +0000
70@@ -41,6 +41,7 @@
71 public Q_SLOTS:
72 void handleMouseEvent(ulong timestamp, QPointF movement, Qt::MouseButtons buttons,
73 Qt::KeyboardModifiers modifiers) override;
74+ void handleWheelEvent(ulong timestamp, QPoint angleDelta, Qt::KeyboardModifiers modifiers) override;
75
76 protected:
77 void itemChange(ItemChange change, const ItemChangeData &value) override;

Subscribers

People subscribed via source and target branches