From 0ebf6a8d5b5971c87d47463d4d27cca9df88f8d8 Mon Sep 17 00:00:00 2001 From: Richard Acayan Date: Mon, 26 Aug 2024 18:20:25 -0400 Subject: [PATCH] wayland: truncate scaled width and height on configure When a configure event is emitted, the updated graphical dimensions are sent unscaled. Currently, the application applies fractional scaling to the dimensions by truncating the scale to an integer. This is incorrect, as scales could be fractional and the compositor would expect the fractional scale to be applied to the width and height. Truncate the width and height after scaling instead of truncating the scale to reduce the right and bottom seams to 0-1 pixels. --- src/wayland/dispatcher.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/wayland/dispatcher.rs b/src/wayland/dispatcher.rs index 74b96e6..407f1db 100644 --- a/src/wayland/dispatcher.rs +++ b/src/wayland/dispatcher.rs @@ -412,8 +412,8 @@ impl Dispatch for Dispatcher { let layout = ctx.seat.layout(); let mod_state = ctx.seat.mod_state(); - let scale = gfx.display().scale() / 120; - let (width, height) = (width * scale, height * scale); + let scale = gfx.display().scale(); + let (width, height) = (width * scale / 120, height * scale / 120); gfx.resize(layout, mod_state, width, height); let disp = gfx.display();