mirror of
https://github.com/weyne85/rustdesk.git
synced 2025-10-29 17:00:05 +00:00
feat, win virtual display
Signed-off-by: fufesou <shuanglongchen@yeah.net>
This commit is contained in:
@@ -102,6 +102,7 @@ message PeerInfo {
|
||||
SupportedEncoding encoding = 10;
|
||||
SupportedResolutions resolutions = 11;
|
||||
// Use JSON's key-value format which is friendly for peer to handle.
|
||||
// NOTE: Only support one-level dictionaries (for peer to update), and the key is of type string.
|
||||
string platform_additions = 12;
|
||||
}
|
||||
|
||||
@@ -498,6 +499,11 @@ message CaptureDisplays {
|
||||
repeated int32 set = 3;
|
||||
}
|
||||
|
||||
message ToggleVirtualDisplay {
|
||||
int32 display = 1;
|
||||
bool on = 2;
|
||||
}
|
||||
|
||||
message PermissionInfo {
|
||||
enum Permission {
|
||||
Keyboard = 0;
|
||||
@@ -697,6 +703,7 @@ message Misc {
|
||||
bool client_record_status = 29;
|
||||
CaptureDisplays capture_displays = 30;
|
||||
int32 refresh_video_display = 31;
|
||||
ToggleVirtualDisplay toggle_virtual_display = 32;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@ pub mod win10;
|
||||
#[cfg(windows)]
|
||||
use hbb_common::lazy_static;
|
||||
use hbb_common::{bail, ResultType};
|
||||
use std::path::Path;
|
||||
use std::path::PathBuf;
|
||||
|
||||
#[cfg(windows)]
|
||||
use std::sync::Mutex;
|
||||
@@ -33,17 +33,29 @@ pub fn download_driver() -> ResultType<()> {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
pub fn install_update_driver(_reboot_required: &mut bool) -> ResultType<()> {
|
||||
fn get_driver_install_abs_path() -> ResultType<PathBuf> {
|
||||
#[cfg(windows)]
|
||||
let install_path = win10::DRIVER_INSTALL_PATH;
|
||||
#[cfg(not(windows))]
|
||||
let install_path = "";
|
||||
bail!("Not implemented for non-windows");
|
||||
|
||||
let abs_path = Path::new(install_path).canonicalize()?;
|
||||
let exe_file = std::env::current_exe()?;
|
||||
let abs_path = match exe_file.parent() {
|
||||
Some(cur_dir) => cur_dir.join(install_path),
|
||||
None => bail!(
|
||||
"Invalid exe parent for {}",
|
||||
exe_file.to_string_lossy().as_ref()
|
||||
),
|
||||
};
|
||||
if !abs_path.exists() {
|
||||
bail!("{} not exists", install_path)
|
||||
}
|
||||
Ok(abs_path)
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
pub fn install_update_driver(_reboot_required: &mut bool) -> ResultType<()> {
|
||||
let abs_path = get_driver_install_abs_path()?;
|
||||
|
||||
#[cfg(windows)]
|
||||
unsafe {
|
||||
@@ -76,15 +88,7 @@ pub fn install_update_driver(_reboot_required: &mut bool) -> ResultType<()> {
|
||||
|
||||
#[no_mangle]
|
||||
pub fn uninstall_driver(_reboot_required: &mut bool) -> ResultType<()> {
|
||||
#[cfg(windows)]
|
||||
let install_path = win10::DRIVER_INSTALL_PATH;
|
||||
#[cfg(not(windows))]
|
||||
let install_path = "";
|
||||
|
||||
let abs_path = Path::new(install_path).canonicalize()?;
|
||||
if !abs_path.exists() {
|
||||
bail!("{} not exists", install_path)
|
||||
}
|
||||
let abs_path = get_driver_install_abs_path()?;
|
||||
|
||||
#[cfg(windows)]
|
||||
unsafe {
|
||||
|
||||
Reference in New Issue
Block a user