On Wayland send Focused(false) for new window

On Wayland winit will always get an explicit focused event from the
system and will transfer it downstream. So send focused false to enforce
it.
This commit is contained in:
Kirill Chibisov 2022-07-09 18:17:41 +03:00 committed by GitHub
parent a06bb3f992
commit 78f1d1df38
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -254,6 +254,12 @@ impl Window {
winit_state.window_map.insert(window_id, window_handle); winit_state.window_map.insert(window_id, window_handle);
// On Wayland window doesn't have Focus by default and it'll get it later on. So be
// explicit here.
winit_state
.event_sink
.push_window_event(crate::event::WindowEvent::Focused(false), window_id);
winit_state winit_state
.window_updates .window_updates
.insert(window_id, WindowUpdate::new()); .insert(window_id, WindowUpdate::new());