summaryrefslogtreecommitdiff
path: root/tools/virtual.c
diff options
context:
space:
mode:
Diffstat (limited to 'tools/virtual.c')
-rw-r--r--tools/virtual.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/tools/virtual.c b/tools/virtual.c
index b2f3069f..8803feab 100644
--- a/tools/virtual.c
+++ b/tools/virtual.c
@@ -827,6 +827,9 @@ static void output_init_xfer(struct clone *clone, struct output *output)
{
if (output->use_shm_pixmap) {
DBG(("%s-%s: creating shm pixmap\n", DisplayString(output->dpy), output->name));
+ XSync(output->dpy, False);
+ _x_error_occurred = 0;
+
if (output->pixmap)
XFreePixmap(output->dpy, output->pixmap);
output->pixmap = XShmCreatePixmap(output->dpy, output->window,
@@ -836,6 +839,13 @@ static void output_init_xfer(struct clone *clone, struct output *output)
XRenderFreePicture(output->dpy, output->pix_picture);
output->pix_picture = None;
}
+
+ XSync(output->dpy, False);
+ if (_x_error_occurred) {
+ XFreePixmap(output->dpy, output->pixmap);
+ output->pixmap = None;
+ output->use_shm_pixmap = 0;
+ }
}
if (output->use_render) {
DBG(("%s-%s: creating picture\n", DisplayString(output->dpy), output->name));