Web: Implement MonitorHandle (#3801)

Requires getting permission from the user to get "detailed" support.
Also enables users to go fullscreen on specific monitors.
Exposes platform-specific orientation API.

Most functionality depends on browser support, currently only Chromium.
This commit is contained in:
daxpedda 2024-07-23 20:33:10 +02:00 committed by GitHub
parent 2e97ab3d4f
commit a0bc3e5dc8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
21 changed files with 1493 additions and 120 deletions

View file

@ -1,5 +1,7 @@
use std::cell::{Ref, RefCell};
use std::cmp;
use std::future::Future;
use std::hash::{Hash, Hasher};
use std::marker::PhantomData;
use std::sync::Arc;
@ -81,3 +83,29 @@ impl<V, S: Clone + Send, E> Clone for Wrapper<V, S, E> {
}
}
}
impl<V, S: Clone + Send, E> Eq for Wrapper<V, S, E> {}
impl<V, S: Clone + Send, E> Hash for Wrapper<V, S, E> {
fn hash<H: Hasher>(&self, state: &mut H) {
Arc::as_ptr(&self.value.value).hash(state)
}
}
impl<V, S: Clone + Send, E> Ord for Wrapper<V, S, E> {
fn cmp(&self, other: &Self) -> cmp::Ordering {
Arc::as_ptr(&self.value.value).cmp(&Arc::as_ptr(&other.value.value))
}
}
impl<V, S: Clone + Send, E> PartialOrd for Wrapper<V, S, E> {
fn partial_cmp(&self, other: &Self) -> Option<cmp::Ordering> {
Some(self.cmp(other))
}
}
impl<V, S: Clone + Send, E> PartialEq for Wrapper<V, S, E> {
fn eq(&self, other: &Self) -> bool {
Arc::ptr_eq(&self.value.value, &other.value.value)
}
}