aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Eklöf <daniel@ekloef.se>2020-02-15 18:06:28 +0000
committerDaniel Eklöf <daniel@ekloef.se>2020-02-15 18:06:28 +0000
commit027696e9c6ac0cf4b6a7bd7905358104f9bed6cd (patch)
tree9d0d96373edc09d2fef0aada641af4a4ab291ac8
parentwayland: break out scale/resize updating to a new function (diff)
wayland: calculate DPI from physical size, not logical size
xdg_output_handle_logical_size() reports _logical_ output size. That is, it is scaled by the output's scale factor. We want the _actual_ DPI. The _real_ output size is reported by output_mode(), so use that instead.
-rw-r--r--wayland.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/wayland.c b/wayland.c
index 8b529a9c..8528f987 100644
--- a/wayland.c
+++ b/wayland.c
@@ -153,6 +153,8 @@ output_mode(void *data, struct wl_output *wl_output, uint32_t flags,
struct monitor *mon = data;
mon->refresh = (float)refresh / 1000;
+ mon->width_px = width;
+ mon->height_px = height;
}
static void
@@ -189,10 +191,6 @@ static void
xdg_output_handle_logical_size(void *data, struct zxdg_output_v1 *xdg_output,
int32_t width, int32_t height)
{
- struct monitor *mon = data;
- mon->width_px = width;
- mon->height_px = height;
- output_update_ppi(mon);
}
static void