Use focus policy for controlling input on X11

This commit is contained in:
Kovid Goyal 2025-05-01 21:42:00 +05:30
parent 07342ca801
commit ca688be41c
No known key found for this signature in database
GPG key ID: 06BC317B515ACE7C

2
glfw/x11_window.c vendored
View file

@ -616,7 +616,7 @@ update_wm_hints(_GLFWwindow *window, const WindowGeometry *wg, const _GLFWwndcon
hints->flags = StateHint | InputHint;
hints->initial_state = NormalState;
hints->input = true;
if (is_layer_shell && (config.type == GLFW_LAYER_SHELL_BACKGROUND || config.type == GLFW_LAYER_SHELL_PANEL)) hints->input = false;
if (is_layer_shell && config.focus_policy == GLFW_FOCUS_NOT_ALLOWED) hints->input = false;
XSetWMHints(_glfw.x11.display, window->x11.handle, hints);
XFree(hints);
} else _glfwInputError(GLFW_OUT_OF_MEMORY, "X11: Failed to allocate WM hints");