Add glfwFocusWindow

This removes the (undocumented) behavior where glfwShowWindow would
bring the window to front and set input focus.  That function now
does what it says.
This commit is contained in:
Camilla Berglund
2016-02-21 15:42:49 +01:00
parent de3e413aab
commit baf574494d
11 changed files with 103 additions and 51 deletions
+11 -10
View File
@@ -84,6 +84,7 @@ static GLFWbool enterFullscreenMode(_GLFWwindow* window)
bounds.size.height);
[window->ns.object setFrame:frame display:YES];
_glfwPlatformFocusWindow(window);
return status;
}
@@ -1039,6 +1040,16 @@ void _glfwPlatformMaximizeWindow(_GLFWwindow* window)
}
void _glfwPlatformShowWindow(_GLFWwindow* window)
{
[window->ns.object orderFront:nil];
}
void _glfwPlatformHideWindow(_GLFWwindow* window)
{
[window->ns.object orderOut:nil];
}
void _glfwPlatformFocusWindow(_GLFWwindow* window)
{
// Make us the active application
// HACK: This has been moved here from initializeAppKit to prevent
@@ -1049,16 +1060,6 @@ void _glfwPlatformShowWindow(_GLFWwindow* window)
[window->ns.object makeKeyAndOrderFront:nil];
}
void _glfwPlatformUnhideWindow(_GLFWwindow* window)
{
[window->ns.object orderFront:nil];
}
void _glfwPlatformHideWindow(_GLFWwindow* window)
{
[window->ns.object orderOut:nil];
}
int _glfwPlatformWindowFocused(_GLFWwindow* window)
{
return [window->ns.object isKeyWindow];