diff --git a/gfx/drivers_context/android_ctx.c b/gfx/drivers_context/android_ctx.c index c0bf9cca0e..46020783e0 100644 --- a/gfx/drivers_context/android_ctx.c +++ b/gfx/drivers_context/android_ctx.c @@ -414,8 +414,11 @@ static bool android_gfx_ctx_get_metrics(void *data, { dpi_get_density(density, sizeof(density)); if (string_is_empty(density)) - return false; + goto dpi_fallback; dpi = atoi(density); + + if (dpi <= 0) + goto dpi_fallback; } *value = (float)dpi; break; @@ -426,6 +429,12 @@ static bool android_gfx_ctx_get_metrics(void *data, } return true; + +dpi_fallback: + /* add a fallback in case the device doesn't report DPI. + * Hopefully fixes issues with the moto G2. */ + dpi = 90; + return true; } static void android_gfx_ctx_swap_buffers(void *data) diff --git a/menu/menu_input.c b/menu/menu_input.c index 7880d7700b..66de0cbc0a 100644 --- a/menu/menu_input.c +++ b/menu/menu_input.c @@ -1106,12 +1106,6 @@ static int menu_input_pointer_post_iterate( gfx_ctx_ctl(GFX_CTL_GET_METRICS, &metrics); - /* add a fallback in case the menu driver doesn't report dpi - * hopefully fixes issues with the moto G2 - */ - if (dpi <= 0) - dpi = 90; - if (!pointer_oldpressed[0]) { menu_input->pointer.accel = 0;