summaryrefslogtreecommitdiffstats
path: root/winit
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2021-01-15 18:21:44 +0100
committerLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2021-01-15 18:21:44 +0100
commit45dc02e9bd0b4f2c6cc65781b850f460cddf6171 (patch)
treeaa9c1c3808f9831a930a803b9dc7ba894248cfc1 /winit
parent0b140488b425a7d1fd45ca41592de25b28d3ac17 (diff)
downloadiced-45dc02e9bd0b4f2c6cc65781b850f460cddf6171.tar.gz
iced-45dc02e9bd0b4f2c6cc65781b850f460cddf6171.tar.bz2
iced-45dc02e9bd0b4f2c6cc65781b850f460cddf6171.zip
Split `window::Event::Focused` into two variants
Diffstat (limited to 'winit')
-rw-r--r--winit/src/conversion.rs8
1 files changed, 5 insertions, 3 deletions
diff --git a/winit/src/conversion.rs b/winit/src/conversion.rs
index 5265b844..0e04b35d 100644
--- a/winit/src/conversion.rs
+++ b/winit/src/conversion.rs
@@ -109,6 +109,11 @@ pub fn window_event(
WindowEvent::ModifiersChanged(new_modifiers) => Some(Event::Keyboard(
keyboard::Event::ModifiersChanged(self::modifiers(*new_modifiers)),
)),
+ WindowEvent::Focused(focused) => Some(Event::Window(if *focused {
+ window::Event::Focused
+ } else {
+ window::Event::Unfocused
+ })),
WindowEvent::HoveredFile(path) => {
Some(Event::Window(window::Event::FileHovered(path.clone())))
}
@@ -121,9 +126,6 @@ pub fn window_event(
WindowEvent::Touch(touch) => {
Some(Event::Touch(touch_event(*touch, scale_factor)))
}
- WindowEvent::Focused(focused) => {
- Some(Event::Window(window::Event::Focused(*focused)))
- }
_ => None,
}
}