diff --git a/gfx/context/glx_ctx.c b/gfx/context/glx_ctx.c index 7a450c410e..b0b56fbca8 100644 --- a/gfx/context/glx_ctx.c +++ b/gfx/context/glx_ctx.c @@ -256,17 +256,23 @@ static bool gfx_ctx_set_video_mode( g_win = XCreateWindow(g_dpy, RootWindow(g_dpy, vi->screen), 0, 0, width ? width : 200, height ? height : 200, 0, vi->depth, InputOutput, vi->visual, - CWBorderPixel | CWColormap | CWEventMask | (fullscreen ? CWOverrideRedirect : 0), &swa); + CWBorderPixel | CWColormap | CWEventMask | (fullscreen && g_should_reset_mode ? CWOverrideRedirect : 0), &swa); XSetWindowBackground(g_dpy, g_win, 0); gfx_ctx_update_window_title(true); x11_hide_mouse(g_dpy, g_win); - if (fullscreen) + if (fullscreen && g_should_reset_mode) { XMapRaised(g_dpy, g_win); XGrabKeyboard(g_dpy, g_win, True, GrabModeAsync, GrabModeAsync, CurrentTime); } + else if (fullscreen) // We attempted true fullscreen, but failed. Attempt using windowed fullscreen. + { + XMapRaised(g_dpy, g_win); + RARCH_WARN("[GLX]: True fullscreen failed. Attempt using windowed fullscreen instead.\n"); + x11_windowed_fullscreen(g_dpy, g_win); + } else XMapWindow(g_dpy, g_win); diff --git a/gfx/context/x11_common.c b/gfx/context/x11_common.c index 094c0144c2..6ff1f8fd73 100644 --- a/gfx/context/x11_common.c +++ b/gfx/context/x11_common.c @@ -123,9 +123,13 @@ bool x11_enter_fullscreen(Display *dpy, unsigned width, unsigned height, XF86Vid XF86VidModeModeInfo mode; if (get_video_mode(dpy, width, height, &mode, desktop_mode)) { - XF86VidModeSwitchToMode(dpy, DefaultScreen(dpy), &mode); - XF86VidModeSetViewPort(dpy, DefaultScreen(dpy), 0, 0); - return true; + if (XF86VidModeSwitchToMode(dpy, DefaultScreen(dpy), &mode)) + { + XF86VidModeSetViewPort(dpy, DefaultScreen(dpy), 0, 0); + return true; + } + else + return false; } else return false; diff --git a/gfx/context/xegl_ctx.c b/gfx/context/xegl_ctx.c index 2b24829c57..9d122a2ae5 100644 --- a/gfx/context/xegl_ctx.c +++ b/gfx/context/xegl_ctx.c @@ -285,7 +285,7 @@ static bool gfx_ctx_set_video_mode( g_win = XCreateWindow(g_dpy, RootWindow(g_dpy, vi->screen), 0, 0, width ? width : 200, height ? height : 200, 0, vi->depth, InputOutput, vi->visual, - CWBorderPixel | CWColormap | CWEventMask | (fullscreen ? CWOverrideRedirect : 0), &swa); + CWBorderPixel | CWColormap | CWEventMask | (fullscreen && g_should_reset_mode ? CWOverrideRedirect : 0), &swa); XSetWindowBackground(g_dpy, g_win, 0); // GLES 2.0. Don't use for any other API. @@ -310,11 +310,17 @@ static bool gfx_ctx_set_video_mode( gfx_ctx_update_window_title(true); x11_hide_mouse(g_dpy, g_win); - if (fullscreen) + if (fullscreen && g_should_reset_mode) { XMapRaised(g_dpy, g_win); XGrabKeyboard(g_dpy, g_win, True, GrabModeAsync, GrabModeAsync, CurrentTime); } + else if (fullscreen) // We attempted true fullscreen, but failed. Attempt using windowed fullscreen. + { + XMapRaised(g_dpy, g_win); + RARCH_WARN("[X/EGL]: True fullscreen failed. Attempt using windowed fullscreen instead.\n"); + x11_windowed_fullscreen(g_dpy, g_win); + } else XMapWindow(g_dpy, g_win);