mirror of
https://github.com/glfw/glfw.git
synced 2026-09-21 08:39:45 +00:00
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:
+12
-3
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user