Refreshing after ime input

This commit is contained in:
Jonathan Johnson 2023-10-19 15:03:47 -07:00
parent 983b6a97ad
commit dc6c22372b
No known key found for this signature in database
GPG key ID: A66D6A34D6620579
2 changed files with 7 additions and 2 deletions

View file

@ -1,4 +1,5 @@
use std::fmt::Debug;
use std::panic::AssertUnwindSafe;
use std::sync::{Arc, Condvar, Mutex, MutexGuard, PoisonError};
use kludgine::app::WindowHandle;
@ -20,7 +21,7 @@ impl<T> Dynamic<T> {
windows: Vec::new(),
readers: 0,
}),
sync: Condvar::new(),
sync: AssertUnwindSafe(Condvar::new()),
}))
}
@ -122,7 +123,10 @@ impl<T> From<Dynamic<T>> for DynamicRefReader<T> {
#[derive(Debug)]
struct DynamicData<T> {
state: Mutex<State<T>>,
sync: Condvar,
// The AssertUnwindSafe is only needed on Mac. For some reason on
// Mac OS, Condvar isn't RefUnwindSafe.
sync: AssertUnwindSafe<Condvar>,
}
impl<T> DynamicData<T> {

View file

@ -367,6 +367,7 @@ impl Widget for Input {
Ime::Commit(text) => {
self.editor_mut(context.kludgine, &Self::styles(&context.widget))
.insert_string(&text, None);
context.set_needs_redraw();
}
}