Skip to content

Commit e5ab222

Browse files
authored
feat(client): add --scale-desktop CLI option for display scaling factor (#1200)
Adds a new CLI flag to control the initial RDP “desktop scale factor” sent during connection setup, enabling display scaling (useful for HiDPI/4K setups) similarly to FreeRDP’s scaling option.
1 parent 49099f0 commit e5ab222

2 files changed

Lines changed: 5 additions & 2 deletions

File tree

crates/ironrdp-client/src/config.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -265,6 +265,10 @@ struct Args {
265265
#[clap(long)]
266266
small_cache: bool,
267267

268+
/// Scaling factor for desktop applications, percentage (value between 100 and 500)
269+
#[clap(long, value_parser = clap::value_parser!(u32).range(100..=500))]
270+
scale_desktop: Option<u32>,
271+
268272
/// Set required color depth. Currently only 32 and 16 bit color depths are supported
269273
#[clap(long)]
270274
color_depth: Option<u32>,
@@ -483,7 +487,7 @@ impl Config {
483487
width: DEFAULT_WIDTH,
484488
height: DEFAULT_HEIGHT,
485489
},
486-
desktop_scale_factor: 0, // Default to 0 per FreeRDP
490+
desktop_scale_factor: args.scale_desktop.unwrap_or(0), // Default to 0 per FreeRDP
487491
bitmap: Some(bitmap),
488492
client_build: semver::Version::parse(env!("CARGO_PKG_VERSION"))
489493
.map_or(0, |version| version.major * 100 + version.minor * 10 + version.patch)

crates/ironrdp-client/src/main.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ fn main() -> anyhow::Result<()> {
2121

2222
// TODO: get window size & scale factor from GUI/App
2323
let window_size = (1024, 768);
24-
config.connector.desktop_scale_factor = 0;
2524
config.connector.desktop_size.width = window_size.0;
2625
config.connector.desktop_size.height = window_size.1;
2726

0 commit comments

Comments
 (0)