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
+12 -3
View File
@@ -231,10 +231,9 @@ GLFWAPI GLFWwindow* glfwCreateWindow(int width, int height,
{
if (wndconfig.visible)
{
_glfwPlatformShowWindow(window);
if (wndconfig.focused)
_glfwPlatformShowWindow(window);
else
_glfwPlatformUnhideWindow(window);
_glfwPlatformFocusWindow(window);
}
}
@@ -629,6 +628,16 @@ GLFWAPI void glfwHideWindow(GLFWwindow* handle)
_glfwPlatformHideWindow(window);
}
GLFWAPI void glfwFocusWindow(GLFWwindow* handle)
{
_GLFWwindow* window = (_GLFWwindow*) handle;
assert(window);
_GLFW_REQUIRE_INIT();
_glfwPlatformFocusWindow(window);
}
GLFWAPI int glfwGetWindowAttrib(GLFWwindow* handle, int attrib)
{
_GLFWwindow* window = (_GLFWwindow*) handle;