Winit: [META] Feature parity between platforms

Created on 4 Aug 2017  Β·  23Comments  Β·  Source: rust-windowing/winit

Outdated - please refer to FEATURES.md.

This is intended to be a meta-issue to track feature parity between the various backends.

This is a first draft, please all who have the right to, update this message with what you find missing (be it a feature I forgot or the status of a feature for a platform or a platform entirely)

Each section includes a collapsed description of the features it lists.

Legend:

  • βœ”οΈ : Works as intended
  • β–’ : Mostly works but some bugs are known
  • ❌ : Missing feature or large bugs making it unusable
  • N/A : Not applicable for this platform
  • ❓ : Unknown status

Display features

| Feature | Windows | MacOS | Linux x11 | Linux Wayland | Android | iOS | Emscripten |
| :--- | :---: | :---: | :---: | :---: | :---: | :---: | :---: |
| Window initialization | βœ”οΈ | βœ”οΈ | β–’ #5 | βœ”οΈ | β–’ #33 | β–’ #33 | ❓ |
| Providing pointer to init OpenGL | βœ”οΈ | βœ”οΈ | βœ”οΈ | βœ”οΈ | βœ”οΈ | βœ”οΈ | ❓ |
| Providing pointer to init vulkan | βœ”οΈ | βœ”οΈ | βœ”οΈ | βœ”οΈ | βœ”οΈ | ❓ | N/A |
| Window decorations | βœ”οΈ | βœ”οΈ | βœ”οΈ | β–’ #306 | N/A | N/A | N/A |
| Window decorations toggle | βœ”οΈ | βœ”οΈ | βœ”οΈ | βœ”οΈ | N/A | N/A | N/A |
| Window resizing | βœ”οΈ | β–’ #219 | βœ”οΈ | β–’ #306 | N/A | N/A | ❓ |
| Window transparency | β–’ #260 | βœ”οΈ | βœ”οΈ | βœ”οΈ | N/A | N/A | N/A |
| Window maximization | βœ”οΈ | βœ”οΈ | βœ”οΈ | βœ”οΈ | N/A | N/A | N/A |
| Window maximization toggle | βœ”οΈ | βœ”οΈ | βœ”οΈ | βœ”οΈ | N/A | N/A | N/A |
| Fullscreen | βœ”οΈ | βœ”οΈ | βœ”οΈ | βœ”οΈ | N/A | N/A | ❌ |
| Fullscreen toggle | βœ”οΈ | βœ”οΈ | βœ”οΈ | βœ”οΈ | N/A | N/A | ❌ |
| HiDPI support #105 | βœ”οΈ | βœ”οΈ | βœ”οΈ | βœ”οΈ | β–’ | βœ”οΈ | βœ”οΈ |


Expand details of features

  • Window initialization: Winit allows the creation of a window
  • Pointer to OpenGL: Winit provides the necessary pointers to initialize a working opengl context
  • Pointer to Vulkan: Same as OpenGL but for Vulkan
  • Window decorations: The windows created by winit are properly decorated, and the decorations can be deactivated
  • Window decorations toggle: Decorations can be turned on or off after window creation
  • Window resizing: The windows created by winit can be resized and generate the appropriate events when they are. The application can precisely control its window size if wanted.
  • Window transaprency: Winit allows the creation of windows with a transparent background
  • Window maximization: The windows created by winit can be maximized upon creation.
  • Window maximization toggle: The windows created by winit can be maximized and unmaximized after creation.
  • Fullscreen: The windows created by winit support being fullscreen.
  • Fullscreen toggle: The windows created by winit can be switched to and from fullscreen after creation.

System information

| Feature | Windows | MacOS | Linux x11 | Linux Wayland | Android | iOS | Emscripten |
| :--- | :---: | :---: | :---: | :---: | :---: | :---: | :---: |
| Monitor list | βœ”οΈ | βœ”οΈ | βœ”οΈ | βœ”οΈ | N/A | N/A | N/A |


Expand details of features

  • Monitor list: Retrieve the list of monitors and their metada, including which one is primary is applicable


Input handling

| Feature | Windows | MacOS | Linux x11 | Linux Wayland | Android | iOS | Emscripten |
| :--- | :---: | :---: | :---: | :---: | :---: | :---: | :---: |
| Mouse events | βœ”οΈ | β–’ #63 | βœ”οΈ | βœ”οΈ | N/A | N/A | βœ”οΈ |
| Mouse set location | βœ”οΈ | βœ”οΈ | βœ”οΈ | ❓ | N/A | N/A | N/A |
| Cursor grab | βœ”οΈ | β–’ #165 | β–’ #242 | ❌ #306 | N/A | N/A | βœ”οΈ |
| Cursor image | βœ”οΈ | βœ”οΈ | βœ”οΈ | ❌ #306 | N/A | N/A | ❌ |
| Touch events | βœ”οΈ | ❌ | βœ”οΈ | βœ”οΈ | βœ”οΈ | βœ”οΈ | βœ”οΈ |
| Multitouch | ❓ | ❌ | βœ”οΈ | βœ”οΈ | ❓ | ❌ | ❌ |
| Keyboard events | βœ”οΈ | βœ”οΈ | βœ”οΈ | βœ”οΈ | ❓ | ❌ | βœ”οΈ |
| Drag&Drop | βœ”οΈ | βœ”οΈ | βœ”οΈ | ❌ #306 | ❌ | ❌ | ❌ |
| Clipboard #162 | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ |
| Raw Device Events | β–’ | β–’ | β–’ | ❌ | ❌ | ❌ | ❌ |


