Skip to content

Commit 0b14048

Browse files
author
cossonleo
committed
add focus event
1 parent 0646280 commit 0b14048

2 files changed

Lines changed: 6 additions & 0 deletions

File tree

native/src/window/event.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,4 +29,7 @@ pub enum Event {
2929
/// There will be a single `FilesHoveredLeft` event triggered even if
3030
/// multiple files were hovered.
3131
FilesHoveredLeft,
32+
33+
/// A window was focused or not
34+
Focused(bool),
3235
}

winit/src/conversion.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,9 @@ pub fn window_event(
121121
WindowEvent::Touch(touch) => {
122122
Some(Event::Touch(touch_event(*touch, scale_factor)))
123123
}
124+
WindowEvent::Focused(focused) => {
125+
Some(Event::Window(window::Event::Focused(*focused)))
126+
}
124127
_ => None,
125128
}
126129
}

0 commit comments

Comments
 (0)