Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/platform/x11/sizing.rs
Original file line number Diff line number Diff line change
Expand Up @@ -111,14 +111,15 @@ impl SizingState {
pub fn handle_host_suggest_scale_factor(
&mut self, scale: f64, handler: &Handler, shared: &WindowShared,
) -> Result<(), PlatformError> {
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
if shared.sizing_state.system_scale_factor.get().is_some() {
return Ok(());
};

let current_logical_size = shared.sizing_state.size().to_logical::<f64>(1.0);
let current_logical_size = shared.sizing_state.size().to_logical::<f64>(previous_scale);
let new_physical_size = current_logical_size.to_physical(scale);

shared.sizing_state.resize_from_host(new_physical_size, handler, shared)
Expand Down