Changed state attribs to direct access.

Changed the window states (focused, iconified and visible) to query the
system directly.

THIS IS A BREAKING CHANGE, although a fairly obscure one.  It affects
applications that both care about telling actual key events from
synthetic ones, and are implemented in a non-self-synchronizing way, and
that poll the GLFW_FOCUSED window attribute instead of using the window
focus callback.

If you maintain one of these, please feel free to drop me an email and
I'll help any way I can to transition your application to 3.1.

Fixes #189.
Fixes #204.
This commit is contained in:
Camilla Berglund
2014-12-26 12:25:48 +01:00
parent f9c1f85f02
commit 641761ddb0
8 changed files with 159 additions and 139 deletions
+4 -11
View File
@@ -84,8 +84,6 @@ void _glfwInputWindowSize(_GLFWwindow* window, int width, int height)
void _glfwInputWindowIconify(_GLFWwindow* window, int iconified)
{
window->iconified = iconified;
if (window->callbacks.iconify)
window->callbacks.iconify((GLFWwindow*) window, iconified);
}
@@ -96,11 +94,6 @@ void _glfwInputFramebufferSize(_GLFWwindow* window, int width, int height)
window->callbacks.fbsize((GLFWwindow*) window, width, height);
}
void _glfwInputWindowVisibility(_GLFWwindow* window, int visible)
{
window->visible = visible;
}
void _glfwInputWindowDamage(_GLFWwindow* window)
{
if (window->callbacks.refresh)
@@ -600,17 +593,17 @@ GLFWAPI int glfwGetWindowAttrib(GLFWwindow* handle, int attrib)
switch (attrib)
{
case GLFW_FOCUSED:
return window == _glfw.focusedWindow;
return _glfwPlatformWindowFocused(window);
case GLFW_ICONIFIED:
return window->iconified;
return _glfwPlatformWindowIconified(window);
case GLFW_VISIBLE:
return _glfwPlatformWindowVisible(window);
case GLFW_RESIZABLE:
return window->resizable;
case GLFW_DECORATED:
return window->decorated;
case GLFW_FLOATING:
return window->floating;
case GLFW_VISIBLE:
return window->visible;
case GLFW_CLIENT_API:
return window->context.api;
case GLFW_CONTEXT_VERSION_MAJOR: