mirror of
https://github.com/glfw/glfw.git
synced 2024-11-30 05:47:10 +00:00
Prevent a crash when giving focus to a non-GLFWwindow surface
This commit is contained in:
parent
552e40a4be
commit
5b65b9b860
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user