mirror of
https://github.com/rustdesk/rustdesk.git
synced 2026-03-21 20:21:09 +03:00
enable retina scale factor (#7269)
* enable retina scale factor * enabled only when there are only one video service running * scale mouse event * scale cursor position * scale remote menu display button * adjust resolution Signed-off-by: 21pages <pages21@163.com> * Update server.rs --------- Signed-off-by: 21pages <pages21@163.com> Co-authored-by: RustDesk <71636191+rustdesk@users.noreply.github.com>
This commit is contained in:
@@ -14,6 +14,7 @@ pub trait Service: Send + Sync {
|
||||
fn join(&self);
|
||||
fn get_option(&self, opt: &str) -> Option<String>;
|
||||
fn set_option(&self, opt: &str, val: &str) -> Option<String>;
|
||||
fn ok(&self) -> bool;
|
||||
}
|
||||
|
||||
pub trait Subscriber: Default + Send + Sync + 'static {
|
||||
@@ -142,6 +143,12 @@ impl<T: Subscriber + From<ConnInner>> Service for ServiceTmpl<T> {
|
||||
.options
|
||||
.insert(opt.to_string(), val.to_string())
|
||||
}
|
||||
|
||||
#[inline]
|
||||
fn ok(&self) -> bool {
|
||||
let lock = self.0.read().unwrap();
|
||||
lock.active && lock.has_subscribes()
|
||||
}
|
||||
}
|
||||
|
||||
impl<T: Subscriber + From<ConnInner>> Clone for ServiceTmpl<T> {
|
||||
@@ -180,12 +187,6 @@ impl<T: Subscriber + From<ConnInner>> ServiceTmpl<T> {
|
||||
self.0.read().unwrap().has_subscribes()
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn ok(&self) -> bool {
|
||||
let lock = self.0.read().unwrap();
|
||||
lock.active && lock.has_subscribes()
|
||||
}
|
||||
|
||||
pub fn snapshot<F>(&self, callback: F) -> ResultType<()>
|
||||
where
|
||||
F: FnMut(ServiceSwap<T>) -> ResultType<()>,
|
||||
|
||||
Reference in New Issue
Block a user