diff --git a/gfx/video_driver.c b/gfx/video_driver.c index 0dcdc61fe9..fc47960a31 100644 --- a/gfx/video_driver.c +++ b/gfx/video_driver.c @@ -584,3 +584,14 @@ bool video_driver_has_windowed(void) return false; return true; } + +void video_driver_set_nonblock_state(bool toggle) +{ + driver_t *driver = driver_get_ptr(); + + if (!driver->video) + return; + + if (driver->video->set_nonblock_state) + driver->video->set_nonblock_state(driver->video_data, toggle); +} diff --git a/gfx/video_driver.h b/gfx/video_driver.h index 0ca7f1cfe2..4bb8861f26 100644 --- a/gfx/video_driver.h +++ b/gfx/video_driver.h @@ -274,6 +274,8 @@ void init_video(void); bool video_driver_has_windowed(void); +void video_driver_set_nonblock_state(bool toggle); + #ifdef __cplusplus } #endif diff --git a/retroarch.c b/retroarch.c index 561a518c50..168eb8097b 100644 --- a/retroarch.c +++ b/retroarch.c @@ -2617,8 +2617,7 @@ bool rarch_main_command(unsigned cmd) case RARCH_CMD_VIDEO_SET_NONBLOCKING_STATE: boolean = true; /* fall-through */ case RARCH_CMD_VIDEO_SET_BLOCKING_STATE: - if (driver->video && driver->video->set_nonblock_state) - driver->video->set_nonblock_state(driver->video_data, boolean); + video_driver_set_nonblock_state(boolean); break; case RARCH_CMD_VIDEO_SET_ASPECT_RATIO: if (driver->video_data && driver->video_poke