Added hack for full screen focus on OS X.

This commit is contained in:
Camilla Berglund 2013-10-17 19:59:09 +02:00
parent dbdf01d4a0
commit d78510457c
2 changed files with 11 additions and 0 deletions

View File

@ -228,6 +228,7 @@ See the [GLFW documentation](http://www.glfw.org/docs/latest/).
having been set to hidden outside it having been set to hidden outside it
- [Cocoa] Bugfix: The refresh rate was zero for all modes of certain monitors - [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: 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 - [X11] Added setting of the `WM_CLASS` property to the initial window title

View File

@ -65,6 +65,11 @@ static void enterFullscreenMode(_GLFWwindow* window)
[window->ns.view enterFullScreenMode:window->monitor->ns.screen [window->ns.view enterFullScreenMode:window->monitor->ns.screen
withOptions:options]; 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 // Leave fullscreen mode
@ -74,6 +79,11 @@ static void leaveFullscreenMode(_GLFWwindow* window)
if (![window->ns.view isInFullScreenMode]) if (![window->ns.view isInFullScreenMode])
return; 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); _glfwRestoreVideoMode(window->monitor);
// Exit full screen after the video restore to avoid a nasty display // Exit full screen after the video restore to avoid a nasty display