From d78510457cc400f5a792cdcae31f7af38b70d7fa Mon Sep 17 00:00:00 2001 From: Camilla Berglund Date: Thu, 17 Oct 2013 19:59:09 +0200 Subject: [PATCH] Added hack for full screen focus on OS X. --- README.md | 1 + src/cocoa_window.m | 10 ++++++++++ 2 files changed, 11 insertions(+) diff --git a/README.md b/README.md index 44862901..21d65a10 100644 --- a/README.md +++ b/README.md @@ -228,6 +228,7 @@ See the [GLFW documentation](http://www.glfw.org/docs/latest/). having been set to hidden outside it - [Cocoa] Bugfix: The refresh rate was zero for all modes of certain monitors - [Cocoa] Bugfix: The `install_name` field of the dynamic library was not set + - [Cocoa] Bugfix: Full screen windows were never reported as having focus - [X11] Added setting of the `WM_CLASS` property to the initial window title diff --git a/src/cocoa_window.m b/src/cocoa_window.m index 97338a97..1bf60dfa 100644 --- a/src/cocoa_window.m +++ b/src/cocoa_window.m @@ -65,6 +65,11 @@ static void enterFullscreenMode(_GLFWwindow* window) [window->ns.view enterFullScreenMode:window->monitor->ns.screen withOptions:options]; + + // HACK: Synthesize focus event as window does not become key when the view + // is made full screen + // TODO: Remove this when moving to a full screen window + _glfwInputWindowFocus(window, GL_TRUE); } // Leave fullscreen mode @@ -74,6 +79,11 @@ static void leaveFullscreenMode(_GLFWwindow* window) if (![window->ns.view isInFullScreenMode]) return; + // HACK: Synthesize focus event as window does not become key when the view + // is made full screen + // TODO: Remove this when moving to a full screen window + _glfwInputWindowFocus(window, GL_FALSE); + _glfwRestoreVideoMode(window->monitor); // Exit full screen after the video restore to avoid a nasty display