mirror of
https://github.com/rustdesk/rustdesk.git
synced 2026-03-23 21:21:05 +03:00
change resolution, macos needs more tests
Signed-off-by: fufesou <shuanglongchen@yeah.net>
This commit is contained in:
@@ -44,6 +44,24 @@ pub fn breakdown_callback() {
|
||||
crate::input_service::release_device_modifiers();
|
||||
}
|
||||
|
||||
#[cfg(not(any(target_os = "android", target_os = "ios")))]
|
||||
pub fn change_resolution(name: &str, width: usize, height: usize) -> ResultType<()> {
|
||||
hbb_common::log::warn!("Change resolution of '{}' to ({},{})", name, width, height);
|
||||
|
||||
let cur_resolution = current_resolution(name)?;
|
||||
// For MacOS
|
||||
// to-do: Make sure the following comparison works.
|
||||
// For Linux
|
||||
// Just run "xrandr", dpi may not be taken into consideration.
|
||||
// For Windows
|
||||
// dmPelsWidth and dmPelsHeight is the same to width and height
|
||||
// Because this process is running in dpi awareness mode.
|
||||
if cur_resolution.width as usize == width && cur_resolution.height as usize == height {
|
||||
return Ok(());
|
||||
}
|
||||
change_resolution_directly(name, width, height)
|
||||
}
|
||||
|
||||
// Android
|
||||
#[cfg(target_os = "android")]
|
||||
pub fn get_active_username() -> String {
|
||||
|
||||
Reference in New Issue
Block a user