diff --git a/gfx/gfx_common.c b/gfx/gfx_common.c index 307527cf92..7f7086653d 100644 --- a/gfx/gfx_common.c +++ b/gfx/gfx_common.c @@ -116,18 +116,9 @@ void gfx_set_dwm(void) #include "SDL_syswm.h" #include "SDL.h" -#ifndef __APPLE__ +#if !defined(__APPLE__) && !defined(_WIN32) void gfx_get_window_size(unsigned *width, unsigned *height) { -#ifdef _WIN32 - SDL_Event evnt; - while (SDL_PollEvent(&evnt)); - const SDL_VideoInfo *info = SDL_GetVideoInfo(); - *width = info->current_w; - *height = info->current_h; -#else - // It seems that we need to go hardcore to get the actual - // window sizes properly right after startup ... :D SDL_SysWMinfo info; SDL_VERSION(&info.version); SDL_GetWMInfo(&info); @@ -139,6 +130,5 @@ void gfx_get_window_size(unsigned *width, unsigned *height) *width = target.width; *height = target.height; -#endif } #endif diff --git a/gfx/gfx_common.h b/gfx/gfx_common.h index d96d8c1ced..3fd765cae3 100644 --- a/gfx/gfx_common.h +++ b/gfx/gfx_common.h @@ -28,7 +28,7 @@ void gfx_window_title_reset(void); void gfx_set_dwm(void); #endif -#ifndef __APPLE__ +#if !defined(__APPLE__) && !defined(_WIN32) void gfx_get_window_size(unsigned *width, unsigned *height); #endif diff --git a/gfx/gl.c b/gfx/gl.c index 39ed9f979f..1480c710c4 100644 --- a/gfx/gl.c +++ b/gfx/gl.c @@ -147,6 +147,7 @@ typedef struct gl bool should_resize; bool quitting; + bool fullscreen; bool keep_aspect; unsigned full_x, full_y; @@ -706,8 +707,9 @@ static void check_window(gl_t *gl) } } -#ifndef __APPLE__ // This check breaks on OSX for some reason. Oh well :) - if (!gl->should_resize) +#if !defined(__APPLE__) && !defined(_WIN32) + // Hack to workaround limitations in tiling WMs ... + if (!gl->should_resize && !gl->fullscreen) { unsigned new_width, new_height; gfx_get_window_size(&new_width, &new_height); @@ -1097,6 +1099,7 @@ static void* gl_init(const video_info_t *video, const input_driver_t **input, vo } gl->vsync = video->vsync; + gl->fullscreen = video->fullscreen; int attr = 0; SDL_GL_GetAttribute(SDL_GL_SWAP_CONTROL, &attr); if (attr <= 0 && video->vsync)