From 5eeaadccead599f61c41bf3491a26b56082f3411 Mon Sep 17 00:00:00 2001 From: Elias Naur Date: Sat, 2 Nov 2019 17:58:56 +0100 Subject: [PATCH] app/internal/window: apply font scale to dp scaling on Wayland As discussed in gio#53, Linux font scales conflate two settings: the fractional UI scale and the user preference as a result of conditions such as impaired vision. The former setting should apply to both dps and sps, while the latter only to sps. However, with the assumption that more users presumable change the font scale for the former reason rather than the latter, we should apply the font scale to both dps and sps in Gio. Signed-off-by: Elias Naur --- app/internal/window/os_wayland.go | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/app/internal/window/os_wayland.go b/app/internal/window/os_wayland.go index 90f01c3e..2b3e79ad 100644 --- a/app/internal/window/os_wayland.go +++ b/app/internal/window/os_wayland.go @@ -198,22 +198,17 @@ func createNativeWindow(opts *Options) (*window, error) { scale = s } } - ppdp := ppmm * mmPrDp - ppsp := ppdp * fontScale - ppdp *= monitorScale + ppdp := ppmm * mmPrDp * fontScale if ppdp < minDensity { ppdp = minDensity } - if ppsp < minDensity { - ppsp = minDensity - } w := &window{ disp: conn.disp, scale: scale, newScale: scale != 1, ppdp: ppdp, - ppsp: ppsp, + ppsp: ppdp, } w.notify.read = pipe[0] w.notify.write = pipe[1]