xwayland/glamor: Try manual redirect only if parent window has depth 32

That's the case 8e8bc0a1ef ("xwayland: Try manual redirection for
surface window in glamor_check_flip") was intended for. If the parent
window doesn't have depth 32, the automatic redirection might have been
done by a client, in which case doing the manual redirection may run
into trouble.

Fixes: 8e8bc0a1ef ("xwayland: Try manual redirection for surface window in glamor_check_flip")
Closes: https://gitlab.freedesktop.org/xorg/xserver/-/issues/1724
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1637>
This commit is contained in:
Michel Dänzer 2024-08-05 18:42:36 +02:00 committed by Michel Dänzer
parent ff8ec59c97
commit e6c649e6e6

View File

@ -104,7 +104,8 @@ xwl_glamor_check_flip(WindowPtr present_window, PixmapPtr pixmap)
} }
if (surface_window->redirectDraw == RedirectDrawAutomatic && if (surface_window->redirectDraw == RedirectDrawAutomatic &&
surface_window->drawable.depth != 32) surface_window->drawable.depth != 32 &&
surface_window->parent->drawable.depth == 32)
xwl_present_maybe_redirect_window(surface_window); xwl_present_maybe_redirect_window(surface_window);
return TRUE; return TRUE;