From 2c2421ae5dad9afce1058e67ae8bcabd787fa373 Mon Sep 17 00:00:00 2001 From: Héctor Ramón Jiménez Date: Fri, 17 Feb 2023 13:47:46 +0100 Subject: Expose `fetch_id` helper in `window` module --- winit/src/window.rs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/winit/src/window.rs b/winit/src/window.rs index 3d5a765b..961562bd 100644 --- a/winit/src/window.rs +++ b/winit/src/window.rs @@ -95,3 +95,12 @@ pub fn change_always_on_top(on_top: bool) -> Command { on_top, ))) } + +/// Fetches an identifier unique to the window. +pub fn fetch_id( + f: impl FnOnce(u64) -> Message + 'static, +) -> Command { + Command::single(command::Action::Window(window::Action::FetchId(Box::new( + f, + )))) +} -- cgit