Merge pull request #2456 from iced-rs/window-id-in-event-subscriptions
Introduce `window::Id` to `Event` subscriptions
This commit is contained in:
commit
e6d0b3bda5
25 changed files with 225 additions and 198 deletions
|
|
@ -172,7 +172,7 @@ where
|
|||
core::Event::Keyboard(keyboard_event) => {
|
||||
Some(Event::Keyboard(keyboard_event))
|
||||
}
|
||||
_ => None,
|
||||
core::Event::Window(_) => None,
|
||||
};
|
||||
|
||||
if let Some(canvas_event) = canvas_event {
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
#![allow(dead_code)]
|
||||
use crate::core::overlay;
|
||||
use crate::core::Element;
|
||||
|
||||
|
|
|
|||
|
|
@ -107,10 +107,10 @@ where
|
|||
Some(Event::Keyboard(keyboard_event))
|
||||
}
|
||||
core::Event::Touch(touch_event) => Some(Event::Touch(touch_event)),
|
||||
core::Event::Window(_, window::Event::RedrawRequested(instant)) => {
|
||||
core::Event::Window(window::Event::RedrawRequested(instant)) => {
|
||||
Some(Event::RedrawRequested(instant))
|
||||
}
|
||||
_ => None,
|
||||
core::Event::Window(_) => None,
|
||||
};
|
||||
|
||||
if let Some(custom_shader_event) = custom_shader_event {
|
||||
|
|
|
|||
|
|
@ -1003,14 +1003,14 @@ where
|
|||
|
||||
state.keyboard_modifiers = modifiers;
|
||||
}
|
||||
Event::Window(_, window::Event::Unfocused) => {
|
||||
Event::Window(window::Event::Unfocused) => {
|
||||
let state = state::<Renderer>(tree);
|
||||
|
||||
if let Some(focus) = &mut state.is_focused {
|
||||
focus.is_window_focused = false;
|
||||
}
|
||||
}
|
||||
Event::Window(_, window::Event::Focused) => {
|
||||
Event::Window(window::Event::Focused) => {
|
||||
let state = state::<Renderer>(tree);
|
||||
|
||||
if let Some(focus) = &mut state.is_focused {
|
||||
|
|
@ -1020,7 +1020,7 @@ where
|
|||
shell.request_redraw(window::RedrawRequest::NextFrame);
|
||||
}
|
||||
}
|
||||
Event::Window(_, window::Event::RedrawRequested(now)) => {
|
||||
Event::Window(window::Event::RedrawRequested(now)) => {
|
||||
let state = state::<Renderer>(tree);
|
||||
|
||||
if let Some(focus) = &mut state.is_focused {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue