Web Async Rework (#3082)

This commit is contained in:
daxpedda 2023-10-16 15:50:22 +02:00 committed by GitHub
parent ef34692148
commit 48f6582eb4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
12 changed files with 653 additions and 421 deletions

View file

@ -1,6 +1,5 @@
use std::cell::Cell;
use std::rc::{Rc, Weak};
use std::sync::atomic::AtomicBool;
use std::sync::{Arc, Mutex};
use smol_str::SmolStr;
@ -29,7 +28,7 @@ use super::{event, ButtonsState, ResizeScaleHandle};
pub struct Canvas {
common: Common,
id: WindowId,
pub has_focus: Arc<AtomicBool>,
pub has_focus: Rc<Cell<bool>>,
pub is_intersecting: Option<bool>,
on_touch_start: Option<EventListenerHandle<dyn FnMut(Event)>>,
on_focus: Option<EventListenerHandle<dyn FnMut(FocusEvent)>>,
@ -139,7 +138,7 @@ impl Canvas {
Ok(Canvas {
common,
id,
has_focus: Arc::new(AtomicBool::new(false)),
has_focus: Rc::new(Cell::new(false)),
is_intersecting: None,
on_touch_start: None,
on_blur: None,