(Drivers/Video) Implement frontend signal handling in null video driver

Allows RetroArch to gracefully exit when receiving stop signals, e.g.
`SIGINT` or `SIGTERM`, when using the null video driver.
This commit is contained in:
Hugo Hromic 2020-07-10 23:55:37 +01:00
parent 5ebce6a238
commit f9f4a69512

View File

@ -410,6 +410,8 @@ static void *video_null_init(const video_info_t *video,
*input = NULL;
*input_data = NULL;
frontend_driver_install_signal_handler();
return (void*)-1;
}
@ -422,7 +424,7 @@ static bool video_null_frame(void *data, const void *frame,
static void video_null_free(void *data) { }
static void video_null_set_nonblock_state(void *a, bool b, bool c, unsigned d) { }
static bool video_null_alive(void *data) { return true; }
static bool video_null_alive(void *data) { return frontend_driver_get_signal_handler_state() != 1; }
static bool video_null_focus(void *data) { return true; }
static bool video_null_has_windowed(void *data) { return true; }
static bool video_null_suppress_screensaver(void *data, bool enable) { return false; }