From 3760a48abe802ae897a3d3441fdeb7efd584d3f8 Mon Sep 17 00:00:00 2001 From: Michael Stapelberg Date: Sat, 26 Apr 2014 22:50:31 +0200 Subject: [PATCH] truncate DPI to an integer before multiplying (Thanks eeemsi) This fixes i3bar workspace button rendering on non-DPI screens (oldschool!) --- libi3/dpi.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libi3/dpi.c b/libi3/dpi.c index c015065b..5fd4cbca 100644 --- a/libi3/dpi.c +++ b/libi3/dpi.c @@ -10,7 +10,7 @@ extern xcb_screen_t *root_screen; * */ int logical_px(const int logical) { - const double dpi = (double)root_screen->height_in_pixels * 25.4 / - (double)root_screen->height_in_millimeters; + const int dpi = (double)root_screen->height_in_pixels * 25.4 / + (double)root_screen->height_in_millimeters; return ceil((dpi / 96.0) * logical); } -- 2.39.5