diff options
author | Michel Dänzer <mdaenzer@redhat.com> | 2020-11-06 10:14:19 +0100 |
---|---|---|
committer | Michel Dänzer <michel@daenzer.net> | 2020-11-09 09:54:09 +0000 |
commit | df3aa4922fd7e256169e541188b724f67ca948e1 (patch) | |
tree | baad8e59eb3face5396c3ef770938c771ec6cb84 /hw/xwayland/xwayland-window.c | |
parent | 899cebb76ab7754fea49f7babcd64a7e94052cc8 (diff) | |
download | xserver-df3aa4922fd7e256169e541188b724f67ca948e1.tar.gz |
xwayland: Make window_get_client_toplevel non-recursive
Noticed while reading the code.
Reviewed-by: Olivier Fourdan <ofourdan@redhat.com>
Diffstat (limited to 'hw/xwayland/xwayland-window.c')
-rw-r--r-- | hw/xwayland/xwayland-window.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/hw/xwayland/xwayland-window.c b/hw/xwayland/xwayland-window.c index d03790633..486149c4a 100644 --- a/hw/xwayland/xwayland-window.c +++ b/hw/xwayland/xwayland-window.c @@ -257,11 +257,11 @@ window_get_client_toplevel(WindowPtr window) * decoration/wrapper windows. In that case recurse by checking the client * of the first *and only* child of the decoration/wrapper window. */ - if (window_is_wm_window(window)) { - if (window->firstChild && window->firstChild == window->lastChild) - return window_get_client_toplevel(window->firstChild); - else + while (window_is_wm_window(window)) { + if (!window->firstChild || window->firstChild != window->lastChild) return NULL; /* Should never happen, skip resolution emulation */ + + window = window->firstChild; } return window; |