Skip to content

Abstract out CursorIcon from bevy_winit #20182

@viridia

Description

@viridia

What problem does this solve or what need does it fill?

bevy_winit is supposed to be the "backend" for bevy_window, whereby you could have different backends for different environments. However, exporting CursorIcon means that the abstraction leaks: anyone who uses cursors is now tied to a particular windowing backend.

What solution would you like?

We need to have a universal Cursor definition that is independent of any particular windowing system.

Now, it might seem a challenge to do this because the existing CursorIcon has a bunch of built-in "standard" cursors which might not be present on other windowing backends. However, the built-in winit cursors are exactly the same as the standard CSS browser cursors (or at least, a subset of them), so there's a good chance that any other windowing system will support a similar set of cursors; and if not, we can probably emulate them to bring the various platforms up to par.

What alternative(s) have you considered?

Well, the main alternative is to assume that we're always and forever going to be using winit as the backend. But this probably isn't going to fly.

Either that, or simply disable custom cursors in other environments.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-UIGraphical user interfaces, styles, layouts, and widgetsA-WindowingPlatform-agnostic interface layer to run your app inC-FeatureA new feature, making something new possibleS-Needs-DesignThis issue requires design work to think about how it would best be accomplished

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions