From 7029f7aa986f5781b9888d7e389fd7f7bc9a198b Mon Sep 17 00:00:00 2001 From: "gregory.hainaut@gmail.com" Date: Sun, 24 Apr 2011 16:00:36 +0000 Subject: [PATCH] GSdx: linux: polish window management. 1/ Allow a resize of the render zone. 2/ Do not update title in fullscreen which create some flashes git-svn-id: http://pcsx2.googlecode.com/svn/trunk@4591 96395faa-99c1-11dd-bbfe-3dabce05a288 --- plugins/GSdx/GSWnd.cpp | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/plugins/GSdx/GSWnd.cpp b/plugins/GSdx/GSWnd.cpp index 6c19f0d82d..7f4c98088b 100644 --- a/plugins/GSdx/GSWnd.cpp +++ b/plugins/GSdx/GSWnd.cpp @@ -380,10 +380,14 @@ Display* GSWnd::GetDisplay() GSVector4i GSWnd::GetClientRect() { - // TODO - int h, w; - w = theApp.GetConfig("ModeWidth", 640); - h = theApp.GetConfig("ModeHeight", 480); + // Get all SDL events. It refreshes the window parameter do not ask why. + // Anyway it allow to properly resize the window surface + // FIXME: it does not feel a good solution -- Gregory + SDL_PumpEvents(); + + int h = 480; + int w = 640; + if (m_window) SDL_GetWindowSize(m_window, &w, &h); return GSVector4i(0, 0, w, h); } @@ -393,6 +397,16 @@ GSVector4i GSWnd::GetClientRect() bool GSWnd::SetWindowText(const char* title) { + // Do not find anyway to check the current fullscreen status + // Better than nothing heuristic, check the window position. Fullscreen = (0,0) + // if(!(m_window->flags & SDL_WINDOW_FULLSCREEN) ) // Do not compile + // + // Same as GetClientRect. We call SDL_PumpEvents to refresh x and y value + // FIXME: it does not feel a good solution -- Gregory + SDL_PumpEvents(); + int x,y = 0; + SDL_GetWindowPosition(m_window, &x, &y); + if ( x && y ) SDL_SetWindowTitle(m_window, title); return true;