~vanvugt/mir/set-subpixel

« back to all changes in this revision

Viewing changes to include/platform/mir/graphics/display.h

Simplify hardware cursor construction (no parameter required).

Previously hardware cursor implementations were expected to show
on construction with a given image. We now instead hide on construction but show an image immediately after as part of the default configuration policy.

Aside from providing a simpler interface, this is required as a
prerequisite for runtime fallback to the software cursor when the
hardware cursor won't be used (both cursors exist but never more than
one of them shown). This is also a prerequisite to fixing bug 1662760.

Assuming that a hardware cursor might only fail during construction was
a poor design. Going forward we will need to deal with a hardware cursor
that might become unusable or undesirable at any point in its life. Fixes: https://bugs.launchpad.net/bugs/1639226.

Approved by mir-ci-bot, Daniel van Vugt, Chris Halse Rogers.

Show diffs side-by-side

added added

removed removed

Lines of Context:
33
33
class DisplayBuffer;
34
34
class DisplayConfiguration;
35
35
class Cursor;
36
 
class CursorImage;
37
36
class EventHandlerRegister;
38
37
class VirtualOutput;
39
38
 
173
172
    /**
174
173
     * Create a hardware cursor object.
175
174
     */
176
 
    virtual std::shared_ptr<Cursor> create_hardware_cursor(std::shared_ptr<CursorImage> const& initial_image) = 0;
 
175
    virtual std::shared_ptr<Cursor> create_hardware_cursor() = 0;
177
176
 
178
177
    /**
179
178
     * Creates a virtual output