diff --git a/gfx/d3d/d3d.cpp b/gfx/d3d/d3d.cpp index 2624203627..8433a2e617 100644 --- a/gfx/d3d/d3d.cpp +++ b/gfx/d3d/d3d.cpp @@ -871,7 +871,7 @@ static bool d3d_alive(void *data) static bool d3d_focus(void *data) { - return gfx_ctx_focus(); + return gfx_ctx_ctl(GFX_CTL_FOCUS, NULL); } static bool d3d_suppress_screensaver(void *data, bool enable) diff --git a/gfx/drivers/gl.c b/gfx/drivers/gl.c index 51a212f26c..9cdf237bf6 100644 --- a/gfx/drivers/gl.c +++ b/gfx/drivers/gl.c @@ -2706,7 +2706,7 @@ static bool gl_alive(void *data) static bool gl_focus(void *data) { - return gfx_ctx_focus(); + return gfx_ctx_ctl(GFX_CTL_FOCUS, NULL); } static bool gl_suppress_screensaver(void *data, bool enable) diff --git a/gfx/drivers/vg.c b/gfx/drivers/vg.c index 6b0c3b987a..a967d25f59 100644 --- a/gfx/drivers/vg.c +++ b/gfx/drivers/vg.c @@ -379,7 +379,7 @@ static bool vg_alive(void *data) static bool vg_focus(void *data) { - return gfx_ctx_focus(); + return gfx_ctx_ctl(GFX_CTL_FOCUS, NULL); } static bool vg_suppress_screensaver(void *data, bool enable) diff --git a/gfx/video_context_driver.c b/gfx/video_context_driver.c index c411ef03e7..580c0783a8 100644 --- a/gfx/video_context_driver.c +++ b/gfx/video_context_driver.c @@ -149,12 +149,6 @@ void gfx_ctx_bind_hw_render(bool enable) current_video_context->bind_hw_render(video_context_data, enable); } -bool gfx_ctx_focus(void) -{ - if (!video_context_data || !current_video_context->has_focus) - return false; - return current_video_context->has_focus(video_context_data); -} bool gfx_ctx_set_video_mode( unsigned width, unsigned height, @@ -439,6 +433,10 @@ bool gfx_ctx_ctl(enum gfx_ctx_ctl_state state, void *data) { switch (state) { + case GFX_CTL_FOCUS: + if (!video_context_data || !current_video_context->has_focus) + return false; + return current_video_context->has_focus(video_context_data); case GFX_CTL_FREE: if (current_video_context->destroy) current_video_context->destroy(video_context_data); diff --git a/gfx/video_context_driver.h b/gfx/video_context_driver.h index 98e7014480..5821461ddb 100644 --- a/gfx/video_context_driver.h +++ b/gfx/video_context_driver.h @@ -54,6 +54,7 @@ enum display_metric_types enum gfx_ctx_ctl_state { GFX_CTL_NONE = 0, + GFX_CTL_FOCUS, GFX_CTL_FREE }; @@ -214,8 +215,6 @@ bool gfx_ctx_set_video_mode(unsigned width, unsigned height, void gfx_ctx_swap_buffers(void); -bool gfx_ctx_focus(void); - bool gfx_ctx_image_buffer_init(const video_info_t *info); bool gfx_ctx_image_buffer_write(const void *frame,