mirror of
https://github.com/weyne85/rustdesk.git
synced 2025-10-29 17:00:05 +00:00
@@ -56,6 +56,7 @@ pub struct Remote<T: InvokeUiSession> {
|
||||
data_count: Arc<AtomicUsize>,
|
||||
frame_count: Arc<AtomicUsize>,
|
||||
video_format: CodecFormat,
|
||||
elevation_requested: bool,
|
||||
}
|
||||
|
||||
impl<T: InvokeUiSession> Remote<T> {
|
||||
@@ -87,6 +88,7 @@ impl<T: InvokeUiSession> Remote<T> {
|
||||
video_format: CodecFormat::Unknown,
|
||||
stop_voice_call_sender: None,
|
||||
voice_call_request_timestamp: None,
|
||||
elevation_requested: false,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -686,6 +688,7 @@ impl<T: InvokeUiSession> Remote<T> {
|
||||
let mut msg = Message::new();
|
||||
msg.set_misc(misc);
|
||||
allow_err!(peer.send(&msg).await);
|
||||
self.elevation_requested = true;
|
||||
}
|
||||
Data::ElevateWithLogon(username, password) => {
|
||||
let mut request = ElevationRequest::new();
|
||||
@@ -699,6 +702,7 @@ impl<T: InvokeUiSession> Remote<T> {
|
||||
let mut msg = Message::new();
|
||||
msg.set_misc(misc);
|
||||
allow_err!(peer.send(&msg).await);
|
||||
self.elevation_requested = true;
|
||||
}
|
||||
Data::NewVoiceCall => {
|
||||
let msg = new_voice_call_request(true);
|
||||
@@ -1181,7 +1185,8 @@ impl<T: InvokeUiSession> Remote<T> {
|
||||
}
|
||||
}
|
||||
Some(misc::Union::PortableServiceRunning(b)) => {
|
||||
if b {
|
||||
self.handler.portable_service_running(b);
|
||||
if self.elevation_requested && b {
|
||||
self.handler.msgbox(
|
||||
"custom-nocancel-success",
|
||||
"Successful",
|
||||
@@ -1253,14 +1258,12 @@ impl<T: InvokeUiSession> Remote<T> {
|
||||
}
|
||||
}
|
||||
}
|
||||
Some(message::Union::PeerInfo(pi)) => {
|
||||
match pi.conn_id {
|
||||
crate::SYNC_PEER_INFO_DISPLAYS => {
|
||||
self.handler.set_displays(&pi.displays);
|
||||
}
|
||||
_ => {}
|
||||
Some(message::Union::PeerInfo(pi)) => match pi.conn_id {
|
||||
crate::SYNC_PEER_INFO_DISPLAYS => {
|
||||
self.handler.set_displays(&pi.displays);
|
||||
}
|
||||
}
|
||||
_ => {}
|
||||
},
|
||||
_ => {}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -572,6 +572,13 @@ impl InvokeUiSession for FlutterHandler {
|
||||
self.push_event("switch_back", [("peer_id", peer_id)].into());
|
||||
}
|
||||
|
||||
fn portable_service_running(&self, running: bool) {
|
||||
self.push_event(
|
||||
"portable_service_running",
|
||||
[("running", running.to_string().as_str())].into(),
|
||||
);
|
||||
}
|
||||
|
||||
fn on_voice_call_started(&self) {
|
||||
self.push_event("on_voice_call_started", [].into());
|
||||
}
|
||||
|
||||
@@ -1552,7 +1552,6 @@ impl Connection {
|
||||
.err()
|
||||
.map_or("".to_string(), |e| e.to_string());
|
||||
}
|
||||
self.portable.elevation_requested = err.is_empty();
|
||||
let mut misc = Misc::new();
|
||||
misc.set_elevation_response(err);
|
||||
let mut msg = Message::new();
|
||||
@@ -1571,7 +1570,6 @@ impl Connection {
|
||||
.err()
|
||||
.map_or("".to_string(), |e| e.to_string());
|
||||
}
|
||||
self.portable.elevation_requested = err.is_empty();
|
||||
let mut misc = Misc::new();
|
||||
misc.set_elevation_response(err);
|
||||
let mut msg = Message::new();
|
||||
@@ -1936,13 +1934,11 @@ impl Connection {
|
||||
let p = &mut self.portable;
|
||||
if running != p.last_running {
|
||||
p.last_running = running;
|
||||
if running && p.elevation_requested {
|
||||
let mut misc = Misc::new();
|
||||
misc.set_portable_service_running(running);
|
||||
let mut msg = Message::new();
|
||||
msg.set_misc(misc);
|
||||
self.inner.send(msg.into());
|
||||
}
|
||||
let mut misc = Misc::new();
|
||||
misc.set_portable_service_running(running);
|
||||
let mut msg = Message::new();
|
||||
msg.set_misc(misc);
|
||||
self.inner.send(msg.into());
|
||||
}
|
||||
let uac = crate::video_service::IS_UAC_RUNNING.lock().unwrap().clone();
|
||||
if p.last_uac != uac {
|
||||
@@ -2166,7 +2162,6 @@ pub struct PortableState {
|
||||
pub last_foreground_window_elevated: bool,
|
||||
pub last_running: bool,
|
||||
pub is_installed: bool,
|
||||
pub elevation_requested: bool,
|
||||
}
|
||||
|
||||
#[cfg(windows)]
|
||||
@@ -2177,7 +2172,6 @@ impl Default for PortableState {
|
||||
last_uac: Default::default(),
|
||||
last_foreground_window_elevated: Default::default(),
|
||||
last_running: Default::default(),
|
||||
elevation_requested: Default::default(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -277,6 +277,8 @@ impl InvokeUiSession for SciterHandler {
|
||||
|
||||
fn switch_back(&self, _id: &str) {}
|
||||
|
||||
fn portable_service_running(&self, _running: bool) {}
|
||||
|
||||
fn on_voice_call_started(&self) {
|
||||
self.call("onVoiceCallStart", &make_args!());
|
||||
}
|
||||
|
||||
@@ -805,6 +805,7 @@ pub trait InvokeUiSession: Send + Sync + Clone + 'static + Sized + Default {
|
||||
fn clipboard(&self, content: String);
|
||||
fn cancel_msgbox(&self, tag: &str);
|
||||
fn switch_back(&self, id: &str);
|
||||
fn portable_service_running(&self, running: bool);
|
||||
fn on_voice_call_started(&self);
|
||||
fn on_voice_call_closed(&self, reason: &str);
|
||||
fn on_voice_call_waiting(&self);
|
||||
|
||||
Reference in New Issue
Block a user