diff --git a/gfx/common/win32_common.c b/gfx/common/win32_common.c index 3257d9b50e..e37d1ec11c 100644 --- a/gfx/common/win32_common.c +++ b/gfx/common/win32_common.c @@ -2688,10 +2688,9 @@ bool win32_get_video_output(DEVMODE *dm, int mode, size_t len) return true; } -void win32_get_video_output_size(unsigned *width, unsigned *height, char *desc, size_t desc_len) +void win32_get_video_output_size(void *data, unsigned *width, unsigned *height, char *desc, size_t desc_len) { DEVMODE dm; - if (win32_get_video_output(&dm, -1, sizeof(dm))) { *width = dm.dmPelsWidth; diff --git a/gfx/common/win32_common.h b/gfx/common/win32_common.h index 09b8420e81..b9fbf2b409 100644 --- a/gfx/common/win32_common.h +++ b/gfx/common/win32_common.h @@ -137,7 +137,7 @@ void win32_check_window(void *data, void win32_set_window(unsigned *width, unsigned *height, bool fullscreen, bool windowed_full, void *rect_data); -void win32_get_video_output_size( +void win32_get_video_output_size(void *data, unsigned *width, unsigned *height, char *desc, size_t desc_len); void win32_get_video_output_prev( diff --git a/gfx/common/x11_common.c b/gfx/common/x11_common.c index 27850fd0d0..55ce335b21 100644 --- a/gfx/common/x11_common.c +++ b/gfx/common/x11_common.c @@ -111,8 +111,10 @@ static void x11_hide_mouse(Display *dpy, Window win) XFreeColors(dpy, colormap, &black.pixel, 1, 0); } -void x11_show_mouse(Display *dpy, Window win, bool state) +void x11_show_mouse(void *data, bool state) { + Display *dpy = g_x11_dpy; + Window win = g_x11_win; if (state) XUndefineCursor(dpy, win); else diff --git a/gfx/common/x11_common.h b/gfx/common/x11_common.h index 350b9973f0..c95c92e0d9 100644 --- a/gfx/common/x11_common.h +++ b/gfx/common/x11_common.h @@ -28,7 +28,7 @@ extern Display *g_x11_dpy; extern Colormap g_x11_cmap; extern unsigned g_x11_screen; -void x11_show_mouse(Display *dpy, Window win, bool state); +void x11_show_mouse(void *data, bool state); void x11_set_net_wm_fullscreen(Display *dpy, Window win); void x11_suspend_screensaver(void *data, bool enable); diff --git a/gfx/drivers/d3d10.c b/gfx/drivers/d3d10.c index b84c833ed5..8926ecd0e1 100644 --- a/gfx/drivers/d3d10.c +++ b/gfx/drivers/d3d10.c @@ -2771,12 +2771,6 @@ static uint32_t d3d10_get_flags(void *data) } #ifndef __WINRT__ -static void d3d10_get_video_output_size(void *data, - unsigned *width, unsigned *height, char *desc, size_t desc_len) -{ - win32_get_video_output_size(width, height, desc, desc_len); -} - static void d3d10_get_video_output_prev(void *data) { unsigned width = 0; @@ -2809,7 +2803,7 @@ static const video_poke_interface_t d3d10_poke_interface = { NULL, /* get_video_output_prev */ NULL, /* get_video_output_next */ #else - d3d10_get_video_output_size, + win32_get_video_output_size, d3d10_get_video_output_prev, d3d10_get_video_output_next, #endif diff --git a/gfx/drivers/d3d11.c b/gfx/drivers/d3d11.c index e8473fbdd7..50820e06a4 100644 --- a/gfx/drivers/d3d11.c +++ b/gfx/drivers/d3d11.c @@ -3585,12 +3585,6 @@ static bool d3d11_get_hw_render_interface( } #ifndef __WINRT__ -static void d3d11_get_video_output_size(void *data, - unsigned *width, unsigned *height, char *desc, size_t desc_len) -{ - win32_get_video_output_size(width, height, desc, desc_len); -} - static void d3d11_get_video_output_prev(void *data) { unsigned width = 0; @@ -3623,7 +3617,7 @@ static const video_poke_interface_t d3d11_poke_interface = { NULL, /* get_video_output_prev */ NULL, /* get_video_output_next */ #else - d3d11_get_video_output_size, + win32_get_video_output_size, d3d11_get_video_output_prev, d3d11_get_video_output_next, #endif diff --git a/gfx/drivers/d3d12.c b/gfx/drivers/d3d12.c index a11dcb952e..15b49b1fad 100644 --- a/gfx/drivers/d3d12.c +++ b/gfx/drivers/d3d12.c @@ -4124,12 +4124,6 @@ static bool d3d12_get_hw_render_interface( } #ifndef __WINRT__ -static void d3d12_get_video_output_size(void *data, - unsigned *width, unsigned *height, char *desc, size_t desc_len) -{ - win32_get_video_output_size(width, height, desc, desc_len); -} - static void d3d12_get_video_output_prev(void *data) { unsigned width = 0; @@ -4162,7 +4156,7 @@ static const video_poke_interface_t d3d12_poke_interface = { NULL, /* get_video_output_prev */ NULL, /* get_video_output_next */ #else - d3d12_get_video_output_size, + win32_get_video_output_size, d3d12_get_video_output_prev, d3d12_get_video_output_next, #endif diff --git a/gfx/drivers/gdi_gfx.c b/gfx/drivers/gdi_gfx.c index b3f5970069..ef550521a3 100644 --- a/gfx/drivers/gdi_gfx.c +++ b/gfx/drivers/gdi_gfx.c @@ -967,12 +967,6 @@ static void gdi_unload_texture(void *data, static uint32_t gdi_get_flags(void *data) { return 0; } -static void gdi_get_video_output_size(void *data, - unsigned *width, unsigned *height, char *desc, size_t desc_len) -{ - win32_get_video_output_size(width, height, desc, desc_len); -} - static void gdi_get_video_output_prev(void *data) { unsigned width = 0; @@ -994,7 +988,7 @@ static const video_poke_interface_t gdi_poke_interface = { gdi_set_video_mode, win32_get_refresh_rate, NULL, /* set_filtering */ - gdi_get_video_output_size, + win32_get_video_output_size, gdi_get_video_output_prev, gdi_get_video_output_next, NULL, /* get_current_framebuffer */ diff --git a/gfx/drivers/xvideo.c b/gfx/drivers/xvideo.c index 73b9c542d7..39e338003a 100644 --- a/gfx/drivers/xvideo.c +++ b/gfx/drivers/xvideo.c @@ -812,7 +812,7 @@ static void *xv_init(const video_info_t *video, if (video->fullscreen) { x11_set_net_wm_fullscreen(g_x11_dpy, g_x11_win); - x11_show_mouse(g_x11_dpy, g_x11_win, false); + x11_show_mouse(xv, false); } xv->gc = XCreateGC(g_x11_dpy, g_x11_win, 0, 0); diff --git a/gfx/drivers_context/w_vk_ctx.c b/gfx/drivers_context/w_vk_ctx.c index e7c1822e6c..5152dd0e56 100644 --- a/gfx/drivers_context/w_vk_ctx.c +++ b/gfx/drivers_context/w_vk_ctx.c @@ -295,15 +295,7 @@ static uint32_t gfx_ctx_w_vk_get_flags(void *data) } static void gfx_ctx_w_vk_set_flags(void *data, uint32_t flags) { } - -static void gfx_ctx_w_vk_get_video_output_size(void *data, - unsigned *width, unsigned *height, char *desc, size_t desc_len) -{ - win32_get_video_output_size(width, height, desc, desc_len); -} - static void gfx_ctx_w_vk_get_video_output_prev(void *data) { } - static void gfx_ctx_w_vk_get_video_output_next(void *data) { } const gfx_ctx_driver_t gfx_ctx_w_vk = { @@ -315,7 +307,7 @@ const gfx_ctx_driver_t gfx_ctx_w_vk = { gfx_ctx_w_vk_set_video_mode, win32_get_video_size, win32_get_refresh_rate, - gfx_ctx_w_vk_get_video_output_size, + win32_get_video_output_size, gfx_ctx_w_vk_get_video_output_prev, gfx_ctx_w_vk_get_video_output_next, win32_get_metrics, diff --git a/gfx/drivers_context/wgl_ctx.c b/gfx/drivers_context/wgl_ctx.c index f2519cf21e..3cd4bdc372 100644 --- a/gfx/drivers_context/wgl_ctx.c +++ b/gfx/drivers_context/wgl_ctx.c @@ -777,12 +777,6 @@ static void gfx_ctx_wgl_set_flags(void *data, uint32_t flags) } -static void gfx_ctx_wgl_get_video_output_size(void *data, - unsigned *width, unsigned *height, char *desc, size_t desc_len) -{ - win32_get_video_output_size(width, height, desc, desc_len); -} - static void gfx_ctx_wgl_get_video_output_prev(void *data) { } static void gfx_ctx_wgl_get_video_output_next(void *data) { } @@ -795,7 +789,7 @@ const gfx_ctx_driver_t gfx_ctx_wgl = { gfx_ctx_wgl_set_video_mode, win32_get_video_size, win32_get_refresh_rate, - gfx_ctx_wgl_get_video_output_size, + win32_get_video_output_size, gfx_ctx_wgl_get_video_output_prev, gfx_ctx_wgl_get_video_output_next, win32_get_metrics, diff --git a/gfx/drivers_context/x_ctx.c b/gfx/drivers_context/x_ctx.c index 92d5546c8a..44ca7a1a8c 100644 --- a/gfx/drivers_context/x_ctx.c +++ b/gfx/drivers_context/x_ctx.c @@ -623,7 +623,7 @@ static bool gfx_ctx_x_set_video_mode(void *data, x11_update_title(NULL); if (fullscreen) - x11_show_mouse(g_x11_dpy, g_x11_win, false); + x11_show_mouse(data, false); #ifdef HAVE_XF86VM if (true_full) @@ -1031,11 +1031,6 @@ static bool gfx_ctx_x_bind_api(void *data, enum gfx_ctx_api api, return false; } -static void gfx_ctx_x_show_mouse(void *data, bool state) -{ - x11_show_mouse(g_x11_dpy, g_x11_win, state); -} - static void gfx_ctx_x_bind_hw_render(void *data, bool enable) { gfx_ctx_x_data_t *x = (gfx_ctx_x_data_t*)data; @@ -1181,7 +1176,7 @@ const gfx_ctx_driver_t gfx_ctx_x = { gfx_ctx_x_get_proc_address, NULL, NULL, - gfx_ctx_x_show_mouse, + x11_show_mouse, "x", gfx_ctx_x_get_flags, gfx_ctx_x_set_flags, diff --git a/gfx/drivers_context/x_vk_ctx.c b/gfx/drivers_context/x_vk_ctx.c index 554635d1a0..38e8654a85 100644 --- a/gfx/drivers_context/x_vk_ctx.c +++ b/gfx/drivers_context/x_vk_ctx.c @@ -390,7 +390,7 @@ static bool gfx_ctx_x_vk_set_video_mode(void *data, x11_update_title(NULL); if (fullscreen) - x11_show_mouse(g_x11_dpy, g_x11_win, false); + x11_show_mouse(data, false); #ifdef HAVE_XF86VM if (true_full) @@ -516,11 +516,6 @@ static enum gfx_ctx_api gfx_ctx_x_vk_get_api(void *data) static bool gfx_ctx_x_vk_bind_api(void *data, enum gfx_ctx_api api, unsigned major, unsigned minor) { return (api == GFX_CTX_VULKAN_API); } -static void gfx_ctx_x_vk_show_mouse(void *data, bool state) -{ - x11_show_mouse(g_x11_dpy, g_x11_win, state); -} - static void gfx_ctx_x_vk_bind_hw_render(void *data, bool enable) { } static void *gfx_ctx_x_vk_get_context_data(void *data) @@ -572,7 +567,7 @@ const gfx_ctx_driver_t gfx_ctx_vk_x = { NULL, /* get_proc_address */ NULL, NULL, - gfx_ctx_x_vk_show_mouse, + x11_show_mouse, "vk_x", gfx_ctx_x_vk_get_flags, gfx_ctx_x_vk_set_flags, diff --git a/gfx/drivers_context/xegl_ctx.c b/gfx/drivers_context/xegl_ctx.c index cc20bfeca6..422d223c79 100644 --- a/gfx/drivers_context/xegl_ctx.c +++ b/gfx/drivers_context/xegl_ctx.c @@ -398,7 +398,7 @@ static bool gfx_ctx_xegl_set_video_mode(void *data, x11_update_title(NULL); if (fullscreen) - x11_show_mouse(g_x11_dpy, g_x11_win, false); + x11_show_mouse(data, false); #ifdef HAVE_XF86VM if (true_full) @@ -517,11 +517,6 @@ static bool gfx_ctx_xegl_bind_api(void *video_driver, return false; } -static void gfx_ctx_xegl_show_mouse(void *data, bool state) -{ - x11_show_mouse(g_x11_dpy, g_x11_win, state); -} - static void gfx_ctx_xegl_swap_buffers(void *data) { xegl_ctx_data_t *xegl = (xegl_ctx_data_t*)data; @@ -618,7 +613,7 @@ const gfx_ctx_driver_t gfx_ctx_x_egl = gfx_ctx_xegl_get_proc_address, NULL, NULL, - gfx_ctx_xegl_show_mouse, + x11_show_mouse, "egl_x", gfx_ctx_xegl_get_flags, gfx_ctx_xegl_set_flags,