From 39cbcdf187ec64f0a897d0b123025022d1122b54 Mon Sep 17 00:00:00 2001 From: Alexander Kuznetsov Date: Mon, 15 Aug 2011 16:26:37 +0000 Subject: Window was losing focus when switching from full screen via Alt+F11 Fixes [#28243] --- intern/ghost/intern/GHOST_WindowWin32.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'intern') diff --git a/intern/ghost/intern/GHOST_WindowWin32.cpp b/intern/ghost/intern/GHOST_WindowWin32.cpp index 1ba51376ff9..0c8c0adf041 100644 --- a/intern/ghost/intern/GHOST_WindowWin32.cpp +++ b/intern/ghost/intern/GHOST_WindowWin32.cpp @@ -612,7 +612,6 @@ GHOST_TSuccess GHOST_WindowWin32::setState(GHOST_TWindowState state) wp.showCmd = SW_SHOWMINIMIZED; break; case GHOST_kWindowStateMaximized: - ShowWindow(m_hWnd, SW_HIDE); wp.showCmd = SW_SHOWMAXIMIZED; SetWindowLongPtr(m_hWnd, GWL_STYLE, WS_OVERLAPPEDWINDOW); break; @@ -629,12 +628,12 @@ GHOST_TSuccess GHOST_WindowWin32::setState(GHOST_TWindowState state) break; case GHOST_kWindowStateNormal: default: - ShowWindow(m_hWnd, SW_HIDE); wp.showCmd = SW_SHOWNORMAL; SetWindowLongPtr(m_hWnd, GWL_STYLE, WS_OVERLAPPEDWINDOW); break; } - return ::SetWindowPlacement(m_hWnd, &wp) == TRUE ? GHOST_kSuccess : GHOST_kFailure; + SetWindowPos(m_hWnd, 0, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_NOZORDER | SWP_FRAMECHANGED); /*Clears window cache for SetWindowLongPtr */ + return ::SetWindowPlacement(m_hWnd, &wp) == TRUE ? GHOST_kSuccess : GHOST_kFailure; } -- cgit v1.2.3