Merge lp:~dandrader/qtmir/cursorConfinement into lp:qtmir

Proposed by Daniel d'Andrada
Status: Superseded
Proposed branch: lp:~dandrader/qtmir/cursorConfinement
Merge into: lp:qtmir
Prerequisite: lp:~dandrader/qtmir/mouseMovement
Diff against target: 131 lines (+21/-4)
8 files modified
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:~dandrader/qtmir/cursorConfinement
Reviewer Review Type Date Requested Status
Unity8 CI Bot (community) continuous-integration Needs Fixing
Lukáš Tinkl (community) Approve
Review via email: mp+303987@code.launchpad.net

This proposal has been superseded by 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://code.launchpad.net/~dandrader/unity-api/cursorConfinement/+merge/303984
https://code.launchpad.net/~dandrader/unity8/cursorConfinement/+merge/303986

* 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

To post a comment you must log in.
Revision history for this message
Unity8 CI Bot (unity8-ci-bot) wrote :

FAILED: Continuous integration, rev:551
https://unity8-jenkins.ubuntu.com/job/lp-qtmir-ci/351/
Executed test runs:
    FAILURE: https://unity8-jenkins.ubuntu.com/job/build/2677/console
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-0-fetch/2705
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-1-sourcepkg/release=vivid+overlay/2578
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-1-sourcepkg/release=xenial+overlay/2578
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-1-sourcepkg/release=yakkety/2578
    FAILURE: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=vivid+overlay/2571/console
    FAILURE: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/2571/console
    FAILURE: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=yakkety/2571/console
    FAILURE: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=vivid+overlay/2571/console
    FAILURE: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/2571/console
    FAILURE: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=yakkety/2571/console
    FAILURE: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=vivid+overlay/2571/console
    FAILURE: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/2571/console
    FAILURE: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=yakkety/2571/console

Click here to trigger a rebuild:
https://unity8-jenkins.ubuntu.com/job/lp-qtmir-ci/351/rebuild

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

+#include "mirwindowmanager.moc"

Do we need to include the MOC files, are they not generated automatically?

---

Otherwise code looks good, didn't test yet though.

review: Needs Information
Revision history for this message
Daniel d'Andrada (dandrader) wrote :

