Merge lp:~lukas-kde/qtmir/wheelEvent into lp:qtmir
- wheelEvent
- Merge into trunk
Status: | Merged | ||||
---|---|---|---|---|---|
Approved by: | Gerry Boland | ||||
Approved revision: | 389 | ||||
Merged at revision: | 396 | ||||
Proposed branch: | lp:~lukas-kde/qtmir/wheelEvent | ||||
Merge into: | lp:qtmir | ||||
Prerequisite: | lp:~unity-team/qtmir/touch_tracing | ||||
Diff against target: |
268 lines (+111/-17) 8 files modified
src/modules/Unity/Application/mirsurface.cpp (+38/-8) src/modules/Unity/Application/mirsurface.h (+1/-0) src/modules/Unity/Application/mirsurfaceinterface.h (+1/-0) src/modules/Unity/Application/mirsurfaceitem.cpp (+5/-1) src/platforms/mirserver/qteventfeeder.cpp (+54/-7) src/platforms/mirserver/qteventfeeder.h (+6/-0) tests/mirserver/QtEventFeeder/mock_qtwindowsystem.h (+5/-1) tests/modules/common/fake_mirsurface.h (+1/-0) |
||||
To merge this branch: | bzr merge lp:~lukas-kde/qtmir/wheelEvent | ||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Daniel d'Andrada (community) | Abstain | ||
Gerry Boland (community) | Approve | ||
PS Jenkins bot (community) | continuous-integration | Needs Fixing | |
Review via email: mp+274313@code.launchpad.net |
This proposal supersedes a proposal from 2015-10-01.
Commit message
Implement support for mouse wheel events; correctly pass around buttons
Description of the change
Implement support for mouse wheel events; also correctly pass around buttons
Cf. https:/
* Are there any related MPs required for this MP to build/function as expected? Please list.
https:/
* 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?
Yes
* If you changed the UI, has there been a design review?
N/A
PS Jenkins bot (ps-jenkins) wrote : Posted in a previous version of this proposal | # |
Daniel d'Andrada (dandrader) wrote : Posted in a previous version of this proposal | # |
"""
-pkg_check_
+pkg_check_
"""
The unity-api versioning scheme is made so that qtmir and unity8 depend on a *specific* version of the API. That's meant solely ensure that qtmir and unity8 are kept in sync. There's absolutely no guarantee (or effort to towards it) that a given version is backward or forward compatible.
Lukáš Tinkl (lukas-kde) wrote : Posted in a previous version of this proposal | # |
> """
> -pkg_check_
> +pkg_check_
> """
>
> The unity-api versioning scheme is made so that qtmir and unity8 depend on a
> *specific* version of the API. That's meant solely ensure that qtmir and
> unity8 are kept in sync. There's absolutely no guarantee (or effort to towards
> it) that a given version is backward or forward compatible.
Got it, fixed
PS Jenkins bot (ps-jenkins) wrote : Posted in a previous version of this proposal | # |
PASSED: Continuous integration, rev:384
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
Daniel d'Andrada (dandrader) wrote : Posted in a previous version of this proposal | # |
Could you please move "getMirButtonsF
The mir::events:
Lukáš Tinkl (lukas-kde) wrote : Posted in a previous version of this proposal | # |
> Could you please move "getMirButtonsF
> separate variable like it's being done for timestamp and modifiers?
>
> The mir::events:
> number of parameters. Using those helper variables improve readability and I
> think won't impact performance as I bet they will be optimized away by the
> compiler.
Done
PS Jenkins bot (ps-jenkins) wrote : Posted in a previous version of this proposal | # |
PASSED: Continuous integration, rev:385
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
Daniel d'Andrada (dandrader) wrote : Posted in a previous version of this proposal | # |
the handleWheelEvent() line in qteventfeeder.h is way too long. Please avoid going beyond 120 chars. It's our coding style (which, by the way, I couldn't find it right now).
That's the last nitpick I have with this MP. :)
Lukáš Tinkl (lukas-kde) wrote : Posted in a previous version of this proposal | # |
> the handleWheelEvent() line in qteventfeeder.h is way too long. Please avoid
> going beyond 120 chars. It's our coding style (which, by the way, I couldn't
> find it right now).
>
> That's the last nitpick I have with this MP. :)
Fixed
PS Jenkins bot (ps-jenkins) wrote : Posted in a previous version of this proposal | # |
PASSED: Continuous integration, rev:386
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
Daniel d'Andrada (dandrader) wrote : Posted in a previous version of this proposal | # |
> > the handleWheelEvent() line in qteventfeeder.h is way too long. Please avoid
> > going beyond 120 chars. It's our coding style (which, by the way, I couldn't
> > find it right now).
> >
> > That's the last nitpick I have with this MP. :)
>
> Fixed
Thanks!
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:388
http://
Executed test runs:
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
Click here to trigger a rebuild:
http://
- 389. By Lukáš Tinkl
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:389
http://
Executed test runs:
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
Click here to trigger a rebuild:
http://
Daniel d'Andrada (dandrader) : | # |
Preview Diff
1 | === modified file 'src/modules/Unity/Application/mirsurface.cpp' | |||
2 | --- src/modules/Unity/Application/mirsurface.cpp 2015-10-14 13:36:55 +0000 | |||
3 | +++ src/modules/Unity/Application/mirsurface.cpp 2015-10-14 13:36:55 +0000 | |||
4 | @@ -50,18 +50,29 @@ | |||
5 | 50 | return m_mods; | 50 | return m_mods; |
6 | 51 | } | 51 | } |
7 | 52 | 52 | ||
8 | 53 | MirPointerButtons | ||
9 | 54 | getMirButtonsFromQt(Qt::MouseButtons buttons) | ||
10 | 55 | { | ||
11 | 56 | MirPointerButtons result = 0; | ||
12 | 57 | if (buttons & Qt::LeftButton) | ||
13 | 58 | result |= mir_pointer_button_primary; | ||
14 | 59 | if (buttons & Qt::RightButton) | ||
15 | 60 | result |= mir_pointer_button_secondary; | ||
16 | 61 | if (buttons & Qt::MiddleButton) | ||
17 | 62 | result |= mir_pointer_button_tertiary; | ||
18 | 63 | if (buttons & Qt::BackButton) | ||
19 | 64 | result |= mir_pointer_button_back; | ||
20 | 65 | if (buttons & Qt::ForwardButton) | ||
21 | 66 | result |= mir_pointer_button_forward; | ||
22 | 67 | |||
23 | 68 | return result; | ||
24 | 69 | } | ||
25 | 70 | |||
26 | 53 | mir::EventUPtr makeMirEvent(QMouseEvent *qtEvent, MirPointerAction action) | 71 | mir::EventUPtr makeMirEvent(QMouseEvent *qtEvent, MirPointerAction action) |
27 | 54 | { | 72 | { |
28 | 55 | auto timestamp = uncompressTimestamp<ulong>(qtEvent->timestamp()); | 73 | auto timestamp = uncompressTimestamp<ulong>(qtEvent->timestamp()); |
29 | 56 | auto modifiers = getMirModifiersFromQt(qtEvent->modifiers()); | 74 | auto modifiers = getMirModifiersFromQt(qtEvent->modifiers()); |
38 | 57 | 75 | auto buttons = getMirButtonsFromQt(qtEvent->buttons()); | |
31 | 58 | MirPointerButtons buttons = 0; | ||
32 | 59 | if (qtEvent->buttons() & Qt::LeftButton) | ||
33 | 60 | buttons |= mir_pointer_button_primary; | ||
34 | 61 | if (qtEvent->buttons() & Qt::RightButton) | ||
35 | 62 | buttons |= mir_pointer_button_secondary; | ||
36 | 63 | if (qtEvent->buttons() & Qt::MidButton) | ||
37 | 64 | buttons |= mir_pointer_button_tertiary; | ||
39 | 65 | 76 | ||
40 | 66 | return mir::events::make_event(0 /*DeviceID */, timestamp, 0 /* mac */, modifiers, action, | 77 | return mir::events::make_event(0 /*DeviceID */, timestamp, 0 /* mac */, modifiers, action, |
41 | 67 | buttons, qtEvent->x(), qtEvent->y(), 0, 0, 0, 0); | 78 | buttons, qtEvent->x(), qtEvent->y(), 0, 0, 0, 0); |
42 | @@ -77,6 +88,18 @@ | |||
43 | 77 | buttons, qtEvent->posF().x(), qtEvent->posF().y(), 0, 0, 0, 0); | 88 | buttons, qtEvent->posF().x(), qtEvent->posF().y(), 0, 0, 0, 0); |
44 | 78 | } | 89 | } |
45 | 79 | 90 | ||
46 | 91 | mir::EventUPtr makeMirEvent(QWheelEvent *qtEvent) | ||
47 | 92 | { | ||
48 | 93 | auto timestamp = std::chrono::duration_cast<std::chrono::nanoseconds>(std::chrono::milliseconds(qtEvent->timestamp())); | ||
49 | 94 | auto modifiers = getMirModifiersFromQt(qtEvent->modifiers()); | ||
50 | 95 | auto buttons = getMirButtonsFromQt(qtEvent->buttons()); | ||
51 | 96 | |||
52 | 97 | return mir::events::make_event(0 /*DeviceID */, timestamp, 0 /* mac */, modifiers, mir_pointer_action_motion, | ||
53 | 98 | buttons, qtEvent->x(), qtEvent->y(), | ||
54 | 99 | qtEvent->angleDelta().x(), qtEvent->angleDelta().y(), | ||
55 | 100 | 0, 0); | ||
56 | 101 | } | ||
57 | 102 | |||
58 | 80 | mir::EventUPtr makeMirEvent(QKeyEvent *qtEvent) | 103 | mir::EventUPtr makeMirEvent(QKeyEvent *qtEvent) |
59 | 81 | { | 104 | { |
60 | 82 | MirKeyboardAction action = mir_keyboard_action_down; | 105 | MirKeyboardAction action = mir_keyboard_action_down; |
61 | @@ -574,6 +597,13 @@ | |||
62 | 574 | event->accept(); | 597 | event->accept(); |
63 | 575 | } | 598 | } |
64 | 576 | 599 | ||
65 | 600 | void MirSurface::wheelEvent(QWheelEvent *event) | ||
66 | 601 | { | ||
67 | 602 | auto ev = makeMirEvent(event); | ||
68 | 603 | m_surface->consume(*ev); | ||
69 | 604 | event->accept(); | ||
70 | 605 | } | ||
71 | 606 | |||
72 | 577 | void MirSurface::keyPressEvent(QKeyEvent *qtEvent) | 607 | void MirSurface::keyPressEvent(QKeyEvent *qtEvent) |
73 | 578 | { | 608 | { |
74 | 579 | auto ev = makeMirEvent(qtEvent); | 609 | auto ev = makeMirEvent(qtEvent); |
75 | 580 | 610 | ||
76 | === modified file 'src/modules/Unity/Application/mirsurface.h' | |||
77 | --- src/modules/Unity/Application/mirsurface.h 2015-10-14 13:36:55 +0000 | |||
78 | +++ src/modules/Unity/Application/mirsurface.h 2015-10-14 13:36:55 +0000 | |||
79 | @@ -100,6 +100,7 @@ | |||
80 | 100 | void hoverEnterEvent(QHoverEvent *event) override; | 100 | void hoverEnterEvent(QHoverEvent *event) override; |
81 | 101 | void hoverLeaveEvent(QHoverEvent *event) override; | 101 | void hoverLeaveEvent(QHoverEvent *event) override; |
82 | 102 | void hoverMoveEvent(QHoverEvent *event) override; | 102 | void hoverMoveEvent(QHoverEvent *event) override; |
83 | 103 | void wheelEvent(QWheelEvent *event) override; | ||
84 | 103 | 104 | ||
85 | 104 | void keyPressEvent(QKeyEvent *event) override; | 105 | void keyPressEvent(QKeyEvent *event) override; |
86 | 105 | void keyReleaseEvent(QKeyEvent *event) override; | 106 | void keyReleaseEvent(QKeyEvent *event) override; |
87 | 106 | 107 | ||
88 | === modified file 'src/modules/Unity/Application/mirsurfaceinterface.h' | |||
89 | --- src/modules/Unity/Application/mirsurfaceinterface.h 2015-10-14 13:36:55 +0000 | |||
90 | +++ src/modules/Unity/Application/mirsurfaceinterface.h 2015-10-14 13:36:55 +0000 | |||
91 | @@ -67,6 +67,7 @@ | |||
92 | 67 | virtual void hoverEnterEvent(QHoverEvent *event) = 0; | 67 | virtual void hoverEnterEvent(QHoverEvent *event) = 0; |
93 | 68 | virtual void hoverLeaveEvent(QHoverEvent *event) = 0; | 68 | virtual void hoverLeaveEvent(QHoverEvent *event) = 0; |
94 | 69 | virtual void hoverMoveEvent(QHoverEvent *event) = 0; | 69 | virtual void hoverMoveEvent(QHoverEvent *event) = 0; |
95 | 70 | virtual void wheelEvent(QWheelEvent *event) = 0; | ||
96 | 70 | 71 | ||
97 | 71 | virtual void keyPressEvent(QKeyEvent *event) = 0; | 72 | virtual void keyPressEvent(QKeyEvent *event) = 0; |
98 | 72 | virtual void keyReleaseEvent(QKeyEvent *event) = 0; | 73 | virtual void keyReleaseEvent(QKeyEvent *event) = 0; |
99 | 73 | 74 | ||
100 | === modified file 'src/modules/Unity/Application/mirsurfaceitem.cpp' | |||
101 | --- src/modules/Unity/Application/mirsurfaceitem.cpp 2015-10-14 13:36:55 +0000 | |||
102 | +++ src/modules/Unity/Application/mirsurfaceitem.cpp 2015-10-14 13:36:55 +0000 | |||
103 | @@ -298,7 +298,11 @@ | |||
104 | 298 | 298 | ||
105 | 299 | void MirSurfaceItem::wheelEvent(QWheelEvent *event) | 299 | void MirSurfaceItem::wheelEvent(QWheelEvent *event) |
106 | 300 | { | 300 | { |
108 | 301 | Q_UNUSED(event); | 301 | if (m_consumesInput && m_surface && m_surface->live()) { |
109 | 302 | m_surface->wheelEvent(event); | ||
110 | 303 | } else { | ||
111 | 304 | event->ignore(); | ||
112 | 305 | } | ||
113 | 302 | } | 306 | } |
114 | 303 | 307 | ||
115 | 304 | void MirSurfaceItem::hoverEnterEvent(QHoverEvent *event) | 308 | void MirSurfaceItem::hoverEnterEvent(QHoverEvent *event) |
116 | 305 | 309 | ||
117 | === modified file 'src/platforms/mirserver/qteventfeeder.cpp' | |||
118 | --- src/platforms/mirserver/qteventfeeder.cpp 2015-10-14 13:36:55 +0000 | |||
119 | +++ src/platforms/mirserver/qteventfeeder.cpp 2015-10-14 13:36:55 +0000 | |||
120 | @@ -416,7 +416,8 @@ | |||
121 | 416 | QWindowSystemInterface::handleTouchEvent(window, timestamp, device, points, mods); | 416 | QWindowSystemInterface::handleTouchEvent(window, timestamp, device, points, mods); |
122 | 417 | } | 417 | } |
123 | 418 | 418 | ||
125 | 419 | void handleMouseEvent(ulong timestamp, QPointF movement, Qt::MouseButtons buttons, Qt::KeyboardModifiers modifiers) override | 419 | void handleMouseEvent(ulong timestamp, QPointF movement, Qt::MouseButtons buttons, |
126 | 420 | Qt::KeyboardModifiers modifiers) override | ||
127 | 420 | { | 421 | { |
128 | 421 | // Send to the first screen that handles the mouse event | 422 | // Send to the first screen that handles the mouse event |
129 | 422 | // TODO: Have a mechanism to tell which screen currently has the logical mouse pointer | 423 | // TODO: Have a mechanism to tell which screen currently has the logical mouse pointer |
130 | @@ -434,6 +435,25 @@ | |||
131 | 434 | } | 435 | } |
132 | 435 | } | 436 | } |
133 | 436 | 437 | ||
134 | 438 | void handleWheelEvent(ulong timestamp, const QPointF &localPoint, const QPointF &globalPoint, | ||
135 | 439 | QPoint pixelDelta, QPoint angleDelta, | ||
136 | 440 | Qt::KeyboardModifiers mods, Qt::ScrollPhase phase) override | ||
137 | 441 | { | ||
138 | 442 | QWindowSystemInterface::handleWheelEvent(m_screenController->getWindowForPoint(localPoint.toPoint()), | ||
139 | 443 | timestamp, localPoint, globalPoint, | ||
140 | 444 | pixelDelta, angleDelta, mods, phase); | ||
141 | 445 | } | ||
142 | 446 | |||
143 | 447 | void handleEnterEvent(const QPointF &localPoint, const QPointF &globalPoint) override | ||
144 | 448 | { | ||
145 | 449 | QWindowSystemInterface::handleEnterEvent(m_screenController->getWindowForPoint(localPoint.toPoint()), localPoint, globalPoint); | ||
146 | 450 | } | ||
147 | 451 | |||
148 | 452 | void handleLeaveEvent(const QPointF &localPoint) override | ||
149 | 453 | { | ||
150 | 454 | QWindowSystemInterface::handleLeaveEvent(m_screenController->getWindowForPoint(localPoint.toPoint())); | ||
151 | 455 | } | ||
152 | 456 | |||
153 | 437 | private: | 457 | private: |
154 | 438 | QSharedPointer<ScreenController> m_screenController; | 458 | QSharedPointer<ScreenController> m_screenController; |
155 | 439 | }; | 459 | }; |
156 | @@ -496,7 +516,7 @@ | |||
157 | 496 | 516 | ||
158 | 497 | Qt::KeyboardModifiers getQtModifiersFromMir(MirInputEventModifiers modifiers) | 517 | Qt::KeyboardModifiers getQtModifiersFromMir(MirInputEventModifiers modifiers) |
159 | 498 | { | 518 | { |
161 | 499 | int qtModifiers = Qt::NoModifier; | 519 | Qt::KeyboardModifiers qtModifiers = Qt::NoModifier; |
162 | 500 | if (modifiers & mir_input_event_modifier_shift) { | 520 | if (modifiers & mir_input_event_modifier_shift) { |
163 | 501 | qtModifiers |= Qt::ShiftModifier; | 521 | qtModifiers |= Qt::ShiftModifier; |
164 | 502 | } | 522 | } |
165 | @@ -509,7 +529,7 @@ | |||
166 | 509 | if (modifiers & mir_input_event_modifier_meta) { | 529 | if (modifiers & mir_input_event_modifier_meta) { |
167 | 510 | qtModifiers |= Qt::MetaModifier; | 530 | qtModifiers |= Qt::MetaModifier; |
168 | 511 | } | 531 | } |
170 | 512 | return static_cast<Qt::KeyboardModifiers>(qtModifiers); | 532 | return qtModifiers; |
171 | 513 | } | 533 | } |
172 | 514 | 534 | ||
173 | 515 | Qt::MouseButtons getQtMouseButtonsfromMirPointerEvent(MirPointerEvent const* pev) | 535 | Qt::MouseButtons getQtMouseButtonsfromMirPointerEvent(MirPointerEvent const* pev) |
174 | @@ -533,17 +553,44 @@ | |||
175 | 533 | void QtEventFeeder::dispatchPointer(MirInputEvent const* ev) | 553 | void QtEventFeeder::dispatchPointer(MirInputEvent const* ev) |
176 | 534 | { | 554 | { |
177 | 535 | auto timestamp = qtmir::compressTimestamp<ulong>(std::chrono::nanoseconds(mir_input_event_get_event_time(ev))); | 555 | auto timestamp = qtmir::compressTimestamp<ulong>(std::chrono::nanoseconds(mir_input_event_get_event_time(ev))); |
178 | 536 | |||
179 | 537 | auto pev = mir_input_event_get_pointer_event(ev); | 556 | auto pev = mir_input_event_get_pointer_event(ev); |
180 | 557 | auto action = mir_pointer_event_action(pev); | ||
181 | 538 | qCDebug(QTMIR_MIR_INPUT) << "Received" << qPrintable(mirPointerEventToString(pev)); | 558 | qCDebug(QTMIR_MIR_INPUT) << "Received" << qPrintable(mirPointerEventToString(pev)); |
182 | 539 | 559 | ||
183 | 540 | auto modifiers = getQtModifiersFromMir(mir_pointer_event_modifiers(pev)); | 560 | auto modifiers = getQtModifiersFromMir(mir_pointer_event_modifiers(pev)); |
184 | 541 | auto buttons = getQtMouseButtonsfromMirPointerEvent(pev); | ||
185 | 542 | 561 | ||
186 | 543 | auto movement = QPointF(mir_pointer_event_axis_value(pev, mir_pointer_axis_relative_x), | 562 | auto movement = QPointF(mir_pointer_event_axis_value(pev, mir_pointer_axis_relative_x), |
187 | 544 | mir_pointer_event_axis_value(pev, mir_pointer_axis_relative_y)); | 563 | mir_pointer_event_axis_value(pev, mir_pointer_axis_relative_y)); |
190 | 545 | 564 | auto local_point = QPointF(mir_pointer_event_axis_value(pev, mir_pointer_axis_x), | |
191 | 546 | mQtWindowSystem->handleMouseEvent(timestamp, movement, buttons, modifiers); | 565 | mir_pointer_event_axis_value(pev, mir_pointer_axis_y)); |
192 | 566 | |||
193 | 567 | switch (action) { | ||
194 | 568 | case mir_pointer_action_button_up: | ||
195 | 569 | case mir_pointer_action_button_down: | ||
196 | 570 | case mir_pointer_action_motion: | ||
197 | 571 | { | ||
198 | 572 | const float hDelta = mir_pointer_event_axis_value(pev, mir_pointer_axis_hscroll); | ||
199 | 573 | const float vDelta = mir_pointer_event_axis_value(pev, mir_pointer_axis_vscroll); | ||
200 | 574 | |||
201 | 575 | if (hDelta != 0 || vDelta != 0) { | ||
202 | 576 | const QPoint angleDelta = QPoint(hDelta * 15, vDelta * 15); | ||
203 | 577 | mQtWindowSystem->handleWheelEvent(timestamp, local_point, local_point, | ||
204 | 578 | QPoint(), angleDelta, modifiers, Qt::ScrollUpdate); | ||
205 | 579 | } else { | ||
206 | 580 | auto buttons = getQtMouseButtonsfromMirPointerEvent(pev); | ||
207 | 581 | mQtWindowSystem->handleMouseEvent(timestamp, movement, buttons, modifiers); | ||
208 | 582 | } | ||
209 | 583 | break; | ||
210 | 584 | } | ||
211 | 585 | case mir_pointer_action_enter: | ||
212 | 586 | mQtWindowSystem->handleEnterEvent(local_point, local_point); | ||
213 | 587 | break; | ||
214 | 588 | case mir_pointer_action_leave: | ||
215 | 589 | mQtWindowSystem->handleLeaveEvent(local_point); | ||
216 | 590 | break; | ||
217 | 591 | default: | ||
218 | 592 | qCDebug(QTMIR_MIR_INPUT) << "Unrecognized pointer event"; | ||
219 | 593 | } | ||
220 | 547 | } | 594 | } |
221 | 548 | 595 | ||
222 | 549 | void QtEventFeeder::dispatchKey(MirInputEvent const* event) | 596 | void QtEventFeeder::dispatchKey(MirInputEvent const* event) |
223 | 550 | 597 | ||
224 | === modified file 'src/platforms/mirserver/qteventfeeder.h' | |||
225 | --- src/platforms/mirserver/qteventfeeder.h 2015-10-14 13:36:55 +0000 | |||
226 | +++ src/platforms/mirserver/qteventfeeder.h 2015-10-14 13:36:55 +0000 | |||
227 | @@ -52,6 +52,12 @@ | |||
228 | 52 | Qt::KeyboardModifiers mods = Qt::NoModifier) = 0; | 52 | Qt::KeyboardModifiers mods = Qt::NoModifier) = 0; |
229 | 53 | virtual void handleMouseEvent(ulong timestamp, QPointF movement, Qt::MouseButtons buttons, | 53 | virtual void handleMouseEvent(ulong timestamp, QPointF movement, Qt::MouseButtons buttons, |
230 | 54 | Qt::KeyboardModifiers modifiers) = 0; | 54 | Qt::KeyboardModifiers modifiers) = 0; |
231 | 55 | virtual void handleWheelEvent(ulong timestamp, const QPointF &localPoint, const QPointF &globalPoint, | ||
232 | 56 | QPoint pixelDelta, QPoint angleDelta, | ||
233 | 57 | Qt::KeyboardModifiers mods = Qt::NoModifier, | ||
234 | 58 | Qt::ScrollPhase phase = Qt::ScrollUpdate) = 0; | ||
235 | 59 | virtual void handleEnterEvent(const QPointF &localPoint = QPointF(), const QPointF &globalPoint = QPointF()) = 0; | ||
236 | 60 | virtual void handleLeaveEvent(const QPointF &localPoint = QPointF()) = 0; | ||
237 | 55 | }; | 61 | }; |
238 | 56 | 62 | ||
239 | 57 | QtEventFeeder(const QSharedPointer<ScreenController> &screenController); | 63 | QtEventFeeder(const QSharedPointer<ScreenController> &screenController); |
240 | 58 | 64 | ||
241 | === modified file 'tests/mirserver/QtEventFeeder/mock_qtwindowsystem.h' | |||
242 | --- tests/mirserver/QtEventFeeder/mock_qtwindowsystem.h 2015-10-14 13:36:55 +0000 | |||
243 | +++ tests/mirserver/QtEventFeeder/mock_qtwindowsystem.h 2015-10-14 13:36:55 +0000 | |||
244 | @@ -41,7 +41,11 @@ | |||
245 | 41 | MOCK_METHOD5(handleTouchEvent, void(QWindow *window, ulong timestamp, QTouchDevice *device, | 41 | MOCK_METHOD5(handleTouchEvent, void(QWindow *window, ulong timestamp, QTouchDevice *device, |
246 | 42 | const QList<struct QWindowSystemInterface::TouchPoint> &points, | 42 | const QList<struct QWindowSystemInterface::TouchPoint> &points, |
247 | 43 | Qt::KeyboardModifiers mods)); | 43 | Qt::KeyboardModifiers mods)); |
249 | 44 | MOCK_METHOD4(handleMouseEvent, void(ulong, QPointF, Qt::MouseButtons, Qt::KeyboardModifiers)); | 44 | MOCK_METHOD4(handleMouseEvent, void(ulong timestamp, QPointF point, Qt::MouseButtons buttons, Qt::KeyboardModifiers modifiers)); |
250 | 45 | MOCK_METHOD7(handleWheelEvent, void(ulong timestamp, const QPointF & local, const QPointF & global, QPoint pixelDelta, QPoint angleDelta, | ||
251 | 46 | Qt::KeyboardModifiers mods, Qt::ScrollPhase phase)); | ||
252 | 47 | MOCK_METHOD2(handleEnterEvent, void(const QPointF &localPoint, const QPointF& globalPoint)); | ||
253 | 48 | MOCK_METHOD1(handleLeaveEvent, void(const QPointF &localPoint)); | ||
254 | 45 | }; | 49 | }; |
255 | 46 | 50 | ||
256 | 47 | namespace testing | 51 | namespace testing |
257 | 48 | 52 | ||
258 | === modified file 'tests/modules/common/fake_mirsurface.h' | |||
259 | --- tests/modules/common/fake_mirsurface.h 2015-10-14 13:36:55 +0000 | |||
260 | +++ tests/modules/common/fake_mirsurface.h 2015-10-14 13:36:55 +0000 | |||
261 | @@ -146,6 +146,7 @@ | |||
262 | 146 | void hoverEnterEvent(QHoverEvent *) override {} | 146 | void hoverEnterEvent(QHoverEvent *) override {} |
263 | 147 | void hoverLeaveEvent(QHoverEvent *) override {} | 147 | void hoverLeaveEvent(QHoverEvent *) override {} |
264 | 148 | void hoverMoveEvent(QHoverEvent *) override {} | 148 | void hoverMoveEvent(QHoverEvent *) override {} |
265 | 149 | void wheelEvent(QWheelEvent *) override {} | ||
266 | 149 | 150 | ||
267 | 150 | void keyPressEvent(QKeyEvent *) override {} | 151 | void keyPressEvent(QKeyEvent *) override {} |
268 | 151 | void keyReleaseEvent(QKeyEvent *) override {} | 152 | void keyReleaseEvent(QKeyEvent *) override {} |
PASSED: Continuous integration, rev:383 jenkins. qa.ubuntu. com/job/ qtmir-ci/ 475/ jenkins. qa.ubuntu. com/job/ qtmir-vivid- amd64-ci/ 171 jenkins. qa.ubuntu. com/job/ qtmir-vivid- armhf-ci/ 171 jenkins. qa.ubuntu. com/job/ qtmir-vivid- armhf-ci/ 171/artifact/ work/output/ *zip*/output. zip jenkins. qa.ubuntu. com/job/ qtmir-vivid- i386-ci/ 53 jenkins. qa.ubuntu. com/job/ qtmir-wily- amd64-ci/ 208 jenkins. qa.ubuntu. com/job/ qtmir-wily- armhf-ci/ 208 jenkins. qa.ubuntu. com/job/ qtmir-wily- armhf-ci/ 208/artifact/ work/output/ *zip*/output. zip jenkins. qa.ubuntu. com/job/ qtmir-wily- i386-ci/ 53
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild: s-jenkins. ubuntu- ci:8080/ job/qtmir- ci/475/ rebuild
http://