Should this be "core"?
Alexandros Frantzis
alexandros.frantzis at canonical.com
Mon Oct 5 11:12:34 UTC 2015
On Mon, Oct 05, 2015 at 11:33:44AM +0100, Alan Griffiths wrote:
> In debugging our cursor code and getting it under tests I found
> something surprising (to me). Vis:
>
> std::shared_ptr<mi::CursorImages>
> mir::DefaultServerConfiguration::the_cursor_images()
> {
> return cursor_images( [this]() -> std::shared_ptr<mi::CursorImages>
> {
> auto xcursor_loader = std::make_shared<mi::XCursorLoader>();
> if (has_default_cursor(*xcursor_loader))
> return xcursor_loader;
> else return std::make_shared<mi::BuiltinCursorImages>();
> });
> }
>
> Which translates to "see if X cursors images are available, if so use
> them, otherwise use a builtin cursor". I don't think this is correct
> behaviour for *core* libmirserver - I think that should always and
> predictably use the builtin image. Something like the above makes
> perfect sense in example code, but I don't think we should hard wire
> this as the default.
>
> Does anyone have an objection to changing the above to...
>
> std::shared_ptr<mi::CursorImages>
> mir::DefaultServerConfiguration::the_cursor_images()
> {
> return cursor_images( [this]() -> std::shared_ptr<mi::CursorImages>
> {
> return std::make_shared<mi::BuiltinCursorImages>();
> });
> }
>
> ...and moving the X cursor support to libexampleserverconfig.a?
We are using the X cursor support as a convenient way to theme the
cursors. If we consider cursor theming to be core functionality on the
server side, then leveraging existing infrastructure is a reasonably way
to achieve it, and the XCursor code should remain as the default
implementation.
Otherwise, we could remove XCursor based theming, but we should ensure
our built-in cursor images support all the predefined cursor types. In
our client API we are exposing a set of predefined cursor names, which
the BuiltinCursorImage implementation doesn't currently support.
Although we don't explicitly promise that these are always supported, it
would be surprising if our default implementation didn't provide them.
I think that the cursor buffer stream mechanism is enough to cover the
needs of clients by moving cursor theme support to the client/toolkit
side, but I don't feel I have enough information on the matter yet to
make a final decision.
--
Alexandros
More information about the Mir-devel
mailing list