X11: Fix BadMatch focusing a window on non-EWMH WM

When the WM does not support EWMH or there is no WM running, GLFW falls
back to XSetInputFocus, which will emit BadMatch if the window is not
viewable, which will terminate the program.

Bug spotted on IRC.
This commit is contained in:
Camilla Löwy
2020-01-05 14:34:39 +01:00
parent fe57e3c292
commit aa5e313561
2 changed files with 2 additions and 1 deletions
+1 -1
View File
@@ -2457,7 +2457,7 @@ void _glfwPlatformFocusWindow(_GLFWwindow* window)
{
if (_glfw.x11.NET_ACTIVE_WINDOW)
sendEventToWM(window, _glfw.x11.NET_ACTIVE_WINDOW, 1, 0, 0, 0, 0);
else
else if (_glfwPlatformWindowVisible(window))
{
XRaiseWindow(_glfw.x11.display, window->x11.handle);
XSetInputFocus(_glfw.x11.display, window->x11.handle,