Merge lp:~alan-griffiths/miral/cursor-theme into lp:miral

Proposed by Alan Griffiths
Status: Merged
Approved by: Gerry Boland
Approved revision: 557
Merged at revision: 559
Proposed branch: lp:~alan-griffiths/miral/cursor-theme
Merge into: lp:miral
Diff against target: 58 lines (+12/-2)
3 files modified
debian/changelog (+3/-0)
include/miral/cursor_theme.h (+2/-2)
miral/cursor_theme.cpp (+7/-0)
To merge this branch: bzr merge lp:~alan-griffiths/miral/cursor-theme
Reviewer Review Type Date Requested Status
Mir CI Bot continuous-integration Approve
Gerry Boland (community) Approve
Review via email: mp+325983@code.launchpad.net

Commit message

Make cursor theme configurable

To post a comment you must log in.
Revision history for this message
Gerry Boland (gerboland) wrote :

Nice and easy, thank you

review: Approve
Revision history for this message
Mir CI Bot (mir-ci-bot) :
review: Approve (continuous-integration)
Revision history for this message
Mir CI Bot (mir-ci-bot) wrote :

PASSED: Continuous integration, rev:557
https://mir-jenkins.ubuntu.com/job/miral-ci/34/
Executed test runs:
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-miral/50
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-0-fetch/4875
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=artful/4864
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=xenial/4864
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=zesty/4864
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-miral/arch=amd64,release=artful/54
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-miral/arch=amd64,release=artful/54/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-miral/arch=amd64,release=xenial/54
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-miral/arch=amd64,release=xenial/54/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-miral/arch=amd64,release=xenial+overlay/54
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-miral/arch=amd64,release=xenial+overlay/54/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-miral/arch=amd64,release=zesty/54
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-miral/arch=amd64,release=zesty/54/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-miral/arch=i386,release=artful/54
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-miral/arch=i386,release=artful/54/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-miral/arch=i386,release=xenial/54
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-miral/arch=i386,release=xenial/54/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-miral/arch=i386,release=xenial+overlay/54
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-miral/arch=i386,release=xenial+overlay/54/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-miral/arch=i386,release=zesty/54
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-miral/arch=i386,release=zesty/54/artifact/output/*zip*/output.zip

Click here to trigger a rebuild:
https://mir-jenkins.ubuntu.com/job/miral-ci/34/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 'debian/changelog'
2--- debian/changelog 2017-04-17 09:48:00 +0000
3+++ debian/changelog 2017-06-20 08:51:47 +0000
4@@ -6,6 +6,9 @@
5 - Enhancements:
6 . Support for passing messages to enable Drag & Drop
7 . Support for client requested move
8+ . Port to the undeprecated Mir APIs
9+ . Added "--cursor-theme" option when configuring a cursor theme
10+ . Drop support for Mir versions before 0.26
11 - Bugs fixed:
12
13 -- Alan Griffiths <alan.griffiths@canonical.com> Tue, 21 Mar 2017 17:57:20 +0000
14
15=== modified file 'include/miral/cursor_theme.h'
16--- include/miral/cursor_theme.h 2016-09-28 10:38:36 +0000
17+++ include/miral/cursor_theme.h 2017-06-20 08:51:47 +0000
18@@ -25,11 +25,11 @@
19
20 namespace miral
21 {
22-/// Load a cursor theme
23+/// Load an X-cursor theme, either the supplied default, or through the --cursor-theme config option
24 class CursorTheme
25 {
26 public:
27- /// Specify a specific theme
28+ /// Specify a default theme
29 explicit CursorTheme(std::string const& theme);
30 ~CursorTheme();
31
32
33=== modified file 'miral/cursor_theme.cpp'
34--- miral/cursor_theme.cpp 2016-09-28 10:57:41 +0000
35+++ miral/cursor_theme.cpp 2017-06-20 08:51:47 +0000
36@@ -19,6 +19,7 @@
37 #include "miral/cursor_theme.h"
38 #include "xcursor_loader.h"
39
40+#include <mir/options/option.h>
41 #include <mir/server.h>
42 #include <mir_toolkit/cursors.h>
43
44@@ -43,8 +44,14 @@
45
46 void miral::CursorTheme::operator()(mir::Server& server) const
47 {
48+ static char const* const option = "cursor-theme";
49+
50+ server.add_configuration_option(option, "Cursor theme (e.g. \"DMZ-Black\")", theme);
51+
52 server.override_the_cursor_images([&]
53 {
54+ auto const theme = server.get_options()->get<std::string const>(option);
55+
56 std::shared_ptr<mi::CursorImages> const xcursor_loader{std::make_shared<XCursorLoader>(theme)};
57
58 if (has_default_cursor(*xcursor_loader))

Subscribers

People subscribed via source and target branches