1
1
mirror of https://github.com/wez/wezterm.git synced 2024-11-22 22:42:48 +03:00

Implement shutdown for ime

This commit is contained in:
Timmy Xiao 2024-01-23 00:44:22 -08:00 committed by Wez Furlong
parent 5b2f960438
commit d6dae4fc90
No known key found for this signature in database
GPG Key ID: 7A7F66A31EC9B387

View File

@ -106,6 +106,22 @@ impl TextInputState {
.keyboard_to_seat
.insert(keyboard_id, seat_id);
}
/// Workaround for <https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/4776>
/// If we make sure to disable things before we close the app,
/// mutter is less likely to get in a bad state
pub fn shutdown(&self) {
self.inner.lock().unwrap().disable_all();
}
}
impl Inner {
fn disable_all(&mut self) {
for input in self.input_by_seat.values() {
input.disable();
input.commit();
}
}
}
#[derive(Default)]
@ -203,3 +219,9 @@ impl WaylandState {
}
}
}
impl Drop for WaylandState {
fn drop(&mut self) {
self.text_input.shutdown();
}
}