(Android) Move Android-specific Moto G2 DPI workaround to android graphics context

driver
This commit is contained in:
twinaphex 2016-03-12 08:52:29 +01:00
parent 48d61f33ab
commit 432d7a358a
2 changed files with 10 additions and 7 deletions

View File

@ -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)

View File

@ -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;