Expand details of features

  • Mouse events: Winit generates mouse events associated with pointer motion, click, and scrolling events
  • Mouse set location: Winit can forcibly change the location of the pointer
  • Cursor grab: Winit allows a grad of the cursor on a window, and subsequently generates device-type relative motion events for the grabbed cursor
  • Cursor image: Winit can change an set the cursor image, or hide the cursor
  • Touch events: Winit supports single-touch events
  • Multitouch: Winit supports multi-touch events, including cancellation of a gesture
  • Keyboard events: Winit properly forwards keyboard events, using the proper keymap, and includes the interpretation of entered text as utf8, handling dead keys and character composing.
  • Drag&Drop: Winit supports dragging content to winit, detecting when content enters, drops, or if the drop is cancelled.
  • Clipboard: Winit supports copy-pasting content to and from winit.


Pending API Reworks

Here are listed Changes in the API that have been merged but are still stubbed out in some platforms

| API Change | Windows | MacOS | Linux x11 | Linux Wayland | Android | iOS | Emscripten |
| :--- | :---: | :---: | :---: | :---: | :---: | :---: | :---: |
| New API for HiDPI (#315 #319) | βœ”οΈ | βœ”οΈ | βœ”οΈ | βœ”οΈ | β–’ | βœ”οΈ | βœ”οΈ |

meta platform parity

Most helpful comment

https://github.com/tomaka/winit/pull/457 implemented these features on Windows:

  • "Window decorations toggle" βœ”οΈ
  • "Window maximization" βœ”οΈ
  • "Window maximization toggle" βœ”οΈ
  • "Fullscreen" βœ”οΈ (This should work now)
  • "Fullscreen toggle" βœ”οΈ

All 23 comments

multitouch included in Touch events?

Not necessarily, I'll add a line for this

Is there a clear definition of what the intended function is for each of these features?

I know there's still some disparity between scaled and unscaled units, and whether window decorations should be included in window size. Platforms like Windows have #196.

Maybe we should have a clear test case for each feature so people can help remove the ❓s.

Ie Keyboard keymap conversion

Test two contradictory layouts and ensure typing sends the correctly mapped characters in WindowEvent::ReceivedCharacter events.

Which btw works in Linux x11.

I've introduced more detailed explanations of what the features represent, as well as expanded the scope of the tables to track API changes that are currently in the works.

Also, I've started reporting in this tables the various still-open issues on the repo when applicable.

@tomaka @mitchmindtree @Ralith : please could you have a look to fill in what you know works/don't work on the plaforms you are familiar with, as well a correct any mistake I would have made. I suggest we try our best to keep this table up to date in waiting for a better solution.

@jwilm I know with alacritty you have a decently large user-base on MacOS and Linux, could you help us fill in the blanks ? Thanks.

Emscripten is missing from this table

Indeed, I've added an emscripten. Are you using it ? Do you have some feedback about what works and what don't ?

@vberger I haven't yet used it but I noticed that it is missing support for multiple canvases.

Can we add a distinction to this issue like so:

βœ”οΈ Working, no known problems
β˜‘οΈ Working, with minor problems
❌ Feature is either missing or has bugs so severe the feature might as well be missing.

It'd just be helpful to have better clarity on where the major problems are.

This is a good idea, I'll integrate this as soon as I can find the time to do it.

Done.

Couple of small updates based on personal experience with winit:

Windows keyboard events are working. We use them in the input handler for Amethyst.

Windows, Mac, and Linux X11 Raw device events are working, so long as raw device only includes mouse movement.

Windows Cursor image and Cursor grab should be working. I haven't tested this myself but the code is written and I see no problems with it.

Currently clipboard support is listed as part of the Drag&Drop umbrella, but seeing as drag and drop is implemented on a bunch of platforms whereas winit doesn't even have an API for clipboard handling yet (unless I'm missing something), I think it would be more helpful to have them as separate rows.

371 would allow for key-repitition on wayland

Shouldn't "providing pointer to init vulkan" be changed for macOS and iOS as it's not anymore N/A?

I believe both "Window decorations toggle" and "Window decorations" will be solved for macos once #408 is merged.

I was mistaken about what "Window decorations toggle" meant, but #408 has merged so "Window decorations" for macos can be βœ”οΈ

"providing pointer to init vulkan” is working perfectly on macOS. It’s a little bit trickier compared to other platforms since you have to set up a CAMetalLayer by yourself. I’ll contribute some code to ash’s example app when I have time.

https://github.com/tomaka/winit/pull/457 implemented these features on Windows:

  • "Window decorations toggle" βœ”οΈ
  • "Window maximization" βœ”οΈ
  • "Window maximization toggle" βœ”οΈ
  • "Fullscreen" βœ”οΈ (This should work now)
  • "Fullscreen toggle" βœ”οΈ

465 gives us fullscreen, maximization, and decoration toggling on macOS. At present, there's the caveat that a window will only be fullscreen'd to whatever monitor presently has the keyboard focus (this is also the monitor returned by get_current_monitor), though that will be fixed pending the necessary additions to core-foundation.

EventsLoopProxy is worth adding to the list. I know it's currently unimplemented on iOS.

EventsLoopProxy is also unimplemented on Emscripten, and seems to be present on all other platforms. Though, I guess that should be added in #695 instead (and I'm also not sure what category here it would fit under!)

Closing since #695 was merged. That is not to say that the issues addressed here aren't problems, but thisn't the proper place for tracking them.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

chemicstry picture chemicstry  Β·  3Comments

hobogenized picture hobogenized  Β·  3Comments

chrisduerr picture chrisduerr  Β·  3Comments

JDTX picture JDTX  Β·  3Comments

tomaka picture tomaka  Β·  3Comments