diff --git a/gfx/common/x11_common.c b/gfx/common/x11_common.c index 25ff5ebe69..584ce3eec9 100644 --- a/gfx/common/x11_common.c +++ b/gfx/common/x11_common.c @@ -28,6 +28,9 @@ #endif #include "x11_common.h" + +#include + #include "../../frontend/frontend_driver.h" #include "../../input/common/input_x11_common.h" #include "../../verbosity.h" @@ -43,6 +46,7 @@ static DBusConnection* dbus_connection = NULL; static unsigned int dbus_screensaver_cookie = 0; #endif +static XF86VidModeModeInfo desktop_mode; static bool xdg_screensaver_available = true; bool g_x11_entered = false; static bool g_x11_has_focus = false; @@ -375,11 +379,11 @@ static bool get_video_mode(video_frame_info_t *video_info, bool x11_enter_fullscreen(video_frame_info_t *video_info, Display *dpy, unsigned width, - unsigned height, XF86VidModeModeInfo *desktop_mode) + unsigned height) { XF86VidModeModeInfo mode; - if (!get_video_mode(video_info, dpy, width, height, &mode, desktop_mode)) + if (!get_video_mode(video_info, dpy, width, height, &mode, &desktop_mode)) return false; if (!XF86VidModeSwitchToMode(dpy, DefaultScreen(dpy), &mode)) @@ -389,9 +393,9 @@ bool x11_enter_fullscreen(video_frame_info_t *video_info, return true; } -void x11_exit_fullscreen(Display *dpy, XF86VidModeModeInfo *desktop_mode) +void x11_exit_fullscreen(Display *dpy) { - XF86VidModeSwitchToMode(dpy, DefaultScreen(dpy), desktop_mode); + XF86VidModeSwitchToMode(dpy, DefaultScreen(dpy), &desktop_mode); XF86VidModeSetViewPort(dpy, DefaultScreen(dpy), 0, 0); } diff --git a/gfx/common/x11_common.h b/gfx/common/x11_common.h index cd02554efb..195bf4c82b 100644 --- a/gfx/common/x11_common.h +++ b/gfx/common/x11_common.h @@ -25,7 +25,6 @@ #include #include -#include #include @@ -42,9 +41,9 @@ void x11_windowed_fullscreen(Display *dpy, Window win); void x11_suspend_screensaver(Window win, bool enable); bool x11_enter_fullscreen(video_frame_info_t *video_info, Display *dpy, unsigned width, - unsigned height, XF86VidModeModeInfo *desktop_mode); + unsigned height); -void x11_exit_fullscreen(Display *dpy, XF86VidModeModeInfo *desktop_mode); +void x11_exit_fullscreen(Display *dpy); void x11_move_window(Display *dpy, Window win, int x, int y, unsigned width, unsigned height); diff --git a/gfx/drivers_context/x_ctx.c b/gfx/drivers_context/x_ctx.c index 48f34b0d37..37b75c2b3f 100644 --- a/gfx/drivers_context/x_ctx.c +++ b/gfx/drivers_context/x_ctx.c @@ -94,7 +94,6 @@ typedef struct gfx_ctx_x_data #endif unsigned g_interval; - XF86VidModeModeInfo g_desktop_mode; #ifdef HAVE_VULKAN gfx_ctx_vulkan_data_t vk; @@ -212,7 +211,7 @@ static void gfx_ctx_x_destroy_resources(gfx_ctx_x_data_t *x) { if (x->g_should_reset_mode) { - x11_exit_fullscreen(g_x11_dpy, &x->g_desktop_mode); + x11_exit_fullscreen(g_x11_dpy); x->g_should_reset_mode = false; } @@ -609,7 +608,7 @@ static bool gfx_ctx_x_set_video_mode(void *data, if (fullscreen && !windowed_full) { - if (x11_enter_fullscreen(video_info, g_x11_dpy, width, height, &x->g_desktop_mode)) + if (x11_enter_fullscreen(video_info, g_x11_dpy, width, height)) { x->g_should_reset_mode = true; true_full = true; diff --git a/gfx/drivers_context/xegl_ctx.c b/gfx/drivers_context/xegl_ctx.c index b07c13bc2d..07977f5f25 100644 --- a/gfx/drivers_context/xegl_ctx.c +++ b/gfx/drivers_context/xegl_ctx.c @@ -39,7 +39,6 @@ typedef struct #ifdef HAVE_EGL egl_ctx_data_t egl; #endif - XF86VidModeModeInfo desktop_mode; bool should_reset_mode; } xegl_ctx_data_t; @@ -75,7 +74,7 @@ static void gfx_ctx_xegl_destroy(void *data) if (xegl->should_reset_mode) { - x11_exit_fullscreen(g_x11_dpy, &xegl->desktop_mode); + x11_exit_fullscreen(g_x11_dpy); xegl->should_reset_mode = false; } @@ -294,7 +293,7 @@ static bool gfx_ctx_xegl_set_video_mode(void *data, if (fullscreen && !video_info->windowed_fullscreen) { - if (x11_enter_fullscreen(video_info, g_x11_dpy, width, height, &xegl->desktop_mode)) + if (x11_enter_fullscreen(video_info, g_x11_dpy, width, height)) { xegl->should_reset_mode = true; true_full = true;