From d9cb85a8d59f42b569b00f2d719093372f805575 Mon Sep 17 00:00:00 2001 From: Themaister Date: Thu, 11 Aug 2011 15:19:30 +0200 Subject: [PATCH] Add new possible workaround for tiling WMs ... --- gfx/gl.c | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/gfx/gl.c b/gfx/gl.c index f615648128..e383154cce 100644 --- a/gfx/gl.c +++ b/gfx/gl.c @@ -701,10 +701,26 @@ static void check_window(gl_t *gl) gl->win_height = event.resize.h; break; + case SDL_VIDEOEXPOSE: + gl->should_resize = true; + gfx_get_window_size(&gl->win_width, &gl->win_height); + SSNES_LOG("GL: Got resolution %ux%u\n", gl->win_width, gl->win_height); + break; + default: break; } } + + // Dirty workaround to possibly fix cases where a tiling WM might asyncronously + // alter the window size right after the start. + // We do not get any events for this it seems ... + if (gl->frame_count == 10) + { + gl->should_resize = true; + gfx_get_window_size(&gl->win_width, &gl->win_height); + SSNES_LOG("GL: Got resolution %ux%u\n", gl->win_width, gl->win_height); + } } static bool gl_frame(void *data, const void* frame, unsigned width, unsigned height, unsigned pitch, const char *msg) @@ -1109,8 +1125,6 @@ static void* gl_init(const video_info_t *video, const input_driver_t **input, vo } SSNES_LOG("GL: Using resolution %ux%u\n", gl->win_width, gl->win_height); - gfx_get_window_size(&gl->win_width, &gl->win_height); - SSNES_LOG("GL: Got resolution %ux%u\n", gl->win_width, gl->win_height); if (!gl_shader_init()) {