better support for non-send-sync

This commit is contained in:
Jack Mac 2021-09-26 22:27:19 -04:00
parent 9b6f6c0fb8
commit 63267ddf56
2 changed files with 3 additions and 3 deletions

View File

@ -243,7 +243,7 @@ impl Context {
platform_name: None, platform_name: None,
renderer_name: None, renderer_name: None,
clipboard_ctx: Box::new(ClipboardContext::dummy().into()), clipboard_ctx: Box::new(ClipboardContext::dummy().into()),
ui: Ui(()), ui: Ui(().into()),
} }
} }
fn is_current_context(&self) -> bool { fn is_current_context(&self) -> bool {
@ -329,7 +329,7 @@ impl SuspendedContext {
platform_name: None, platform_name: None,
renderer_name: None, renderer_name: None,
clipboard_ctx: Box::new(ClipboardContext::dummy().into()), clipboard_ctx: Box::new(ClipboardContext::dummy().into()),
ui: Ui(()), ui: Ui(().into()),
}; };
if ctx.is_current_context() { if ctx.is_current_context() {
// Oops, the context was activated -> deactivate // Oops, the context was activated -> deactivate

View File

@ -118,7 +118,7 @@ impl Context {
/// A temporary reference for building the user interface for one frame /// A temporary reference for building the user interface for one frame
#[derive(Debug)] #[derive(Debug)]
pub struct Ui(pub(crate) ()); pub struct Ui(pub(crate) cell::UnsafeCell<()>);
/// This is our internal buffer that we use for the Ui object. /// This is our internal buffer that we use for the Ui object.
/// ///