mirror of
https://github.com/italicsjenga/winit-sonoma-fix.git
synced 2024-12-24 22:31:30 +11:00
wayland: handle Focused
event
This commit is contained in:
parent
6483e7f408
commit
c6f8ed2f81
|
@ -510,6 +510,8 @@ impl wl_keyboard::Handler for WaylandEnv {
|
|||
for &(ref window, ref eviter) in &self.windows {
|
||||
if window.equals(surface) {
|
||||
self.kbd_handler.handler().target = Some(eviter.clone());
|
||||
let mut guard = eviter.lock().unwrap();
|
||||
guard.push_back(Event::Focused(true));
|
||||
break
|
||||
}
|
||||
}
|
||||
|
@ -522,7 +524,10 @@ impl wl_keyboard::Handler for WaylandEnv {
|
|||
serial: u32,
|
||||
surface: &wl_surface::WlSurface)
|
||||
{
|
||||
self.kbd_handler.handler().target = None;
|
||||
if let Some(eviter) = self.kbd_handler.handler().target.take() {
|
||||
let mut guard = eviter.lock().unwrap();
|
||||
guard.push_back(Event::Focused(false));
|
||||
}
|
||||
self.kbd_handler.leave(evqh, proxy, serial, surface)
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue