From 5b65b9b860c6ced4a547e8b5ea5ab8921dc3daf6 Mon Sep 17 00:00:00 2001 From: Emmanuel Gil Peyrot Date: Tue, 19 Dec 2017 19:06:40 +0100 Subject: [PATCH] Prevent a crash when giving focus to a non-GLFWwindow surface --- src/wl_init.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/wl_init.c b/src/wl_init.c index f3e0cb8b..d7239836 100644 --- a/src/wl_init.c +++ b/src/wl_init.c @@ -54,6 +54,8 @@ static void pointerHandleEnter(void* data, return; _GLFWwindow* window = wl_surface_get_user_data(surface); + if (!window) + return; _glfw.wl.pointerSerial = serial; _glfw.wl.pointerFocus = window; @@ -280,6 +282,8 @@ static void keyboardHandleEnter(void* data, return; _GLFWwindow* window = wl_surface_get_user_data(surface); + if (!window) + return; _glfw.wl.keyboardFocus = window; _glfwInputWindowFocus(window, GLFW_TRUE);