On 26/08/2016 11:17, Lukáš Tinkl wrote:
> Review: Needs Information
>
> +#include "mirwindowmanager.moc"
>
> 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/qtmir/cursorConfinement/src/platforms/mirserver/mirwindowmanager.cpp:
The file contains a Q_OBJECT macro, but does not include
"mirwindowmanager.moc" !
"""

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

LGTM, code looks good, works too

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

Conflicts ahead:

Text conflict in debian/control
Text conflict in debian/gles-patches/convert-to-gles.patch

review: Needs Fixing
Revision history for this message
Unity8 CI Bot (unity8-ci-bot) wrote :
review: Needs Fixing (continuous-integration)
559. By Daniel d'Andrada

merge lp:~gerboland/qtmir/use-mir-test-dev

560. By Daniel d'Andrada

Send relative pointer movement to Mir clients

561. By Daniel d'Andrada

Implement cursor confinement

Revision history for this message
Daniel d'Andrada (dandrader) wrote :

On 05/09/2016 15:12, Lukáš Tinkl wrote:
> Review: Needs Fixing
>
> Conflicts ahead:
>
> Text conflict in debian/control
> Text conflict in debian/gles-patches/convert-to-gles.patch

Fixed.

Revision history for this message
Unity8 CI Bot (unity8-ci-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Lukáš Tinkl (lukas-kde) wrote :

Okay

review: Approve
Revision history for this message
Unity8 CI Bot (unity8-ci-bot) wrote :

FAILED: Continuous integration, rev:561
https://unity8-jenkins.ubuntu.com/job/lp-qtmir-ci/364/
Executed test runs:
    FAILURE: https://unity8-jenkins.ubuntu.com/job/build/2749/console
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-0-fetch/2777
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-1-sourcepkg/release=vivid+overlay/2645
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-1-sourcepkg/release=xenial+overlay/2645
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-1-sourcepkg/release=yakkety/2645
    FAILURE: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=vivid+overlay/2637/console
    FAILURE: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/2637/console
    FAILURE: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=yakkety/2637/console
    FAILURE: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=vivid+overlay/2637/console
    FAILURE: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/2637/console
    FAILURE: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=yakkety/2637/console
    FAILURE: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=vivid+overlay/2637/console
    FAILURE: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/2637/console
    FAILURE: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=yakkety/2637/console

Click here to trigger a rebuild:
https://unity8-jenkins.ubuntu.com/job/lp-qtmir-ci/364/rebuild

review: Needs Fixing (continuous-integration)

Unmerged revisions

561. By Daniel d'Andrada

Implement cursor confinement

560. By Daniel d'Andrada

Send relative pointer movement to Mir clients

559. By Daniel d'Andrada

merge lp:~gerboland/qtmir/use-mir-test-dev

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'debian/control'
2--- debian/control 2016-09-05 20:45:26 +0000
3+++ debian/control 2016-09-05 20:45:26 +0000
4@@ -24,7 +24,7 @@
5 libubuntu-app-launch2-dev (>= 0.9),
6 libubuntu-application-api-dev (>= 2.1.0),
7 libudev-dev,
8- libunity-api-dev (>= 7.118),
9+ libunity-api-dev (>= 7.119),
10 liburl-dispatcher1-dev,
11 libxkbcommon-dev,
12 libxrender-dev,
13@@ -98,7 +98,7 @@
14 Conflicts: libqtmir,
15 libunity-mir1,
16 Provides: unity-application-impl,
17- unity-application-impl-21,
18+ unity-application-impl-22,
19 Description: Qt plugin for Unity specific Mir APIs
20 QtMir provides Qt/QML bindings for Mir features that are exposed through the
21 qtmir-desktop or qtmir-android QPA plugin such as Application management
22
23=== modified file 'debian/gles-patches/convert-to-gles.patch'
24--- debian/gles-patches/convert-to-gles.patch 2016-08-31 01:51:14 +0000
25+++ debian/gles-patches/convert-to-gles.patch 2016-09-05 20:45:26 +0000
26@@ -84,7 +84,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 'src/modules/Unity/Application/mirsurface.cpp'
37--- src/modules/Unity/Application/mirsurface.cpp 2016-09-05 20:45:26 +0000
38+++ src/modules/Unity/Application/mirsurface.cpp 2016-09-05 20:45:26 +0000
39@@ -91,6 +91,7 @@
40 setShellChrome(static_cast<Mir::ShellChrome>(shell_chrome));
41 });
42 connect(observer.get(), &SurfaceObserver::inputBoundsChanged, this, &MirSurface::setInputBounds);
43+ connect(observer.get(), &SurfaceObserver::confinesMousePointerChanged, this, &MirSurface::confinesMousePointerChanged);
44 observer->setListener(this);
45 }
46
47@@ -876,6 +877,11 @@
48 return m_inputBounds;
49 }
50
51+bool MirSurface::confinesMousePointer() const
52+{
53+ return m_surface->confine_pointer_state() == mir_pointer_confined_to_surface;
54+}
55+
56 void MirSurface::requestFocus()
57 {
58 DEBUG_MSG << "()";
59
60=== modified file 'src/modules/Unity/Application/mirsurface.h'
61--- src/modules/Unity/Application/mirsurface.h 2016-08-30 12:24:19 +0000
62+++ src/modules/Unity/Application/mirsurface.h 2016-09-05 20:45:26 +0000
63@@ -95,6 +95,8 @@
64 bool focused() const override;
65 QRect inputBounds() const override;
66
67+ bool confinesMousePointer() const override;
68+
69 Q_INVOKABLE void requestFocus() override;
70 Q_INVOKABLE void close() override;
71 Q_INVOKABLE void raise() override;
72
73=== modified file 'src/platforms/mirserver/mirwindowmanager.cpp'
74--- src/platforms/mirserver/mirwindowmanager.cpp 2016-08-08 13:55:43 +0000
75+++ src/platforms/mirserver/mirwindowmanager.cpp 2016-09-05 20:45:26 +0000
76@@ -207,6 +207,10 @@
77 surface->set_input_region(modifications.input_shape.value());
78 }
79
80+ if (modifications.confine_pointer.is_set()) {
81+ surface->set_confine_pointer_state(modifications.confine_pointer.value());
82+ }
83+
84 SurfaceObserver *observer = SurfaceObserver::observerForSurface(surface.get());
85 if (observer) {
86 observer->notifySurfaceModifications(modifications);
87@@ -220,4 +224,4 @@
88 return std::make_shared<MirWindowManagerImpl>(displayLayout, sessionListener);
89 }
90
91-#include "mirwindowmanager.moc"
92\ No newline at end of file
93+#include "mirwindowmanager.moc"
94
95=== modified file 'src/platforms/mirserver/surfaceobserver.cpp'
96--- src/platforms/mirserver/surfaceobserver.cpp 2016-07-15 15:38:04 +0000
97+++ src/platforms/mirserver/surfaceobserver.cpp 2016-09-05 20:45:26 +0000
98@@ -175,6 +175,9 @@
99 QRect qRect = calculateBoundingRect(modifications.input_shape.value());
100 Q_EMIT inputBoundsChanged(qRect);
101 }
102+ if (modifications.confine_pointer.is_set()) {
103+ Q_EMIT confinesMousePointerChanged(modifications.confine_pointer.value() == mir_pointer_confined_to_surface);
104+ }
105 }
106
107 SurfaceObserver *SurfaceObserver::observerForSurface(const mir::scene::Surface *surface)
108
109=== modified file 'src/platforms/mirserver/surfaceobserver.h'
110--- src/platforms/mirserver/surfaceobserver.h 2016-07-15 15:38:04 +0000
111+++ src/platforms/mirserver/surfaceobserver.h 2016-09-05 20:45:26 +0000
112@@ -86,6 +86,7 @@
113 void heightIncrementChanged(int);
114 void shellChromeChanged(MirShellChrome);
115 void inputBoundsChanged(const QRect &rect);
116+ void confinesMousePointerChanged(bool);
117
118 private:
119 QCursor createQCursorFromMirCursorImage(const mir::graphics::CursorImage &cursorImage);
120
121=== modified file 'tests/framework/fake_mirsurface.h'
122--- tests/framework/fake_mirsurface.h 2016-08-30 12:24:19 +0000
123+++ tests/framework/fake_mirsurface.h 2016-09-05 20:45:26 +0000
124@@ -78,6 +78,7 @@
125
126 bool focused() const override { return false; }
127 QRect inputBounds() const override { return QRect(0,0,10,10); }
128+ bool confinesMousePointer() const override { return false; }
129
130 void requestFocus() override {
131 Q_EMIT focusRequested();

Subscribers

People subscribed via source and target branches