diff options
author | 2023-02-17 14:10:08 +0100 | |
---|---|---|
committer | 2023-02-17 14:10:08 +0100 | |
commit | c2a5f0592465c5db2d0f95fad345c0c190870654 (patch) | |
tree | 6b91e3eca2fc76a8f8e430f8020ac25abb64f470 /native | |
parent | b9b0a9a1f400483f46ec053247c435ec7739f778 (diff) | |
parent | 2c2421ae5dad9afce1058e67ae8bcabd787fa373 (diff) | |
download | iced-c2a5f0592465c5db2d0f95fad345c0c190870654.tar.gz iced-c2a5f0592465c5db2d0f95fad345c0c190870654.tar.bz2 iced-c2a5f0592465c5db2d0f95fad345c0c190870654.zip |
Merge pull request #1589 from Night-Hunter-NF/FetchWindowId
add action to get window id
Diffstat (limited to 'native')
-rw-r--r-- | native/src/window/action.rs | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/native/src/window/action.rs b/native/src/window/action.rs index c6361449..ce36d129 100644 --- a/native/src/window/action.rs +++ b/native/src/window/action.rs @@ -76,6 +76,8 @@ pub enum Action<T> { /// /// - **Web / Wayland:** Unsupported. ChangeAlwaysOnTop(bool), + /// Fetch an identifier unique to the window. + FetchId(Box<dyn FnOnce(u64) -> T + 'static>), } impl<T> Action<T> { @@ -105,6 +107,7 @@ impl<T> Action<T> { Self::ChangeAlwaysOnTop(on_top) => { Action::ChangeAlwaysOnTop(on_top) } + Self::FetchId(o) => Action::FetchId(Box::new(move |s| f(o(s)))), } } } @@ -138,6 +141,7 @@ impl<T> fmt::Debug for Action<T> { Self::ChangeAlwaysOnTop(on_top) => { write!(f, "Action::AlwaysOnTop({on_top})") } + Self::FetchId(_) => write!(f, "Action::FetchId"), } } } |