mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-03-06 01:40:22 -05:00
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.
This commit is contained in:
parent
ffcb09dd75
commit
027696e9c6
1 changed files with 2 additions and 4 deletions
|
|
@ -153,6 +153,8 @@ output_mode(void *data, struct wl_output *wl_output, uint32_t flags,
|
||||||
|
|
||||||
struct monitor *mon = data;
|
struct monitor *mon = data;
|
||||||
mon->refresh = (float)refresh / 1000;
|
mon->refresh = (float)refresh / 1000;
|
||||||
|
mon->width_px = width;
|
||||||
|
mon->height_px = height;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
|
@ -189,10 +191,6 @@ static void
|
||||||
xdg_output_handle_logical_size(void *data, struct zxdg_output_v1 *xdg_output,
|
xdg_output_handle_logical_size(void *data, struct zxdg_output_v1 *xdg_output,
|
||||||
int32_t width, int32_t height)
|
int32_t width, int32_t height)
|
||||||
{
|
{
|
||||||
struct monitor *mon = data;
|
|
||||||
mon->width_px = width;
|
|
||||||
mon->height_px = height;
|
|
||||||
output_update_ppi(mon);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue