mirror of
https://github.com/glfw/glfw.git
synced 2026-09-20 16:30:45 +00:00
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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user