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:
parent
af3cf5087b
commit
b2bf3cc0ee
2 changed files with 7 additions and 1 deletions
|
@ -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
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Add table
Reference in a new issue