Web: remove queuing fullscreen request (#3242)

This commit is contained in:
daxpedda 2023-12-17 13:31:48 +01:00 committed by GitHub
parent af93167237
commit f2c5127f27
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 79 additions and 199 deletions

View file

@ -67,7 +67,6 @@ pub struct Execution {
on_key_press: OnEventHandle<KeyboardEvent>,
on_key_release: OnEventHandle<KeyboardEvent>,
on_visibility_change: OnEventHandle<web_sys::Event>,
on_touch_end: OnEventHandle<web_sys::Event>,
}
enum RunnerEnum {
@ -181,7 +180,6 @@ impl Shared {
on_key_press: RefCell::new(None),
on_key_release: RefCell::new(None),
on_visibility_change: RefCell::new(None),
on_touch_end: RefCell::new(None),
}
}))
}
@ -342,8 +340,6 @@ impl Shared {
self.window().clone(),
"pointerdown",
Closure::new(move |event: PointerEvent| {
runner.transient_activation();
if !runner.device_events() {
return;
}
@ -367,8 +363,6 @@ impl Shared {
self.window().clone(),
"pointerup",
Closure::new(move |event: PointerEvent| {
runner.transient_activation();
if !runner.device_events() {
return;
}
@ -392,8 +386,6 @@ impl Shared {
self.window().clone(),
"keydown",
Closure::new(move |event: KeyboardEvent| {
runner.transient_activation();
if !runner.device_events() {
return;
}
@ -452,14 +444,6 @@ impl Shared {
}
}),
));
let runner = self.clone();
*self.0.on_touch_end.borrow_mut() = Some(EventListenerHandle::new(
self.window().clone(),
"touchend",
Closure::new(move |_| {
runner.transient_activation();
}),
));
}
// Generate a strictly increasing ID
@ -788,18 +772,6 @@ impl Shared {
}
}
fn transient_activation(&self) {
self.0
.all_canvases
.borrow()
.iter()
.for_each(|(_, canvas, _)| {
if let Some(canvas) = canvas.upgrade() {
canvas.borrow().transient_activation();
}
});
}
pub fn event_loop_recreation(&self, allow: bool) {
self.0.event_loop_recreation.set(allow)
}