From 83b0d1553fc6797c58641ed2a50b11ae62fd0523 Mon Sep 17 00:00:00 2001 From: Arnaud Ferraris Date: Mon, 4 Apr 2022 20:24:08 +0200 Subject: [PATCH] state: fix "wide mode" detection in portrait orientation We need to check if we should use the wide layout based on the *logical* display width, not its *physical* resolution. --- src/state.rs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/state.rs b/src/state.rs index 3f29a7ea..5254a940 100644 --- a/src/state.rs +++ b/src/state.rs @@ -245,7 +245,13 @@ impl Application { if px_size.width > px_size.height { px_size.width / 5 } else { - if (px_size.width < 540) & (px_size.width > 0) { + let abstract_width + = PixelSize { + scale_factor: output.scale as u32, + pixels: px_size.width, + } + .as_scaled_ceiling(); + if (abstract_width < 540) && (px_size.width > 0) { px_size.width * 7 / 12 // to match 360×210 } else { // Here we switch to wide layout, less height needed