fix(wayland): fix keyboard holding onto surfaces without causing visual or functional issues
Signed-off-by: Schmarni <marnistromer@gmail.com>
This commit is contained in:
@@ -108,6 +108,12 @@ impl SeatWrapper {
|
||||
touches: Mutex::new(FxHashMap::default()),
|
||||
}
|
||||
}
|
||||
pub fn unfocus_internal_state(&self, surface: &WlSurface) {
|
||||
let Some(state) = self.wayland_state.upgrade() else {
|
||||
return;
|
||||
};
|
||||
self.unfocus(surface, &mut state.lock());
|
||||
}
|
||||
pub fn unfocus(&self, surface: &WlSurface, state: &mut WaylandState) {
|
||||
let pointer = self.seat.get_pointer().unwrap();
|
||||
if pointer.current_focus() == Some(surface.clone()) {
|
||||
|
||||
@@ -472,6 +472,7 @@ impl Backend for XdgBackend {
|
||||
|
||||
fn close_toplevel(&self) {
|
||||
if let Some(toplevel) = self.toplevel.lock().clone() {
|
||||
self.seat.unfocus_internal_state(toplevel.wl_surface());
|
||||
toplevel.send_close();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user