File R-cairo-fix.patch of Package R-base.1556

Index: R-2.15.2/src/modules/X11/devX11.c
===================================================================
--- R-2.15.2.orig/src/modules/X11/devX11.c
+++ R-2.15.2/src/modules/X11/devX11.c
@@ -244,6 +244,7 @@ static void Cairo_update(pX11Desc xd)
 {
     if(inclose || !xd || !xd->buffered || xd->holdlevel > 0) return;
     cairo_paint(xd->xcc);
+    cairo_surface_flush(xd->xcs);
     if (xd->type == WINDOW) XDefineCursor(display, xd->window, arrow_cursor);
     XSync(display, 0);
     xd->last = currentTime();
@@ -747,8 +748,10 @@ static void handleEvent(XEvent event)
 #ifdef HAVE_WORKING_CAIRO
 	    pX11Desc xd = (pX11Desc) dd->deviceSpecific;
 	    /* We can use the buffered copy where we have it */ 
-	    if(xd->buffered == 1) cairo_paint(xd->xcc);
-	    else if (xd->buffered > 1)
+	    if(xd->buffered == 1) {
+		cairo_paint(xd->xcc);
+		cairo_surface_flush(xd->xcs);
+	    } else if (xd->buffered > 1)
 		/* rely on timer to repaint eventually */
 		xd->last_activity = currentTime();
 	    else
@@ -2679,7 +2682,11 @@ static void X11_Mode(int mode, pDevDesc
 		Cairo_update(xd);
 	    return;
 	}
-	if(xd->buffered) cairo_paint(xd->xcc);
+	if(xd->buffered) {
+	    cairo_paint(xd->xcc);
+	    cairo_surface_flush(xd->xcs);
+	}
+	
 #endif
 	if(xd->type==WINDOW) XDefineCursor(display, xd->window, arrow_cursor);
 	XSync(display, 0);
openSUSE Build Service is sponsored by