Fix #10082: Re-apply _NET_WM_STATE for X11 layer shell windows on each show
Some window managers (e.g. kwin_x11) clear _NET_WM_STATE when a window is unmapped/withdrawn. This caused layer shell windows to lose states like _NET_WM_STATE_ABOVE, _NET_WM_STATE_SKIP_TASKBAR, etc. when hidden and re-shown via toggle. The result was inconsistent behaviour between the first show and subsequent shows. Fix by calling update_wm_hints() before XMapWindow in _glfwPlatformShowWindow() for layer shell windows, which re-applies all WM state properties (_NET_WM_STATE, window type, strut, size hints) before each map operation.
This commit is contained in:
parent
3fc5bed364
commit
0146b02aaf
1 changed files with 9 additions and 2 deletions
11
glfw/x11_window.c
vendored
11
glfw/x11_window.c
vendored
|
|
@ -3021,11 +3021,18 @@ void _glfwPlatformShowWindow(_GLFWwindow* window, bool move_to_active_screen UNU
|
||||||
if (_glfwPlatformWindowVisible(window))
|
if (_glfwPlatformWindowVisible(window))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
XMapWindow(_glfw.x11.display, window->x11.handle);
|
|
||||||
// without this floating window position is incorrect on KDE
|
|
||||||
if (window->x11.layer_shell.is_active) {
|
if (window->x11.layer_shell.is_active) {
|
||||||
WindowGeometry wg = calculate_layer_geometry(window);
|
WindowGeometry wg = calculate_layer_geometry(window);
|
||||||
|
// Re-apply WM hints before mapping because some window managers (e.g.
|
||||||
|
// kwin_x11) clear _NET_WM_STATE when a window is unmapped/withdrawn,
|
||||||
|
// causing _NET_WM_STATE_ABOVE, _NET_WM_STATE_SKIP_TASKBAR and other
|
||||||
|
// states to be lost on the next map.
|
||||||
|
update_wm_hints(window, &wg, NULL);
|
||||||
|
XMapWindow(_glfw.x11.display, window->x11.handle);
|
||||||
|
// without this floating window position is incorrect on KDE
|
||||||
_glfwPlatformSetWindowPos(window, wg.x, wg.y);
|
_glfwPlatformSetWindowPos(window, wg.x, wg.y);
|
||||||
|
} else {
|
||||||
|
XMapWindow(_glfw.x11.display, window->x11.handle);
|
||||||
}
|
}
|
||||||
waitForVisibilityNotify(window);
|
waitForVisibilityNotify(window);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue