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: 029608dd80 "present: Add window flip mode"
Reviewed-by: Adam Jackson <ajax@redhat.com> # v1
Reviewed-by: Keith Packard <keithp@keithp.com> # v1
Reviewed-by: Roman Gilg <subdiff@gmail.com>
Tested-by: Olivier Fourdan <ofourdan@redhat.com> # v1
This commit is contained in:
Michel Dänzer 2018-06-07 17:55:21 +02:00 committed by Michel Dänzer
parent 6300049a9a
commit 10eec2ccb1
1 changed files with 4 additions and 0 deletions

View File

@ -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);