1
0
Fork 0
mirror of https://github.com/yshui/picom.git synced 2025-11-06 22:54:14 -05:00

wm: allow wm_find_by_client to be called with the root window

(cherry picked from commit b2bf3cc0ee)

Some window managers (e.g. qtile) may set _NET_ACTIVE_WINDOW to the root
window, and in that case `update_ewmh_active_win` will call
`wm_find_by_client` with the root, which crashes.

Fixes #1384

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
This commit is contained in:
Yuxuan Shui 2024-11-11 18:35:32 +00:00
parent ab6ca6c1e4
commit 2fdeac0f1c
No known key found for this signature in database
GPG key ID: D3A4405BE6CC17F4
2 changed files with 9 additions and 1 deletions

View file

@ -1,3 +1,9 @@
# 12.x (unreleased)
## Bug fixes
* Fix assertion failure when running with some window managers (e.g. qtile) and no window is focused (#1384)
# 12.4 (2024-Nov-09)
## Improvements

View file

@ -187,7 +187,9 @@ struct wm_ref *wm_find(const struct wm *wm, xcb_window_t id) {
struct wm_ref *wm_find_by_client(const struct wm *wm, xcb_window_t client) {
auto node = wm_tree_find(&wm->tree, client);
if (node == NULL) {
if (node == NULL || node->parent == NULL) {
// If `client` is the root window, we return NULL too, technically
// the root window doesn't have a client window.
return NULL;
}
auto toplevel = wm_tree_find_toplevel_for(&wm->tree, node);