@@ -3,6 +3,8 @@ use crate::core::{Point, Size};
33use crate :: futures:: MaybeSend ;
44use crate :: window:: Screenshot ;
55
6+ use raw_window_handle:: RawWindowHandle ;
7+
68use std:: fmt;
79
810/// An operation to be performed on some window.
@@ -81,6 +83,8 @@ pub enum Action<T> {
8183 ChangeLevel ( Id , Level ) ,
8284 /// Fetch the raw identifier unique to the window.
8385 FetchId ( Id , Box < dyn FnOnce ( u64 ) -> T + ' static > ) ,
86+ /// Fetch the raw window handle.
87+ FetchHandle ( Id , Box < dyn FnOnce ( RawWindowHandle ) -> T + ' static > ) ,
8488 /// Change the window [`Icon`].
8589 ///
8690 /// On Windows and X11, this is typically the small icon in the top-left
@@ -140,6 +144,9 @@ impl<T> Action<T> {
140144 Self :: FetchId ( id, o) => {
141145 Action :: FetchId ( id, Box :: new ( move |s| f ( o ( s) ) ) )
142146 }
147+ Self :: FetchHandle ( id, o) => {
148+ Action :: FetchHandle ( id, Box :: new ( move |s| f ( o ( s) ) ) )
149+ }
143150 Self :: ChangeIcon ( id, icon) => Action :: ChangeIcon ( id, icon) ,
144151 Self :: Screenshot ( id, tag) => Action :: Screenshot (
145152 id,
@@ -194,6 +201,7 @@ impl<T> fmt::Debug for Action<T> {
194201 write ! ( f, "Action::ChangeLevel({id:?}, {level:?})" )
195202 }
196203 Self :: FetchId ( id, _) => write ! ( f, "Action::FetchId({id:?})" ) ,
204+ Self :: FetchHandle ( id, _) => write ! ( f, "Action::FetchHandle({id:?})" ) ,
197205 Self :: ChangeIcon ( id, _icon) => {
198206 write ! ( f, "Action::ChangeIcon({id:?})" )
199207 }
0 commit comments