present: Make present_restore_screen_pixmap handle screen->root == NULL

Easier than dealing with it in all paths that can end up here during
server shutdown.

Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
This commit is contained in:
Michel Dänzer 2016-08-03 10:19:19 +09:00 committed by Adam Jackson
parent 4cbf1fb1f9
commit 9f04fa3bab

View File

@ -439,7 +439,7 @@ present_restore_screen_pixmap(ScreenPtr screen)
* Only do this the first time for a particular unflip operation, or
* we'll probably scribble over other windows
*/
if (screen->GetWindowPixmap(screen->root) == flip_pixmap)
if (screen->root && screen->GetWindowPixmap(screen->root) == flip_pixmap)
present_copy_region(&screen_pixmap->drawable, flip_pixmap, NULL, 0, 0);
/* Switch back to using the screen pixmap now to avoid
@ -447,7 +447,8 @@ present_restore_screen_pixmap(ScreenPtr screen)
*/
if (flip_window)
present_set_tree_pixmap(flip_window, flip_pixmap, screen_pixmap);
present_set_tree_pixmap(screen->root, NULL, screen_pixmap);
if (screen->root)
present_set_tree_pixmap(screen->root, NULL, screen_pixmap);
}
static void