1
0
Fork 0
mirror of https://github.com/yshui/picom.git synced 2025-04-14 17:53:25 -04:00

wm: allow wm_find_by_client to be called with the root window

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 af3cf5087b
commit b2bf3cc0ee
No known key found for this signature in database
GPG key ID: D3A4405BE6CC17F4
2 changed files with 7 additions and 1 deletions

View file

@ -14,6 +14,10 @@
- `sw-opti`
- `clear-shadow`
## Bug fixes
* Fix assertion failure when running with some window managers (e.g. qtile) and no window is focused (#1384)
# 12.x (unreleased)
## Build fixes

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);