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

Proposed by Daniel d'Andrada
Status: Merged
Approved by: Albert Astals Cid
Approved revision: 596
Merged at revision: 605
Proposed branch: lp:~dandrader/qtmir/resolveMirCursorNames
Merge into: lp:qtmir
Diff against target: 64 lines (+22/-19)
1 file modified
src/modules/Unity/Application/mirsurface.cpp (+22/-19)
To merge this branch: bzr merge lp:~dandrader/qtmir/resolveMirCursorNames
Reviewer Review Type Date Requested Status
Unity8 CI Bot (community) continuous-integration Approve
Albert Astals Cid (community) Approve
Review via email: mp+316820@code.launchpad.net

Commit message

Resolve mir cursor names using mir symbols instead of plain strings

Since those names under the API symbols change regularly and should be considered opaque.

Description of the change

For instructions on how to test, see the bug description.

* 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

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

To post a comment you must log in.
596. By Daniel d'Andrada

Resolve mir cursor names using mir symbols instead of plain strings

Since those names under the API symbols change regularly and should be considered opaque.

Revision history for this message
Albert Astals Cid (aacid) 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.
Let's wait for it before top approval

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

PASSED: Continuous integration, rev:596
https://unity8-jenkins.ubuntu.com/job/lp-qtmir-ci/479/
Executed test runs:
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build/4044
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-0-fetch/4072
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/3912
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/3912/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=zesty/3912
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=zesty/3912/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/3912
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/3912/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=zesty/3912
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=zesty/3912/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/3912
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/3912/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=zesty/3912
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=zesty/3912/artifact/output/*zip*/output.zip

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

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/modules/Unity/Application/mirsurface.cpp'
2--- src/modules/Unity/Application/mirsurface.cpp 2017-02-06 09:11:04 +0000
3+++ src/modules/Unity/Application/mirsurface.cpp 2017-02-09 11:02:20 +0000
4@@ -35,6 +35,7 @@
5 #include <mir/scene/surface.h>
6 #include <mir/scene/surface_observer.h>
7 #include <mir/version.h>
8+#include <mir_toolkit/cursors.h>
9
10 // mirserver
11 #include <logging.h>
12@@ -1076,6 +1077,27 @@
13 : m_listener(nullptr)
14 , m_framesPosted(false)
15 {
16+ // mir cursor names, used by the mir protocol
17+
18+ m_cursorNameToShape[mir_default_cursor_name] = Qt::ArrowCursor;
19+ m_cursorNameToShape[mir_arrow_cursor_name] = Qt::ArrowCursor;
20+ m_cursorNameToShape[mir_crosshair_cursor_name] = Qt::CrossCursor;
21+ m_cursorNameToShape[mir_busy_cursor_name] = Qt::WaitCursor;
22+ m_cursorNameToShape[mir_caret_cursor_name] = Qt::IBeamCursor;
23+ m_cursorNameToShape[mir_vertical_resize_cursor_name] = Qt::SizeVerCursor;
24+ m_cursorNameToShape[mir_horizontal_resize_cursor_name] = Qt::SizeHorCursor;
25+ m_cursorNameToShape[mir_diagonal_resize_bottom_to_top_cursor_name] = Qt::SizeBDiagCursor;
26+ m_cursorNameToShape[mir_diagonal_resize_top_to_bottom_cursor_name] = Qt::SizeFDiagCursor;
27+ m_cursorNameToShape[mir_omnidirectional_resize_cursor_name] = Qt::SizeAllCursor;
28+ m_cursorNameToShape[mir_disabled_cursor_name] = Qt::BlankCursor;
29+ m_cursorNameToShape[mir_vsplit_resize_cursor_name] = Qt::SplitVCursor;
30+ m_cursorNameToShape[mir_hsplit_resize_cursor_name] = Qt::SplitHCursor;
31+ m_cursorNameToShape[mir_pointing_hand_cursor_name] = Qt::PointingHandCursor;
32+ m_cursorNameToShape[mir_open_hand_cursor_name] = Qt::OpenHandCursor;
33+ m_cursorNameToShape[mir_closed_hand_cursor_name] = Qt::ClosedHandCursor;
34+
35+ // xcursor names, used by our cursor themes
36+
37 m_cursorNameToShape["left_ptr"] = Qt::ArrowCursor;
38 m_cursorNameToShape["up_arrow"] = Qt::UpArrowCursor;
39 m_cursorNameToShape["cross"] = Qt::CrossCursor;
40@@ -1099,25 +1121,6 @@
41 m_cursorNameToShape["dnd-move"] = Qt::DragMoveCursor;
42 m_cursorNameToShape["dnd-link"] = Qt::DragLinkCursor;
43
44- // Used by Mir client API (mir_*_cursor_name strings)
45- m_cursorNameToShape["default"] = Qt::ArrowCursor;
46- m_cursorNameToShape["disabled"] = Qt::BlankCursor;
47- m_cursorNameToShape["arrow"] = Qt::ArrowCursor;
48- m_cursorNameToShape["busy"] = Qt::WaitCursor;
49- m_cursorNameToShape["caret"] = Qt::IBeamCursor;
50- m_cursorNameToShape["pointing-hand"] = Qt::PointingHandCursor;
51- m_cursorNameToShape["open-hand"] = Qt::OpenHandCursor;
52- m_cursorNameToShape["closed-hand"] = Qt::ClosedHandCursor;
53- m_cursorNameToShape["horizontal-resize"] = Qt::SizeHorCursor;
54- m_cursorNameToShape["vertical-resize"] = Qt::SizeVerCursor;
55- m_cursorNameToShape["diagonal-resize-bottom-to-top"] = Qt::SizeBDiagCursor;
56- m_cursorNameToShape["diagonal-resize-top_to_bottom"] = Qt::SizeFDiagCursor; // current string with typo
57- m_cursorNameToShape["diagonal-resize-top-to-bottom"] = Qt::SizeFDiagCursor; // how it will be when they fix it (if ever)
58- m_cursorNameToShape["omnidirectional-resize"] = Qt::SizeAllCursor;
59- m_cursorNameToShape["vsplit-resize"] = Qt::SplitVCursor;
60- m_cursorNameToShape["hsplit-resize"] = Qt::SplitHCursor;
61- m_cursorNameToShape["crosshair"] = Qt::CrossCursor;
62-
63 qRegisterMetaType<MirShellChrome>("MirShellChrome");
64 }
65

Subscribers

People subscribed via source and target branches