On Windows and MacOS, add Window::has_focus
This commit is contained in:
parent
067535eb38
commit
a88d2e079d
17 changed files with 102 additions and 2 deletions
|
|
@ -930,6 +930,10 @@ impl<T: 'static> EventProcessor<T> {
|
|||
let window_id = mkwid(xev.event);
|
||||
let position = PhysicalPosition::new(xev.event_x, xev.event_y);
|
||||
|
||||
if let Some(window) = self.with_window(xev.event, Arc::clone) {
|
||||
window.shared_state_lock().has_focus = true;
|
||||
}
|
||||
|
||||
callback(Event::WindowEvent {
|
||||
window_id,
|
||||
event: Focused(true),
|
||||
|
|
@ -1002,6 +1006,10 @@ impl<T: 'static> EventProcessor<T> {
|
|||
event: WindowEvent::ModifiersChanged(ModifiersState::empty()),
|
||||
});
|
||||
|
||||
if let Some(window) = self.with_window(xev.event, Arc::clone) {
|
||||
window.shared_state_lock().has_focus = false;
|
||||
}
|
||||
|
||||
callback(Event::WindowEvent {
|
||||
window_id,
|
||||
event: Focused(false),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue