diff options
Diffstat (limited to '')
-rw-r--r-- | native/src/command/action.rs | 8 | ||||
-rw-r--r-- | native/src/event.rs | 2 | ||||
-rw-r--r-- | native/src/window/id.rs | 3 |
3 files changed, 9 insertions, 4 deletions
diff --git a/native/src/command/action.rs b/native/src/command/action.rs index a6954f8f..924f95e6 100644 --- a/native/src/command/action.rs +++ b/native/src/command/action.rs @@ -20,7 +20,7 @@ pub enum Action<T> { Clipboard(clipboard::Action<T>), /// Run a window action. - Window(window::Action<T>), + Window(window::Id, window::Action<T>), /// Run a system action. System(system::Action<T>), @@ -46,7 +46,7 @@ impl<T> Action<T> { match self { Self::Future(future) => Action::Future(Box::pin(future.map(f))), Self::Clipboard(action) => Action::Clipboard(action.map(f)), - Self::Window(window) => Action::Window(window.map(f)), + Self::Window(id, window) => Action::Window(id, window.map(f)), Self::System(system) => Action::System(system.map(f)), Self::Widget(widget) => Action::Widget(widget.map(f)), } @@ -60,7 +60,9 @@ impl<T> fmt::Debug for Action<T> { Self::Clipboard(action) => { write!(f, "Action::Clipboard({:?})", action) } - Self::Window(action) => write!(f, "Action::Window({:?})", action), + Self::Window(id, action) => { + write!(f, "Action::Window({:?}, {:?})", id, action) + } Self::System(action) => write!(f, "Action::System({:?})", action), Self::Widget(_action) => write!(f, "Action::Widget"), } diff --git a/native/src/event.rs b/native/src/event.rs index bcfaf891..eb826399 100644 --- a/native/src/event.rs +++ b/native/src/event.rs @@ -19,7 +19,7 @@ pub enum Event { Mouse(mouse::Event), /// A window event - Window(window::Event), + Window(window::Id, window::Event), /// A touch event Touch(touch::Event), diff --git a/native/src/window/id.rs b/native/src/window/id.rs index 059cf4e7..5060e162 100644 --- a/native/src/window/id.rs +++ b/native/src/window/id.rs @@ -6,6 +6,9 @@ use std::hash::{Hash, Hasher}; pub struct Id(u64); impl Id { + /// TODO(derezzedex): maybe change `u64` to an enum `Type::{Single, Multi(u64)}` + pub const MAIN: Self = Id(0); + /// TODO(derezzedex) pub fn new(id: impl Hash) -> Id { let mut hasher = DefaultHasher::new(); |