Skip to content

Commit

Permalink
chore: adjust remote
Browse files Browse the repository at this point in the history
  • Loading branch information
Decodetalkers committed Sep 3, 2023
1 parent e50c478 commit 1074dd4
Showing 1 changed file with 13 additions and 12 deletions.
25 changes: 13 additions & 12 deletions src/remotedesktop.rs
Original file line number Diff line number Diff line change
Expand Up @@ -164,18 +164,6 @@ impl RemoteDesktopBackend {
_parent_window: String,
_options: HashMap<String, Value<'_>>,
) -> zbus::fdo::Result<PortalResponse<RemoteStartReturnValue>> {
let remote_sessions = REMOTE_SESSIONS.lock().await;
if let Some(session) = remote_sessions
.iter()
.find(|session| session.0 == session_handle.to_string())
{
return Ok(PortalResponse::Success(RemoteStartReturnValue {
streams: vec![Stream(session.1.node_id(), StreamProperties::default())],
..Default::default()
}));
}
drop(remote_sessions);

let locked_sessions = SESSIONS.lock().await;
let Some(index) = locked_sessions
.iter()
Expand All @@ -192,6 +180,19 @@ impl RemoteDesktopBackend {
let device_type = current_session.device_type;
drop(locked_sessions);

let remote_sessions = REMOTE_SESSIONS.lock().await;
if let Some(session) = remote_sessions
.iter()
.find(|session| session.0 == session_handle.to_string())
{
return Ok(PortalResponse::Success(RemoteStartReturnValue {
streams: vec![Stream(session.1.node_id(), StreamProperties::default())],
devices: device_type,
..Default::default()
}));
}
drop(remote_sessions);

// TODO: use slurp now
let show_cursor = current_session.cursor_mode.show_cursor();
let connection = libwayshot::WayshotConnection::new().unwrap();
Expand Down

0 comments on commit 1074dd4

Please sign in to comment.