wayland: Release input focus when window is destroyed

This fixes a seg. fault on the reopen test because events might occur
after the window is destroyed (for example leave events).
This commit is contained in:
Ricardo Vieira
2014-07-26 21:55:43 +01:00
parent c39ebfe1b8
commit a7c9ca3b43
2 changed files with 30 additions and 2 deletions
+11
View File
@@ -127,6 +127,17 @@ int _glfwPlatformCreateWindow(_GLFWwindow* window,
void _glfwPlatformDestroyWindow(_GLFWwindow* window)
{
if (window == _glfw.wl.pointerFocus)
{
_glfw.wl.pointerFocus = NULL;
_glfwInputCursorEnter(window, GL_FALSE);
}
if (window == _glfw.wl.keyboardFocus)
{
_glfw.wl.keyboardFocus = NULL;
_glfwInputWindowFocus(window, GL_FALSE);
}
_glfwDestroyContext(window);
if (window->wl.native)