Skip to content

Commit

Permalink
Push draft for office hours
Browse files Browse the repository at this point in the history
  • Loading branch information
DJMcNab committed Apr 18, 2024
1 parent a978439 commit 48dbb4b
Showing 1 changed file with 23 additions and 16 deletions.
39 changes: 23 additions & 16 deletions content/blog/2024-04-24-winit-2024.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,31 +5,37 @@ authors = ["Daniel McNab"]

<!-- Post's date SHOULD be changed -->

<!-- Introduction section, not for the paper -->

Linebender is working to develop cross-platform graphical user interfaces in Rust.
This naturally requires interaction with the underlying platform.
This requires integration with the underlying platform.
In Druid, we used our own platform integration crate, [druid-shell][] (later moved into its own repository as [Glazier][]).
In January, we [decided][tmix-01] to use [winit][] instead for Xilem (our next GUI toolkit).
The Rust ecosystem has generally settled on using winit to provide platform integration.
For example, winit is used by the [Bevy][] game engine (in the default configuration).
We made this choice to ensure that we could meet the expectations of desktop application users.
Large parts of the Rust ecosystem have settled on using [winit][] to provide platform integration.
In January, we also [decided][tmix-01] to use winit instead of Glazier for [Xilem][] (our next GUI toolkit).
Therefore, we are evaluating how well suited winit is currently for cross-platform non-game applications, with an aim towards improving this.

<!-- ## winit's scope -->

winit's scope is documented in their [FEATURES][winit features] document.
This gives the objective as supporting features which are common to all platforms.
Platform specific features are then expected to be built outside of winit.
These common features generally work well, although there are a few features which might be expected to be supported, but are not yet available.
Copy and paste support is another feature.
There is a draft pull request ([winit#2156][])

In Druid we have taken great care to ensure that user expectations of native applications are considered.
We intend to continue similarly in Xilem, ensuring that Xilem applications can be respectful of their user's .
However, to meet these expectations, Xilem does need to interface with platform specific features.
I have found these common features, such as general window lifecycle management, to work well.
Improvements in the APIs used for these have however historically taken a long time to land.
<!-- example of keyboard input/ui events key -->
The maintainers have shown a willingness to engage with this work.
It is likely that with more investment, other longstanding issues can be addressed sufficiently.
For example, [winit#1497][] tracks an implementation of input methods.
These are important for text input on all platforms, and are necessary to support text input on mobile.
Copy and paste support is another important feature which needs support to be brought into winit.
There is a draft pull request [winit#2156][] which implements this for a subset of platforms.

To meet user expectations, cross-platform applications also need to interface with the platform specific features which are otherwise outside the declared scope of winit.
winit's position on these is to provide APIs to allow them to be supported outside of.
As an example, on macOS, applications are expected to fill the menu bar, including where there are no windows.
However, this is currently not directly supported by Winit.

However, this is currently not directly supported by winit.
<!-- <https://github.com/rust-windowing/winit/pull/1583> -->

Menu bars, accessibility.
How to talk about accessibility?

Overall, our evaluation of winit is that it provides a strong foundation of support for most platforms.
However, it currently requires application developers to use a large number of external integrations for critical functionality, which add to the challenging
Expand All @@ -38,7 +44,8 @@ There have been efforts to produce external crates which support.
[tmix-01]: @/blog/2024-02-06-tmix-01.md
[druid-shell]: https://crates.io/crates/druid-shell
[winit]: https://crates.io/crates/winit
[bevy]: https://bevyengine.org/
[glazier]: https://github.com/linebender/glazier
[xilem]: https://github.com/linebender/xilem
[winit#2156]: https://github.com/rust-windowing/winit/pull/2156
[winit features]: https://github.com/rust-windowing/winit/blob/master/FEATURES.md
[winit#1497]: https://github.com/rust-windowing/winit/issues/1497

0 comments on commit 48dbb4b

Please sign in to comment.