mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-01 07:35:40 +00:00
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 <mail@eliasnaur.com>
This commit is contained in:
@@ -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]
|
||||
|
||||
Reference in New Issue
Block a user