From 10eec2ccb11701fe29ab246acd6c0bdc2991b775 Mon Sep 17 00:00:00 2001 From: Michel Dänzer Date: Thu, 7 Jun 2018 17:55:21 +0200 Subject: present/wnmd: Preserve window pixmap's screen_x/y on flip The incorrect values could result in the new pixmap's contents getting corrupted down the line. v2: * Guard screen_x/y lines by #ifdef COMPOSITE Bugzilla: https://bugs.freedesktop.org/106841 Fixes: 029608dd8020 "present: Add window flip mode" Reviewed-by: Adam Jackson # v1 Reviewed-by: Keith Packard # v1 Reviewed-by: Roman Gilg Tested-by: Olivier Fourdan # v1 --- present/present_wnmd.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/present/present_wnmd.c b/present/present_wnmd.c index 80ffb014e..035ae8ffe 100644 --- a/present/present_wnmd.c +++ b/present/present_wnmd.c @@ -469,6 +469,10 @@ present_wnmd_execute(present_vblank_ptr vblank, uint64_t ust, uint64_t crtc_msc) PixmapPtr old_pixmap = screen->GetWindowPixmap(window); /* Replace window pixmap with flip pixmap */ +#ifdef COMPOSITE + vblank->pixmap->screen_x = old_pixmap->screen_x; + vblank->pixmap->screen_y = old_pixmap->screen_y; +#endif present_set_tree_pixmap(toplvl_window, old_pixmap, vblank->pixmap); vblank->pixmap->refcnt++; dixDestroyPixmap(old_pixmap, old_pixmap->drawable.id); -- cgit v1.2.3