diff options
author | Michel Dänzer <michel.daenzer@amd.com> | 2016-02-18 18:23:47 +0900 |
---|---|---|
committer | Michel Dänzer <michel@daenzer.net> | 2016-03-01 11:59:51 +0900 |
commit | 72328e5eb98a3f27e1f0a0e17beae6db447bd87c (patch) | |
tree | 066ef04fbcfbd9734015958fc2cd874784fedee7 /present | |
parent | 43eb5b6047c9b35c337e553ec054f08bdc835abb (diff) |
present: Only update screen pixmap from flip pixmap once per unflip
present_unflip may be called several times from present_check_flip_window
during the same unflip. We can only copy to the screen pixmap the first
time, otherwise we may scribble over other windows. The flip pixmap
contents don't get updated after the first time anyway.
Fixes at least the following problems, which were introduced by commit
806470b9 ("present: Copy unflip contents back to the Screen Pixmap"):
On xfwm4 without compositing, run glxgears and put its window into
fullscreen mode to start flipping. While in fullscreen, open the xfwm4
window menu by pressing Alt-Space. The window menu was invisible most
of the time because it was getting scribbled over by a repeated unflip
copy.
When switching a flipping window out of fullscreen, a repeated unflip
copy could leave artifacts of the flip pixmap on the desktop.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=94325
Reviewed-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'present')
-rw-r--r-- | present/present.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/present/present.c b/present/present.c index 62865be69..a9241d278 100644 --- a/present/present.c +++ b/present/present.c @@ -443,6 +443,15 @@ present_unflip(ScreenPtr screen) assert (!screen_priv->unflip_event_id); assert (!screen_priv->flip_pending); + /* Update the screen pixmap with the current flip pixmap contents + * Only do this the first time for a particular unflip operation, or + * we'll probably scribble over other windows + */ + if (screen->GetWindowPixmap(screen->root) == screen_priv->flip_pixmap) { + present_copy_region(&pixmap->drawable, screen_priv->flip_pixmap, + NULL, 0, 0); + } + if (screen_priv->flip_pixmap && screen_priv->flip_window) present_set_tree_pixmap(screen_priv->flip_window, screen_priv->flip_pixmap, @@ -450,13 +459,6 @@ present_unflip(ScreenPtr screen) present_set_tree_pixmap(screen->root, NULL, pixmap); - /* Update the screen pixmap with the current flip pixmap contents - */ - if (screen_priv->flip_pixmap && screen_priv->flip_window) { - present_copy_region(&pixmap->drawable, - screen_priv->flip_pixmap, - NULL, 0, 0); - } screen_priv->unflip_event_id = ++present_event_id; DebugPresent(("u %lld\n", screen_priv->unflip_event_id)); (*screen_priv->info->unflip) (screen, screen_priv->unflip_event_id); |