diff --git a/hw/xwayland/xwayland-glamor.c b/hw/xwayland/xwayland-glamor.c index 3c03b2523..9ac1aa8d4 100644 --- a/hw/xwayland/xwayland-glamor.c +++ b/hw/xwayland/xwayland-glamor.c @@ -85,9 +85,14 @@ glamor_egl_screen_init(ScreenPtr screen, struct glamor_context *glamor_ctx) } Bool -xwl_glamor_check_flip(PixmapPtr pixmap) +xwl_glamor_check_flip(WindowPtr present_window, PixmapPtr pixmap) { - struct xwl_screen *xwl_screen = xwl_screen_get(pixmap->drawable.pScreen); + ScreenPtr screen = pixmap->drawable.pScreen; + struct xwl_screen *xwl_screen = xwl_screen_get(screen); + PixmapPtr backing_pixmap = screen->GetWindowPixmap(present_window); + + if (pixmap->drawable.depth != backing_pixmap->drawable.depth) + return FALSE; if (!xwl_glamor_pixmap_get_wl_buffer(pixmap)) return FALSE; diff --git a/hw/xwayland/xwayland-glamor.h b/hw/xwayland/xwayland-glamor.h index 313d7faf1..183fe755a 100644 --- a/hw/xwayland/xwayland-glamor.h +++ b/hw/xwayland/xwayland-glamor.h @@ -149,7 +149,7 @@ Bool xwl_glamor_get_drawable_modifiers_and_scanout(DrawablePtr drawable, Bool *supports_scanout); Bool xwl_glamor_get_drawable_modifiers(DrawablePtr drawable, uint32_t format, uint32_t *num_modifiers, uint64_t **modifiers); -Bool xwl_glamor_check_flip(PixmapPtr pixmap); +Bool xwl_glamor_check_flip(WindowPtr present_window, PixmapPtr pixmap); PixmapPtr xwl_glamor_create_pixmap_for_window (struct xwl_window *xwl_window); #ifdef XV diff --git a/hw/xwayland/xwayland-present.c b/hw/xwayland/xwayland-present.c index 42fd0067a..5ede33e4c 100644 --- a/hw/xwayland/xwayland-present.c +++ b/hw/xwayland/xwayland-present.c @@ -676,7 +676,7 @@ xwl_present_check_flip(RRCrtcPtr crtc, if (!RegionEqual(&present_window->clipList, &present_window->winSize)) return FALSE; - if (!xwl_glamor_check_flip(pixmap)) + if (!xwl_glamor_check_flip(present_window, pixmap)) return FALSE; /* Can't flip if the window pixmap doesn't match the xwl_window parent