mirror of
https://github.com/glfw/glfw.git
synced 2024-11-29 13:32:01 +00:00
Ignore cached state when setting window attributes
This filtering prevented valid changes if the native window state was changed externally.
This commit is contained in:
parent
9c62a21ba9
commit
17ae300d96
12
src/window.c
12
src/window.c
@ -882,27 +882,18 @@ GLFWAPI void glfwSetWindowAttrib(GLFWwindow* handle, int attrib, int value)
|
|||||||
window->autoIconify = value;
|
window->autoIconify = value;
|
||||||
else if (attrib == GLFW_RESIZABLE)
|
else if (attrib == GLFW_RESIZABLE)
|
||||||
{
|
{
|
||||||
if (window->resizable == value)
|
|
||||||
return;
|
|
||||||
|
|
||||||
window->resizable = value;
|
window->resizable = value;
|
||||||
if (!window->monitor)
|
if (!window->monitor)
|
||||||
_glfwPlatformSetWindowResizable(window, value);
|
_glfwPlatformSetWindowResizable(window, value);
|
||||||
}
|
}
|
||||||
else if (attrib == GLFW_DECORATED)
|
else if (attrib == GLFW_DECORATED)
|
||||||
{
|
{
|
||||||
if (window->decorated == value)
|
|
||||||
return;
|
|
||||||
|
|
||||||
window->decorated = value;
|
window->decorated = value;
|
||||||
if (!window->monitor)
|
if (!window->monitor)
|
||||||
_glfwPlatformSetWindowDecorated(window, value);
|
_glfwPlatformSetWindowDecorated(window, value);
|
||||||
}
|
}
|
||||||
else if (attrib == GLFW_FLOATING)
|
else if (attrib == GLFW_FLOATING)
|
||||||
{
|
{
|
||||||
if (window->floating == value)
|
|
||||||
return;
|
|
||||||
|
|
||||||
window->floating = value;
|
window->floating = value;
|
||||||
if (!window->monitor)
|
if (!window->monitor)
|
||||||
_glfwPlatformSetWindowFloating(window, value);
|
_glfwPlatformSetWindowFloating(window, value);
|
||||||
@ -911,9 +902,6 @@ GLFWAPI void glfwSetWindowAttrib(GLFWwindow* handle, int attrib, int value)
|
|||||||
window->focusOnShow = value;
|
window->focusOnShow = value;
|
||||||
else if (attrib == GLFW_MOUSE_PASSTHROUGH)
|
else if (attrib == GLFW_MOUSE_PASSTHROUGH)
|
||||||
{
|
{
|
||||||
if (window->mousePassthrough == value)
|
|
||||||
return;
|
|
||||||
|
|
||||||
window->mousePassthrough = value;
|
window->mousePassthrough = value;
|
||||||
_glfwPlatformSetWindowMousePassthrough(window, value);
|
_glfwPlatformSetWindowMousePassthrough(window, value);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user