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:
parent
5b2f960438
commit
d6dae4fc90
@ -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();
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user