From f597f71e9bc2959c580d6c10441249a2a2f61282 Mon Sep 17 00:00:00 2001 From: podulator Date: Thu, 26 Nov 2026 10:15:31 +0100 Subject: [PATCH] X11: port the fix for repeated suggested scale factors (#358) to next handle_host_suggest_scale_factor() converted the current physical size back to logical pixels with a scale of 1.0 instead of the scale in use, so a second suggested scale compounded on the first. #358 fixed this on master after next branched; this is the same change on next. --- src/platform/x11/sizing.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/platform/x11/sizing.rs b/src/platform/x11/sizing.rs index 9df1b3d1..da4f0833 100644 --- a/src/platform/x11/sizing.rs +++ b/src/platform/x11/sizing.rs @@ -111,6 +111,7 @@ impl SizingState { pub fn handle_host_suggest_scale_factor( &self, scale: f64, handler: &Handler, shared: &WindowShared, ) -> Result { + let previous_scale = shared.sizing_state.scale_factor(); shared.sizing_state.host_suggested_scale_factor.set(Some(scale)); // If the scaling factor is already provided by the system, do nothing @@ -118,7 +119,7 @@ impl SizingState { return Ok(false); }; - let current_logical_size = shared.sizing_state.size().to_logical::(1.0); + let current_logical_size = shared.sizing_state.size().to_logical::(previous_scale); let new_physical_size = current_logical_size.to_physical(scale); shared.sizing_state.resize_from_host(new_physical_size, handler, shared)?;