Web Async Rework (#3082)

This commit is contained in:
daxpedda
2023-10-16 15:50:22 +02:00
committed by Kirill Chibisov
parent f3fb27c17b
commit 70e6ddd210
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,