Merge lp:~unity-team/qtmir/cursorConfinement into lp:qtmir
- cursorConfinement
- Merge into trunk
Status: | Merged |
---|---|
Approved by: | Lukáš Tinkl |
Approved revision: | no longer in the source branch. |
Merged at revision: | 564 |
Proposed branch: | lp:~unity-team/qtmir/cursorConfinement |
Merge into: | lp:qtmir |
Prerequisite: | lp:~unity-team/qtmir/mouseMovement |
Diff against target: |
144 lines (+22/-5) 9 files modified
CMakeLists.txt (+1/-1) debian/control (+2/-2) debian/gles-patches/convert-to-gles.patch (+1/-1) src/modules/Unity/Application/mirsurface.cpp (+6/-0) src/modules/Unity/Application/mirsurface.h (+2/-0) src/platforms/mirserver/mirwindowmanager.cpp (+5/-1) src/platforms/mirserver/surfaceobserver.cpp (+3/-0) src/platforms/mirserver/surfaceobserver.h (+1/-0) tests/framework/fake_mirsurface.h (+1/-0) |
To merge this branch: | bzr merge lp:~unity-team/qtmir/cursorConfinement |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Unity8 CI Bot (community) | continuous-integration | Needs Fixing | |
Lukáš Tinkl (community) | Approve | ||
Review via email: mp+305212@code.launchpad.net |
This proposal supersedes a proposal from 2016-09-07.
Commit message
Implement cursor confinement
Description of the change
* Are there any related MPs required for this MP to build/function as expected? Please list.
https:/
https:/
* Did you perform an exploratory manual test run of your code change and any related functionality?
Yes
* If you changed the packaging (debian), did you subscribe the ubuntu-unity team to this MP?
Not applicable
Unity8 CI Bot (unity8-ci-bot) wrote : Posted in a previous version of this proposal | # |
Lukáš Tinkl (lukas-kde) wrote : Posted in a previous version of this proposal | # |
+#include "mirwindowmanag
Do we need to include the MOC files, are they not generated automatically?
---
Otherwise code looks good, didn't test yet though.
Daniel d'Andrada (dandrader) wrote : Posted in a previous version of this proposal | # |
On 26/08/2016 11:17, Lukáš Tinkl wrote:
> Review: Needs Information
>
> +#include "mirwindowmanag
>
> Do we need to include the MOC files, are they not generated automatically?
This is needed when you define a class containing a Q_OBJECT macro
inside a .cpp file. Otherwise compilation will fail with:
"""
AUTOGEN: error:
/home/dandrader
The file contains a Q_OBJECT macro, but does not include
"mirwindowmanag
"""
Lukáš Tinkl (lukas-kde) wrote : Posted in a previous version of this proposal | # |
LGTM, code looks good, works too
Lukáš Tinkl (lukas-kde) wrote : Posted in a previous version of this proposal | # |
Conflicts ahead:
Text conflict in debian/control
Text conflict in debian/
Unity8 CI Bot (unity8-ci-bot) wrote : Posted in a previous version of this proposal | # |
FAILED: Continuous integration, rev:557
https:/
Executed test runs:
FAILURE: https:/
FAILURE: https:/
Click here to trigger a rebuild:
https:/
Daniel d'Andrada (dandrader) wrote : Posted in a previous version of this proposal | # |
On 05/09/2016 15:12, Lukáš Tinkl wrote:
> Review: Needs Fixing
>
> Conflicts ahead:
>
> Text conflict in debian/control
> Text conflict in debian/
Fixed.
Unity8 CI Bot (unity8-ci-bot) wrote : Posted in a previous version of this proposal | # |
FAILED: Continuous integration, rev:561
https:/
Executed test runs:
FAILURE: https:/
FAILURE: https:/
Click here to trigger a rebuild:
https:/
Lukáš Tinkl (lukas-kde) wrote : Posted in a previous version of this proposal | # |
Okay
Unity8 CI Bot (unity8-ci-bot) wrote : Posted in a previous version of this proposal | # |
FAILED: Continuous integration, rev:561
https:/
Executed test runs:
FAILURE: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
Click here to trigger a rebuild:
https:/
Unity8 CI Bot (unity8-ci-bot) wrote : Posted in a previous version of this proposal | # |
FAILED: Continuous integration, rev:562
https:/
Executed test runs:
FAILURE: https:/
SUCCESS: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
Click here to trigger a rebuild:
https:/
Unity8 CI Bot (unity8-ci-bot) wrote : Posted in a previous version of this proposal | # |
FAILED: Continuous integration, rev:562
https:/
Executed test runs:
FAILURE: https:/
SUCCESS: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
Click here to trigger a rebuild:
https:/
Lukáš Tinkl (lukas-kde) wrote : | # |
Still looks good
Unity8 CI Bot (unity8-ci-bot) wrote : | # |
FAILED: Continuous integration, rev:562
https:/
Executed test runs:
FAILURE: https:/
FAILURE: https:/
Click here to trigger a rebuild:
https:/
Unity8 CI Bot (unity8-ci-bot) wrote : | # |
FAILED: Continuous integration, rev:561
https:/
Executed test runs:
FAILURE: https:/
SUCCESS: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
Click here to trigger a rebuild:
https:/
- 561. By Daniel d'Andrada
- 562. By Daniel d'Andrada
-
Send relative pointer movement to Mir clients
- 563. By Daniel d'Andrada
-
Implement cursor confinement
Unity8 CI Bot (unity8-ci-bot) wrote : | # |
FAILED: Continuous integration, rev:563
https:/
Executed test runs:
FAILURE: https:/
SUCCESS: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
FAILURE: https:/
SUCCESS: https:/
deb: https:/
Click here to trigger a rebuild:
https:/
Preview Diff
1 | === modified file 'CMakeLists.txt' |
2 | --- CMakeLists.txt 2016-08-30 12:32:13 +0000 |
3 | +++ CMakeLists.txt 2016-09-08 22:52:21 +0000 |
4 | @@ -83,7 +83,7 @@ |
5 | pkg_check_modules(GSETTINGS_QT REQUIRED gsettings-qt) |
6 | pkg_check_modules(QTDBUSTEST libqtdbustest-1 REQUIRED) |
7 | pkg_check_modules(QTDBUSMOCK libqtdbusmock-1 REQUIRED) |
8 | -pkg_check_modules(APPLICATION_API REQUIRED unity-shell-application=21) |
9 | +pkg_check_modules(APPLICATION_API REQUIRED unity-shell-application=22) |
10 | pkg_check_modules(CGMANAGER libcgmanager REQUIRED) |
11 | pkg_check_modules(CONTENT_HUB libcontent-hub>=0.2 REQUIRED) |
12 | |
13 | |
14 | === modified file 'debian/control' |
15 | --- debian/control 2016-09-08 22:52:21 +0000 |
16 | +++ debian/control 2016-09-08 22:52:21 +0000 |
17 | @@ -24,7 +24,7 @@ |
18 | libubuntu-app-launch2-dev (>= 0.9), |
19 | libubuntu-application-api-dev (>= 2.1.0), |
20 | libudev-dev, |
21 | - libunity-api-dev (>= 7.118), |
22 | + libunity-api-dev (>= 7.119), |
23 | liburl-dispatcher1-dev, |
24 | libxkbcommon-dev, |
25 | libxrender-dev, |
26 | @@ -98,7 +98,7 @@ |
27 | Conflicts: libqtmir, |
28 | libunity-mir1, |
29 | Provides: unity-application-impl, |
30 | - unity-application-impl-21, |
31 | + unity-application-impl-22, |
32 | Description: Qt plugin for Unity specific Mir APIs |
33 | QtMir provides Qt/QML bindings for Mir features that are exposed through the |
34 | qtmir-desktop or qtmir-android QPA plugin such as Application management |
35 | |
36 | === modified file 'debian/gles-patches/convert-to-gles.patch' |
37 | --- debian/gles-patches/convert-to-gles.patch 2016-08-31 01:51:14 +0000 |
38 | +++ debian/gles-patches/convert-to-gles.patch 2016-09-08 22:52:21 +0000 |
39 | @@ -84,7 +84,7 @@ |
40 | -Conflicts: libqtmir, |
41 | - libunity-mir1, |
42 | -Provides: unity-application-impl, |
43 | -- unity-application-impl-21, |
44 | +- unity-application-impl-22, |
45 | -Description: Qt plugin for Unity specific Mir APIs |
46 | - QtMir provides Qt/QML bindings for Mir features that are exposed through the |
47 | - qtmir-desktop or qtmir-android QPA plugin such as Application management |
48 | |
49 | === modified file 'src/modules/Unity/Application/mirsurface.cpp' |
50 | --- src/modules/Unity/Application/mirsurface.cpp 2016-09-08 22:52:21 +0000 |
51 | +++ src/modules/Unity/Application/mirsurface.cpp 2016-09-08 22:52:21 +0000 |
52 | @@ -91,6 +91,7 @@ |
53 | setShellChrome(static_cast<Mir::ShellChrome>(shell_chrome)); |
54 | }); |
55 | connect(observer.get(), &SurfaceObserver::inputBoundsChanged, this, &MirSurface::setInputBounds); |
56 | + connect(observer.get(), &SurfaceObserver::confinesMousePointerChanged, this, &MirSurface::confinesMousePointerChanged); |
57 | observer->setListener(this); |
58 | } |
59 | |
60 | @@ -888,6 +889,11 @@ |
61 | return m_inputBounds; |
62 | } |
63 | |
64 | +bool MirSurface::confinesMousePointer() const |
65 | +{ |
66 | + return m_surface->confine_pointer_state() == mir_pointer_confined_to_surface; |
67 | +} |
68 | + |
69 | void MirSurface::requestFocus() |
70 | { |
71 | DEBUG_MSG << "()"; |
72 | |
73 | === modified file 'src/modules/Unity/Application/mirsurface.h' |
74 | --- src/modules/Unity/Application/mirsurface.h 2016-09-06 18:12:18 +0000 |
75 | +++ src/modules/Unity/Application/mirsurface.h 2016-09-08 22:52:21 +0000 |
76 | @@ -96,6 +96,8 @@ |
77 | bool focused() const override; |
78 | QRect inputBounds() const override; |
79 | |
80 | + bool confinesMousePointer() const override; |
81 | + |
82 | Q_INVOKABLE void requestFocus() override; |
83 | Q_INVOKABLE void close() override; |
84 | Q_INVOKABLE void raise() override; |
85 | |
86 | === modified file 'src/platforms/mirserver/mirwindowmanager.cpp' |
87 | --- src/platforms/mirserver/mirwindowmanager.cpp 2016-08-08 13:55:43 +0000 |
88 | +++ src/platforms/mirserver/mirwindowmanager.cpp 2016-09-08 22:52:21 +0000 |
89 | @@ -207,6 +207,10 @@ |
90 | surface->set_input_region(modifications.input_shape.value()); |
91 | } |
92 | |
93 | + if (modifications.confine_pointer.is_set()) { |
94 | + surface->set_confine_pointer_state(modifications.confine_pointer.value()); |
95 | + } |
96 | + |
97 | SurfaceObserver *observer = SurfaceObserver::observerForSurface(surface.get()); |
98 | if (observer) { |
99 | observer->notifySurfaceModifications(modifications); |
100 | @@ -220,4 +224,4 @@ |
101 | return std::make_shared<MirWindowManagerImpl>(displayLayout, sessionListener); |
102 | } |
103 | |
104 | -#include "mirwindowmanager.moc" |
105 | \ No newline at end of file |
106 | +#include "mirwindowmanager.moc" |
107 | |
108 | === modified file 'src/platforms/mirserver/surfaceobserver.cpp' |
109 | --- src/platforms/mirserver/surfaceobserver.cpp 2016-07-15 15:38:04 +0000 |
110 | +++ src/platforms/mirserver/surfaceobserver.cpp 2016-09-08 22:52:21 +0000 |
111 | @@ -175,6 +175,9 @@ |
112 | QRect qRect = calculateBoundingRect(modifications.input_shape.value()); |
113 | Q_EMIT inputBoundsChanged(qRect); |
114 | } |
115 | + if (modifications.confine_pointer.is_set()) { |
116 | + Q_EMIT confinesMousePointerChanged(modifications.confine_pointer.value() == mir_pointer_confined_to_surface); |
117 | + } |
118 | } |
119 | |
120 | SurfaceObserver *SurfaceObserver::observerForSurface(const mir::scene::Surface *surface) |
121 | |
122 | === modified file 'src/platforms/mirserver/surfaceobserver.h' |
123 | --- src/platforms/mirserver/surfaceobserver.h 2016-07-15 15:38:04 +0000 |
124 | +++ src/platforms/mirserver/surfaceobserver.h 2016-09-08 22:52:21 +0000 |
125 | @@ -86,6 +86,7 @@ |
126 | void heightIncrementChanged(int); |
127 | void shellChromeChanged(MirShellChrome); |
128 | void inputBoundsChanged(const QRect &rect); |
129 | + void confinesMousePointerChanged(bool); |
130 | |
131 | private: |
132 | QCursor createQCursorFromMirCursorImage(const mir::graphics::CursorImage &cursorImage); |
133 | |
134 | === modified file 'tests/framework/fake_mirsurface.h' |
135 | --- tests/framework/fake_mirsurface.h 2016-08-30 12:24:19 +0000 |
136 | +++ tests/framework/fake_mirsurface.h 2016-09-08 22:52:21 +0000 |
137 | @@ -78,6 +78,7 @@ |
138 | |
139 | bool focused() const override { return false; } |
140 | QRect inputBounds() const override { return QRect(0,0,10,10); } |
141 | + bool confinesMousePointer() const override { return false; } |
142 | |
143 | void requestFocus() override { |
144 | Q_EMIT focusRequested(); |
FAILED: Continuous integration, rev:551 /unity8- jenkins. ubuntu. com/job/ lp-qtmir- ci/351/ /unity8- jenkins. ubuntu. com/job/ build/2677/ console /unity8- jenkins. ubuntu. com/job/ build-0- fetch/2705 /unity8- jenkins. ubuntu. com/job/ build-1- sourcepkg/ release= vivid+overlay/ 2578 /unity8- jenkins. ubuntu. com/job/ build-1- sourcepkg/ release= xenial+ overlay/ 2578 /unity8- jenkins. ubuntu. com/job/ build-1- sourcepkg/ release= yakkety/ 2578 /unity8- jenkins. ubuntu. com/job/ build-2- binpkg/ arch=amd64, release= vivid+overlay/ 2571/console /unity8- jenkins. ubuntu. com/job/ build-2- binpkg/ arch=amd64, release= xenial+ overlay/ 2571/console /unity8- jenkins. ubuntu. com/job/ build-2- binpkg/ arch=amd64, release= yakkety/ 2571/console /unity8- jenkins. ubuntu. com/job/ build-2- binpkg/ arch=armhf, release= vivid+overlay/ 2571/console /unity8- jenkins. ubuntu. com/job/ build-2- binpkg/ arch=armhf, release= xenial+ overlay/ 2571/console /unity8- jenkins. ubuntu. com/job/ build-2- binpkg/ arch=armhf, release= yakkety/ 2571/console /unity8- jenkins. ubuntu. com/job/ build-2- binpkg/ arch=i386, release= vivid+overlay/ 2571/console /unity8- jenkins. ubuntu. com/job/ build-2- binpkg/ arch=i386, release= xenial+ overlay/ 2571/console /unity8- jenkins. ubuntu. com/job/ build-2- binpkg/ arch=i386, release= yakkety/ 2571/console
https:/
Executed test runs:
FAILURE: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
Click here to trigger a rebuild: /unity8- jenkins. ubuntu. com/job/ lp-qtmir- ci/351/ rebuild
https:/