-
Notifications
You must be signed in to change notification settings - Fork 912
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
WinRT instead of Win32 #1564
Comments
I would be worried about sacrificing compat with older systems, but I don't know the current Windows OS requirements. |
WinRT windowing APIs are supported from Windows 8.0. As of January 14, Windows 7 support ended which means that supporting only WinRT is enough to say: "runs on every supported Windows". Nonetheless, that isn't the problem. WinRT path should and must be reserved for The problem with WinRT windowing APIs (see CoreWindow) is that they must run in sandbox if I remember correctly from reading about It. The create https://github.com/microsoft/winrt-rs doesn't solve this problem in itself. This requires adding supporting stuff to rustc and cargo itself, for example generating manifest file at least. |
There are uwp targets for both gnu and msvc triples in rustc now. |
This feature request is rooted in the false premise, that the classic Win32 windowing system and that of the Windows Runtime were distinct and unrelated implementations. That's not the case, though. The Windows Runtime's CoreWindow sits on top of the classic Win32 windowing stack. At its core it still relies on an In its current shape, winit provides everything required to host a Windows Runtime-based UI. The Rust/WinRT repo links to a sample application (Minesweeper), that showcases how to host a In other words: winit and Rust/WinRT aren't orthogonal. They are complementary. Implementing Windows Runtime-specific infrastructure in winit is likely going to result in duplication, that eventually no one will be using anymore once Rust/WinRT has stabilized. |
Understood. Please close this issue if it doesn't make sense / isn't desirable 👍 |
@tim-weis Does winit's Win32 backend allow one to build for a uwp target (and, for example, publish on the Microsoft Store)? If not, would a WinRT backend allow for that? |
@tangmi The Universal Windows Platform limits the Win32 API surface available to client code. winit's Win32 backend calls into CreateWindowEx to create a window, for example. That API is available to "desktop apps only". I'm sure there are many other API calls that aren't available when targeting the UWP. A hypothetical backend based around the CoreApplication Windows Runtime type is possible, in theory. That'd still require a lot of supporting infrastructure, from exposing COM interfaces through Rust all the way to implementing a build system that can package the binary artifacts and register it for local debugging. That infrastructure is a large portion of what Rust/WinRT is going to deliver. Two points are worth noting:
|
If MS wants apps to move towards WinRT going forward, having winit support seems to me like a "nice to have". I don't imagine (just guessing, though!) other targets like mobile, xbox, hololens, etc are built on Win32 like the desktop target is, so supporting those platforms with winit would need a WinRT backend. It might be worth it to revisit WinRT support when Rust/WinRT has all the needed interfaces exposed. |
As the current Windows maintainer, I'm not opposed to having a |
I have no idea whether this is possible / desirable, but wanted to throw this out there.
I've vaguely had the impression that Microsoft prefers new applications to be written using WinRT rather than Win32.
WinRT has been hard to support in Rust until the recent announcement of
winrt-rs
: https://github.com/microsoft/winrt-rsI have no idea how much work it would be to port winit's windows implementation to WinRT, though curious if it potentially offers advatages of WinRT such as easier theming support for winit applications.
The text was updated successfully, but these errors were encountered: