diff --git a/src/dynamic.rs b/src/dynamic.rs index 68fb8f7..9d1f934 100644 --- a/src/dynamic.rs +++ b/src/dynamic.rs @@ -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 Dynamic { windows: Vec::new(), readers: 0, }), - sync: Condvar::new(), + sync: AssertUnwindSafe(Condvar::new()), })) } @@ -122,7 +123,10 @@ impl From> for DynamicRefReader { #[derive(Debug)] struct DynamicData { state: Mutex>, - sync: Condvar, + + // The AssertUnwindSafe is only needed on Mac. For some reason on + // Mac OS, Condvar isn't RefUnwindSafe. + sync: AssertUnwindSafe, } impl DynamicData { diff --git a/src/widgets/input.rs b/src/widgets/input.rs index cae02f5..ac6b406 100644 --- a/src/widgets/input.rs +++ b/src/widgets/input.rs @@ -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(); } }