From 56e600d7a14a37e0b2c180c24d61dd378845db78 Mon Sep 17 00:00:00 2001 From: Camilla Berglund Date: Thu, 5 Dec 2013 02:15:14 +0100 Subject: [PATCH] Fixed iconify callback not triggered by Alt+Tab. --- README.md | 2 ++ src/win32_window.c | 13 +++++++++++++ 2 files changed, 15 insertions(+) diff --git a/README.md b/README.md index 7cd6f31e..1ef8b7fa 100644 --- a/README.md +++ b/README.md @@ -47,6 +47,8 @@ guide in the GLFW documentation. unfocused windows - [Win32] Bugfix: Cursor was not properly re-centered over odd-sized windows - [Win32] Bugfix: Negative window positions were reported incorrectly + - [Win32] Bugfix: The iconify callback was not triggered when switching away + from a full screen window using Alt+Tab - [Cocoa] Added dependency on CoreVideo framework for refresh rate retrieval - [Cocoa] Enabled Lion full screen for resizable windowed mode windows - [Cocoa] Moved to Cocoa API for application transformation and activation diff --git a/src/win32_window.c b/src/win32_window.c index f9840021..32b6ff21 100644 --- a/src/win32_window.c +++ b/src/win32_window.c @@ -442,6 +442,19 @@ static LRESULT CALLBACK windowProc(HWND hWnd, UINT uMsg, return 0; } + case WM_ACTIVATEAPP: + { + if (!wParam && IsIconic(hWnd)) + { + // This is a workaround for full screen windows losing focus + // through Alt+Tab leading to windows being told they're + // unfocused and restored and then never told they're iconified + _glfwInputWindowIconify(window, GL_TRUE); + } + + return 0; + } + case WM_SHOWWINDOW: { _glfwInputWindowVisibility(window, wParam ? GL_TRUE : GL_FALSE);