mirror of
https://github.com/libretro/RetroArch
synced 2025-04-18 23:42:30 +00:00
Set idle when APP_CMD_LOST_FOCUS
This commit is contained in:
parent
008db1e21c
commit
daeb8cacaf
@ -408,6 +408,12 @@ static void engine_handle_cmd(void)
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case APP_CMD_LOST_FOCUS:
|
case APP_CMD_LOST_FOCUS:
|
||||||
|
{
|
||||||
|
bool boolean = true;
|
||||||
|
|
||||||
|
rarch_main_ctl(RARCH_MAIN_CTL_SET_PAUSED, &boolean);
|
||||||
|
rarch_main_ctl(RARCH_MAIN_CTL_SET_IDLE, &boolean);
|
||||||
|
|
||||||
/* Avoid draining battery while app is not being used. */
|
/* Avoid draining battery while app is not being used. */
|
||||||
if ((android_app->sensor_state_mask
|
if ((android_app->sensor_state_mask
|
||||||
& (UINT64_C(1) << RETRO_SENSOR_ACCELEROMETER_ENABLE))
|
& (UINT64_C(1) << RETRO_SENSOR_ACCELEROMETER_ENABLE))
|
||||||
@ -416,6 +422,7 @@ static void engine_handle_cmd(void)
|
|||||||
android_input_set_sensor_state(driver->input_data, 0,
|
android_input_set_sensor_state(driver->input_data, 0,
|
||||||
RETRO_SENSOR_ACCELEROMETER_DISABLE,
|
RETRO_SENSOR_ACCELEROMETER_DISABLE,
|
||||||
android_app->accelerometer_event_rate);
|
android_app->accelerometer_event_rate);
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case APP_CMD_DESTROY:
|
case APP_CMD_DESTROY:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user