mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-03-29 07:58:01 -04:00
wayland: use physical DPI on fractional-scale capable compositors
With legacy scaling, we need to use a "scaled", or "logical" DPI value, that is basically the real DPI value scaled by the monitor’s scaling factor. This is necessary to compensate for the compositor downscaling the surface, for "fake" fractional scaling. But with true fractional scaling, *we* scale the surface to the final size. This means we should *not* use the scaled DPI, but the monitor’s actual DPI. To facilitate this, store both the scaled and the unscaled DPI value in the monitor struct. This patch also changes how we pick the DPI value. Before, we would use the highest DPI value from all the monitors we were mapped on. Now, we use the DPI value from the monitor we were *last* mapped on (typically the window we’re dragging the window *to*).
This commit is contained in:
parent
59f0a721c4
commit
b2a29280cb
3 changed files with 55 additions and 51 deletions
|
|
@ -315,7 +315,10 @@ struct monitor {
|
|||
} scaled;
|
||||
} ppi;
|
||||
|
||||
float dpi;
|
||||
struct {
|
||||
float scaled;
|
||||
float physical;
|
||||
} dpi;
|
||||
|
||||
int scale;
|
||||
float refresh;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue