VNOX-Client/patches/i-slint-backend-winit
loki5512344 f04691c3cd
chore(client): checkpoint deployed features and unfinished server management
User requested a checkpoint and stopped all agents. Deployed artifacts remain the last verified releases; unfinished settings/categories/forums are preserved as WIP. See TODO/roadmap for verification and remaining release/updater work.
2026-11-01 15:31:21 +01:00
..
frame_throttle feat(client): redesign native UI, themes, settings and avatars 2026-10-24 14:23:48 +02:00
ios feat(client): redesign native UI, themes, settings and avatars 2026-10-24 14:23:48 +02:00
LICENSES feat(client): redesign native UI, themes, settings and avatars 2026-10-24 14:23:48 +02:00
renderer feat(client): redesign native UI, themes, settings and avatars 2026-10-24 14:23:48 +02:00
tests feat(client): redesign native UI, themes, settings and avatars 2026-10-24 14:23:48 +02:00
accesskit.rs feat(client): redesign native UI, themes, settings and avatars 2026-10-24 14:23:48 +02:00
build.rs feat(client): redesign native UI, themes, settings and avatars 2026-10-24 14:23:48 +02:00
Cargo.toml feat(client): redesign native UI, themes, settings and avatars 2026-10-24 14:23:48 +02:00
clipboard.rs feat(client): redesign native UI, themes, settings and avatars 2026-10-24 14:23:48 +02:00
COPYING feat(client): redesign native UI, themes, settings and avatars 2026-10-24 14:23:48 +02:00
drag_resize_window.rs feat(client): redesign native UI, themes, settings and avatars 2026-10-24 14:23:48 +02:00
event_loop.rs feat(client): redesign native UI, themes, settings and avatars 2026-10-24 14:23:48 +02:00
frame_throttle.rs feat(client): redesign native UI, themes, settings and avatars 2026-10-24 14:23:48 +02:00
ios.rs feat(client): redesign native UI, themes, settings and avatars 2026-10-24 14:23:48 +02:00
keyboard_shortcuts.rs chore(client): checkpoint deployed features and unfinished server management 2026-11-01 15:31:21 +01:00
lib.rs chore(client): checkpoint deployed features and unfinished server management 2026-11-01 15:31:21 +01:00
macos.rs feat(client): redesign native UI, themes, settings and avatars 2026-10-24 14:23:48 +02:00
muda.rs feat(client): redesign native UI, themes, settings and avatars 2026-10-24 14:23:48 +02:00
README.md feat(client): redesign native UI, themes, settings and avatars 2026-10-24 14:23:48 +02:00
touch_finger_id.rs feat(client): redesign native UI, themes, settings and avatars 2026-10-24 14:23:48 +02:00
VNOX-PATCH.md feat(client): redesign native UI, themes, settings and avatars 2026-10-24 14:23:48 +02:00
wasm_input_helper.rs feat(client): redesign native UI, themes, settings and avatars 2026-10-24 14:23:48 +02:00
winit_compat.rs feat(client): redesign native UI, themes, settings and avatars 2026-10-24 14:23:48 +02:00
winitwindowadapter.rs chore(client): checkpoint deployed features and unfinished server management 2026-11-01 15:31:21 +01:00
xdg_desktop_settings.rs feat(client): redesign native UI, themes, settings and avatars 2026-10-24 14:23:48 +02:00

NOTE: This library is an internal crate of the Slint project. This crate should not be used directly by applications using Slint. You should use the slint crate instead.

WARNING: This crate does not follow the semver convention for versioning and can only be used with version = "=x.y.z" in Cargo.toml.

The Slint winit Backend

This crate implements the winit backend/platform for Slint. It is enabled by default as a default feature of the slint crate.

Although this crate is primarily internal, it can also be used by applications to leverage the full power of [winit::window::Window] for Slint Window.

To use this functionality, you need to be cautious when importing dependencies since this crate does not adhere to semver and may introduce breaking changes in any patch release. Additionally, the version of this crate must match the version of Slint. To indicate that you specifically want this version, include the = symbol in the version string.

Make sure that the version of winit matches the version used by this crate. Check this crate's dependencies to determine the required version.

[dependencies]
slint = { version = "x.y.z", ... }
i-slint-backend-winit = "=x.y.z"
winit = "0.w"

To ensure that the runtime backend is selected, initialize the backend as the first step in the main function:

slint::platform::set_platform(Box::new(i_slint_backend_winit::Backend::new().unwrap()));
// ...

Once you have a slint::Window (accessible through the window() function of the generated component), you can utilize the [WinitWindowAccessor::with_winit_window] function to access the [winit::window::Window] object.

# // similar to code generated by the slint! macro
# struct C; impl C { fn window(&self) ->i_slint_core::api::Window {todo!()} }
# let my_ui = C;
use i_slint_backend_winit::WinitWindowAccessor; // import the trait
my_ui.window().with_winit_window(|winit_window: &winit::window::Window| {
    // Here, you can use the winit API
});