mirror of
https://gitlab.freedesktop.org/xorg/xserver.git
synced 2026-05-09 17:48:06 +02:00
xwayland: Handle GetCurrentClient returning NULL in xwl_reparent_window
It's not the WM client in that case. Fixes crash. Closes: https://gitlab.freedesktop.org/xorg/xserver/-/work_items/1885 Fixes:6aacf04f51("xwayland: Add heuristic for WM windows based on reparenting") (cherry picked from commit6357c9afce) Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2189>
This commit is contained in:
parent
0ca92fb4be
commit
e75146412a
1 changed files with 4 additions and 1 deletions
|
|
@ -1878,6 +1878,7 @@ xwl_reparent_window(WindowPtr window, WindowPtr prior_parent)
|
|||
ScreenPtr screen = window->drawable.pScreen;
|
||||
struct xwl_screen *xwl_screen = xwl_screen_get(screen);
|
||||
WindowPtr parent = window->parent;
|
||||
ClientPtr current_client;
|
||||
Bool *is_wm_window;
|
||||
|
||||
if (xwl_screen->ReparentWindow) {
|
||||
|
|
@ -1887,8 +1888,10 @@ xwl_reparent_window(WindowPtr window, WindowPtr prior_parent)
|
|||
screen->ReparentWindow = xwl_reparent_window;
|
||||
}
|
||||
|
||||
current_client = GetCurrentClient();
|
||||
if (!parent->parent ||
|
||||
GetCurrentClient()->index != xwl_screen->wm_client_id)
|
||||
!current_client ||
|
||||
current_client->index != xwl_screen->wm_client_id)
|
||||
return;
|
||||
|
||||
/* If the WM client reparents a window, mark the new parent as a WM window */
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue