}
/* Make sure the window hasn't been redirected with Composite */
- if (screen->GetWindowPixmap(window) != screen->GetScreenPixmap(screen))
+ if (screen->GetWindowPixmap(window) != screen->GetScreenPixmap(screen) &&
+ screen->GetWindowPixmap(window) != screen_priv->flip_pixmap)
return FALSE;
/* Check for full-screen window */
assert (!screen_priv->unflip_event_id);
assert (!screen_priv->flip_pending);
+ if (screen_priv->flip_window)
+ (*screen->SetWindowPixmap)(screen_priv->flip_window,
+ (*screen->GetScreenPixmap)(screen));
+
/* Update the screen pixmap with the current flip pixmap contents
*/
if (screen_priv->flip_pixmap && screen_priv->flip_window) {
present_execute(present_vblank_ptr vblank, uint64_t ust, uint64_t crtc_msc)
{
WindowPtr window = vblank->window;
- present_screen_priv_ptr screen_priv = present_screen_priv(window->drawable.pScreen);
+ ScreenPtr screen = window->drawable.pScreen;
+ present_screen_priv_ptr screen_priv = present_screen_priv(screen);
if (vblank->wait_fence) {
if (!present_fence_check_triggered(vblank->wait_fence)) {
xorg_list_add(&vblank->event_queue, &present_flip_queue);
/* Try to flip
*/
- if (present_flip(vblank->crtc, vblank->event_id, vblank->target_msc, vblank->pixmap, vblank->sync_flip))
+ if (present_flip(vblank->crtc, vblank->event_id, vblank->target_msc, vblank->pixmap, vblank->sync_flip)) {
+
+ /* Fix window pixmaps:
+ * 1) Restore previous flip window pixmap
+ * 2) Set current flip window pixmap to the new pixmap
+ */
+ if (screen_priv->flip_window && screen_priv->flip_window != window)
+ (*screen->SetWindowPixmap)(screen_priv->flip_window,
+ (*screen->GetScreenPixmap)(screen));
+ (*screen->SetWindowPixmap)(vblank->window, vblank->pixmap);
return;
+ }
xorg_list_del(&vblank->event_queue);
/* Oops, flip failed. Clear the flip_pending field
/* Check current flip
*/
if (window == screen_priv->flip_window)
- present_unflip(window->drawable.pScreen);
+ present_unflip(screen);
}
present_copy_region(&window->drawable, vblank->pixmap, vblank->update, vblank->x_off, vblank->y_off);