From fb6fbcf700e79cb643413b6b3cbde11f6a8a23ed Mon Sep 17 00:00:00 2001 From: Camilla Berglund Date: Wed, 9 Sep 2015 13:31:40 +0200 Subject: [PATCH] Fix video modes not restored when hiding OS X app --- README.md | 2 ++ src/cocoa_window.m | 8 ++++++++ 2 files changed, 10 insertions(+) diff --git a/README.md b/README.md index 061eed1f..3cd9884c 100644 --- a/README.md +++ b/README.md @@ -92,6 +92,8 @@ GLFW bundles a number of dependencies in the `deps/` directory. - [Cocoa] Bugfix: The primary monitor would get reported as disconnected when entering full screen on a dual-GPU machine with automatic graphics switching + - [Cocoa] Bugfix: The original video modes were not restored when the + application was hidden - [X11] Bugfix: `glfwInit` would segfault on systems without RandR - [X11] Bugfix: The response to `_NET_WM_PING` was sent to the wrong window - [X11] Bugfix: Character input via XIM did not work in many cases diff --git a/src/cocoa_window.m b/src/cocoa_window.m index 70af3dfd..54d528ae 100644 --- a/src/cocoa_window.m +++ b/src/cocoa_window.m @@ -287,6 +287,14 @@ static int translateKey(unsigned int key) _glfwPlatformPostEmptyEvent(); } +- (void)applicationDidHide:(NSNotification *)notification +{ + int i; + + for (i = 0; i < _glfw.monitorCount; i++) + _glfwRestoreVideoMode(_glfw.monitors[i]); +} + @end