From 1f69a5dcc075015692d9f26db359f9b6a3f8e0d6 Mon Sep 17 00:00:00 2001 From: Doug Binks Date: Thu, 17 May 2018 13:23:51 +0100 Subject: [PATCH] Added GLFW_FOCUS_ON_SHOW as a supported attributed for glfwSetWindowAttrib --- include/GLFW/glfw3.h | 1 + src/window.c | 2 ++ 2 files changed, 3 insertions(+) diff --git a/include/GLFW/glfw3.h b/include/GLFW/glfw3.h index 241508e8d..4bbf27900 100644 --- a/include/GLFW/glfw3.h +++ b/include/GLFW/glfw3.h @@ -3322,6 +3322,7 @@ GLFWAPI int glfwGetWindowAttrib(GLFWwindow* window, int attrib); * [GLFW_RESIZABLE](@ref GLFW_RESIZABLE_attrib), * [GLFW_FLOATING](@ref GLFW_FLOATING_attrib) and * [GLFW_AUTO_ICONIFY](@ref GLFW_AUTO_ICONIFY_attrib). + * [GLFW_FOCUS_ON_SHOW](@ref GLFW_FOCUS_ON_SHOW_attrib). * * Some of these attributes are ignored for full screen windows. The new * value will take effect if the window is later made windowed. diff --git a/src/window.c b/src/window.c index 85351ade8..2616d24a6 100644 --- a/src/window.c +++ b/src/window.c @@ -895,6 +895,8 @@ GLFWAPI void glfwSetWindowAttrib(GLFWwindow* handle, int attrib, int value) if (!window->monitor) _glfwPlatformSetWindowFloating(window, value); } + else if (attrib == GLFW_FOCUS_ON_SHOW) + window->focusOnShow = value; else _glfwInputError(GLFW_INVALID_ENUM, "Invalid window attribute 0x%08X", attrib); }