From 70c5edea8d9f576c76fbc98b8b8d728bd38e94a2 Mon Sep 17 00:00:00 2001 From: Mark Vejvoda Date: Wed, 2 Nov 2011 20:25:55 +0000 Subject: [PATCH] trying to fix alt-tab issue in windows --- .../sources/platform/sdl/window.cpp | 32 ++----------------- 1 file changed, 2 insertions(+), 30 deletions(-) diff --git a/source/shared_lib/sources/platform/sdl/window.cpp b/source/shared_lib/sources/platform/sdl/window.cpp index 4f2c0334..8c15f36e 100644 --- a/source/shared_lib/sources/platform/sdl/window.cpp +++ b/source/shared_lib/sources/platform/sdl/window.cpp @@ -246,6 +246,8 @@ bool Window::handleEvent() { codeLocation = "k"; if(SystemFlags::getSystemSettingType(SystemFlags::debugSystem).enabled) SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d] SDL_ACTIVEEVENT event.active.state = %d event.active. = %d\n",__FILE__,__FUNCTION__,__LINE__,event.active.state,event.active.gain); + if(SystemFlags::VERBOSE_MODE_ENABLED) printf ("In [%s::%s Line: %d] Window::isActive = %d event.active.state = %d\n",__FILE__,__FUNCTION__,__LINE__,Window::isActive,event.active.state); + // Check if the program has lost window focus if ((event.active.state & SDL_APPACTIVE) == SDL_APPACTIVE) { if (event.active.gain == 0) { @@ -253,21 +255,6 @@ bool Window::handleEvent() { } else { Window::isActive = true; -#ifdef WIN32 - HWND handle = GetSDLWindow(); - if(Window::isFullScreen == true) { - if(SystemFlags::getSystemSettingType(SystemFlags::debugSystem).enabled) SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s %d] Window::isFullScreen == true [%d]\n",__FILE__,__FUNCTION__,__LINE__,handle); - ShowWindow(handle, SW_MAXIMIZE); - //if(Window::getUseDefaultCursorOnly() == false) { - // showCursor(false); - //} - } - else { - if(SystemFlags::getSystemSettingType(SystemFlags::debugSystem).enabled) SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s %d] Window::isFullScreen == false [%d]\n",__FILE__,__FUNCTION__,__LINE__,handle); - ShowWindow(handle, SW_RESTORE); - //showCursor(true); - } -#endif } if(SystemFlags::VERBOSE_MODE_ENABLED) printf ("In [%s::%s Line: %d] Window::isActive = %d \n",__FILE__,__FUNCTION__,__LINE__,Window::isActive); @@ -287,21 +274,6 @@ bool Window::handleEvent() { //else if (event.active.gain == 1) { else { Window::isActive = true; -#ifdef WIN32 - HWND handle = GetSDLWindow(); - if(Window::isFullScreen == true) { - if(SystemFlags::getSystemSettingType(SystemFlags::debugSystem).enabled) SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s %d] Window::isFullScreen == true [%d]\n",__FILE__,__FUNCTION__,__LINE__,handle); - ShowWindow(handle, SW_MAXIMIZE); - //if(Window::getUseDefaultCursorOnly() == false) { - // showCursor(false); - //} - } - else { - if(SystemFlags::getSystemSettingType(SystemFlags::debugSystem).enabled) SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s %d] Window::isFullScreen == false [%d]\n",__FILE__,__FUNCTION__,__LINE__,handle); - ShowWindow(handle, SW_RESTORE); - //showCursor(true); - } -#endif } if(SystemFlags::VERBOSE_MODE_ENABLED) printf ("In [%s::%s Line: %d] Window::isActive = %d \n",__FILE__,__FUNCTION__,__LINE__,Window::isActive);