Skip to content

Commit

Permalink
Add evaluation of winit
Browse files Browse the repository at this point in the history
  • Loading branch information
DJMcNab committed Apr 17, 2024
1 parent 8b05bcd commit a978439
Showing 1 changed file with 44 additions and 0 deletions.
44 changes: 44 additions & 0 deletions content/blog/2024-04-24-winit-2024.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
+++
title = "Evaluating winit for cross-platform applications"
authors = ["Daniel McNab"]
+++

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

Linebender is working to develop cross-platform graphical user interfaces in Rust.
This naturally requires interaction 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).

<!-- ## 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.
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.

<!-- <https://github.com/rust-windowing/winit/pull/1583> -->

Menu bars, 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
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
[winit#2156]: https://github.com/rust-windowing/winit/pull/2156
[winit features]: https://github.com/rust-windowing/winit/blob/master/FEATURES.md

0 comments on commit a978439

Please sign in to comment.