mirror of
https://github.com/libretro/RetroArch.git
synced 2026-11-08 08:10:30 -10:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
bce679df78 | ||
|
|
22e8c3d895 |
No files matched your search
+2
-11
@@ -116,17 +116,9 @@ void gfx_set_dwm(void)
|
||||
#include "SDL_syswm.h"
|
||||
#include "SDL.h"
|
||||
|
||||
#if !defined(__APPLE__) && !defined(_WIN32)
|
||||
void gfx_get_window_size(unsigned *width, unsigned *height)
|
||||
{
|
||||
#if defined(__APPLE__) || defined(_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);
|
||||
@@ -138,6 +130,5 @@ void gfx_get_window_size(unsigned *width, unsigned *height)
|
||||
|
||||
*width = target.width;
|
||||
*height = target.height;
|
||||
#endif
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -28,6 +28,8 @@ void gfx_window_title_reset(void);
|
||||
void gfx_set_dwm(void);
|
||||
#endif
|
||||
|
||||
#if !defined(__APPLE__) && !defined(_WIN32)
|
||||
void gfx_get_window_size(unsigned *width, unsigned *height);
|
||||
#endif
|
||||
|
||||
#endif
|
||||
@@ -147,6 +147,7 @@ typedef struct gl
|
||||
|
||||
bool should_resize;
|
||||
bool quitting;
|
||||
bool fullscreen;
|
||||
bool keep_aspect;
|
||||
|
||||
unsigned full_x, full_y;
|
||||
@@ -706,7 +707,9 @@ static void check_window(gl_t *gl)
|
||||
}
|
||||
}
|
||||
|
||||
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);
|
||||
@@ -718,6 +721,7 @@ static void check_window(gl_t *gl)
|
||||
SSNES_LOG("GL: Verified window size: %u x %u\n", gl->win_width, gl->win_height);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
static bool gl_frame(void *data, const void* frame, unsigned width, unsigned height, unsigned pitch, const char *msg)
|
||||
@@ -1095,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)
|
||||
|
||||
Reference in new issue
Block a user