aboutsummaryrefslogtreecommitdiff
path: root/wayland.h
diff options
context:
space:
mode:
authorDaniel Eklöf <daniel@ekloef.se>2020-03-11 15:10:55 +0000
committerDaniel Eklöf <daniel@ekloef.se>2020-03-14 21:34:03 +0000
commit36ef0463b7157199aac1876ad4cc9725403fff4a (patch)
tree730169426fd99e91b60e0d19ef1787a86204f1e9 /wayland.h
parentquirks: weston_csd_{on,off}: don't do anything in fullscreen mode (diff)
term: use logical DPI+scale factor when scaling fonts
This fixes an issue where the fonts were rendered too small when the output had fractional scaling. For integral scaling, using the logical (scaled) DPI multiplied with the scaling factor results in the same final DPI value as if we had used the physical DPI. But for fractional scaling, this works around the fact that the compositor downscales the surface after we've rendered it. Closes #5
Diffstat (limited to 'wayland.h')
-rw-r--r--wayland.h37
1 files changed, 31 insertions, 6 deletions
diff --git a/wayland.h b/wayland.h
index ed53591d..7d7b36ca 100644
--- a/wayland.h
+++ b/wayland.h
@@ -24,14 +24,39 @@ struct monitor {
int x;
int y;
- int width_mm;
- int height_mm;
+ struct {
+ /* Physical size, in mm */
+ struct {
+ int width;
+ int height;
+ } mm;
+
+ /* Physical size, in pixels */
+ struct {
+ int width;
+ int height;
+ } px_real;
- int width_px;
- int height_px;
+ /* Scaled size, in pixels */
+ struct {
+ int width;
+ int height;
+ } px_scaled;
+ } dim;
+
+ struct {
+ /* PPI, based on physical size */
+ struct {
+ int x;
+ int y;
+ } real;
- int x_ppi;
- int y_ppi;
+ /* PPI, logical, based on scaled size */
+ struct {
+ int x;
+ int y;
+ } scaled;
+ } ppi;
int scale;
float refresh;