~mir-team/miral/release

« back to all changes in this revision

Viewing changes to miral/cursor_theme.cpp

  • Committer: Bileto Bot
  • Date: 2017-06-21 08:34:34 UTC
  • mfrom: (360.1.1 miral-release)
  • Revision ID: ci-train-bot@canonical.com-20170621083434-e7ftkyg5qr2fzsao
* New upstream release 1.4.0 (https://launchpad.net/miral/+milestone/1.4.0)
  - ABI summary:
    . miral ABI unchanged at 2
  - Enhancements:
    . Support for passing messages to enable Drag & Drop
    . Support for client requested move
    . Port to the undeprecated Mir APIs
    . Added "--cursor-theme" option when configuring a cursor theme
    . Drop support for Mir versions before 0.26
  - Bugs fixed:

Show diffs side-by-side

added added

removed removed

Lines of Context:
19
19
#include "miral/cursor_theme.h"
20
20
#include "xcursor_loader.h"
21
21
 
 
22
#include <mir/options/option.h>
22
23
#include <mir/server.h>
23
24
#include <mir_toolkit/cursors.h>
24
25
 
43
44
 
44
45
void miral::CursorTheme::operator()(mir::Server& server) const
45
46
{
 
47
    static char const* const option = "cursor-theme";
 
48
 
 
49
    server.add_configuration_option(option, "Cursor theme (e.g. \"DMZ-Black\")", theme);
 
50
 
46
51
    server.override_the_cursor_images([&]
47
52
        {
 
53
            auto const theme = server.get_options()->get<std::string const>(option);
 
54
 
48
55
            std::shared_ptr<mi::CursorImages> const xcursor_loader{std::make_shared<XCursorLoader>(theme)};
49
56
 
50
57
            if (has_default_cursor(*xcursor_loader))