mirror of
https://github.com/libretro/RetroArch
synced 2025-01-30 12:32:52 +00:00
Fix race condition issue in threaded video mode when OSK is
brought up/down
This commit is contained in:
parent
61bbb2a3fb
commit
50baeba22a
3
driver.h
3
driver.h
@ -213,7 +213,8 @@ typedef struct driver
|
|||||||
bool video_active;
|
bool video_active;
|
||||||
bool camera_active;
|
bool camera_active;
|
||||||
bool location_active;
|
bool location_active;
|
||||||
bool osk_active;
|
bool osk_enable;
|
||||||
|
bool keyboard_linefeed_enable;
|
||||||
|
|
||||||
#ifdef HAVE_MENU
|
#ifdef HAVE_MENU
|
||||||
menu_handle_t *menu;
|
menu_handle_t *menu;
|
||||||
|
@ -42,9 +42,7 @@ static void input_keyboard_line_toggle_osk(bool enable)
|
|||||||
if (!g_settings.osk.enable)
|
if (!g_settings.osk.enable)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
rarch_main_command(RARCH_CMD_OVERLAY_DEINIT);
|
driver.keyboard_linefeed_enable = enable;
|
||||||
driver.osk_active = enable;
|
|
||||||
rarch_main_command(RARCH_CMD_OVERLAY_INIT);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -2353,7 +2353,7 @@ bool rarch_main_command(unsigned cmd)
|
|||||||
case RARCH_CMD_OVERLAY_INIT:
|
case RARCH_CMD_OVERLAY_INIT:
|
||||||
rarch_main_command(RARCH_CMD_OVERLAY_DEINIT);
|
rarch_main_command(RARCH_CMD_OVERLAY_DEINIT);
|
||||||
#ifdef HAVE_OVERLAY
|
#ifdef HAVE_OVERLAY
|
||||||
if (driver.osk_active)
|
if (driver.osk_enable)
|
||||||
{
|
{
|
||||||
if (!*g_settings.osk.overlay)
|
if (!*g_settings.osk.overlay)
|
||||||
break;
|
break;
|
||||||
@ -2364,8 +2364,8 @@ bool rarch_main_command(unsigned cmd)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
driver.overlay = input_overlay_new(driver.osk_active ? g_settings.osk.overlay : g_settings.input.overlay,
|
driver.overlay = input_overlay_new(driver.osk_enable ? g_settings.osk.overlay : g_settings.input.overlay,
|
||||||
driver.osk_active ? g_settings.osk.enable : g_settings.input.overlay_enable,
|
driver.osk_enable ? g_settings.osk.enable : g_settings.input.overlay_enable,
|
||||||
g_settings.input.overlay_opacity, g_settings.input.overlay_scale);
|
g_settings.input.overlay_opacity, g_settings.input.overlay_scale);
|
||||||
if (!driver.overlay)
|
if (!driver.overlay)
|
||||||
RARCH_ERR("Failed to load overlay.\n");
|
RARCH_ERR("Failed to load overlay.\n");
|
||||||
|
19
runloop.c
19
runloop.c
@ -1034,6 +1034,22 @@ void rarch_main_iterate_overlay_state(void)
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
static void rarch_main_iterate_linefeed(void)
|
||||||
|
{
|
||||||
|
if (driver.osk_enable && !driver.keyboard_linefeed_enable)
|
||||||
|
{
|
||||||
|
driver.osk_enable = false;
|
||||||
|
rarch_main_command(RARCH_CMD_OVERLAY_DEINIT);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
else if (!driver.osk_enable && driver.keyboard_linefeed_enable)
|
||||||
|
{
|
||||||
|
driver.osk_enable = true;
|
||||||
|
rarch_main_command(RARCH_CMD_OVERLAY_INIT);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* rarch_main_iterate:
|
* rarch_main_iterate:
|
||||||
*
|
*
|
||||||
@ -1065,6 +1081,9 @@ int rarch_main_iterate(void)
|
|||||||
|
|
||||||
do_pre_state_checks(input, old_input, trigger_input);
|
do_pre_state_checks(input, old_input, trigger_input);
|
||||||
|
|
||||||
|
if (driver.keyboard_linefeed_enable || driver.osk_enable)
|
||||||
|
rarch_main_iterate_linefeed();
|
||||||
|
|
||||||
#ifdef HAVE_OVERLAY
|
#ifdef HAVE_OVERLAY
|
||||||
if (driver.overlay)
|
if (driver.overlay)
|
||||||
rarch_main_iterate_overlay_state();
|
rarch_main_iterate_overlay_state();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user