From 96d517a6f2a423eeb0eff952a965451d58709f8a Mon Sep 17 00:00:00 2001 From: Chris Michael Date: Mon, 28 Nov 2016 10:10:28 -0500 Subject: [PATCH] use ecore_evas_screen_dpi_get when updating e_scale value Now that the ecore_evas_drm code can return screen dpi, we can use that rather than using a client API function (ecore_wl2) to get server screen dpi. Signed-off-by: Chris Michael --- src/bin/e_scale.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/bin/e_scale.c b/src/bin/e_scale.c index 0a3948b68..1ec285d7c 100644 --- a/src/bin/e_scale.c +++ b/src/bin/e_scale.c @@ -27,10 +27,14 @@ e_scale_update(void) e_scale = (double)ecore_x_dpi_get() / (double)e_config->scale.base_dpi; #endif #ifdef HAVE_WAYLAND - /* FIXME: This needs to get the DPI from a given output */ if (e_comp->comp_type == E_PIXMAP_TYPE_WL) { - e_scale = (double)ecore_wl2_output_dpi_get(NULL) / + int xdpi = 0, ydpi = 0; + + ecore_evas_screen_dpi_get(e_comp->ee, &xdpi, &ydpi); + if (xdpi == 0) xdpi = 75; + if (ydpi == 0) ydpi = 75; + e_scale = ((double)(xdpi + ydpi) / 2.0) / (double)e_config->scale.base_dpi; } #endif