File vino-xgl.patch of Package vino
Index: server/vino-fb.c
===================================================================
RCS file: /cvs/gnome/vino/server/vino-fb.c,v
retrieving revision 1.10
diff -u -r1.10 vino-fb.c
--- server/vino-fb.c 25 Jul 2005 09:50:22 -0000 1.10
+++ server/vino-fb.c 11 May 2006 19:09:29 -0000
@@ -582,16 +582,33 @@
gdk_error_trap_push ();
/* Copy the damaged pixels from the server */
- XCopyArea (vfb->priv->xdisplay,
- GDK_WINDOW_XWINDOW (vfb->priv->root_window),
- vfb->priv->fb_pixmap,
- vfb->priv->xdamage_copy_gc,
- damage->x,
- damage->y,
- damage->width,
- damage->height,
- damage->x,
- damage->y);
+ if (vfb->priv->use_x_shm)
+ {
+ XCopyArea (vfb->priv->xdisplay,
+ GDK_WINDOW_XWINDOW (vfb->priv->root_window),
+ vfb->priv->fb_pixmap,
+ vfb->priv->xdamage_copy_gc,
+ damage->x,
+ damage->y,
+ damage->width,
+ damage->height,
+ damage->x,
+ damage->y);
+ }
+ else
+ {
+ XGetSubImage (vfb->priv->xdisplay,
+ GDK_WINDOW_XWINDOW (vfb->priv->root_window),
+ damage->x,
+ damage->y,
+ damage->width,
+ damage->height,
+ AllPlanes,
+ ZPixmap,
+ vfb->priv->fb_image,
+ damage->x,
+ damage->y);
+ }
XSync (vfb->priv->xdisplay, False);
if ((error = gdk_error_trap_pop ()))
@@ -793,13 +810,16 @@
if (vfb->priv->fb_image)
{
#ifdef HAVE_XSHM
- vfb->priv->fb_pixmap = XShmCreatePixmap (vfb->priv->xdisplay,
- GDK_WINDOW_XWINDOW (vfb->priv->root_window),
- vfb->priv->fb_image->data,
- &vfb->priv->fb_image_x_shm_info,
- vfb->priv->fb_image->width,
- vfb->priv->fb_image->height,
- vfb->priv->fb_image->depth);
+ if (vfb->priv->use_x_shm)
+ {
+ vfb->priv->fb_pixmap = XShmCreatePixmap (vfb->priv->xdisplay,
+ GDK_WINDOW_XWINDOW (vfb->priv->root_window),
+ vfb->priv->fb_image->data,
+ &vfb->priv->fb_image_x_shm_info,
+ vfb->priv->fb_image->width,
+ vfb->priv->fb_image->height,
+ vfb->priv->fb_image->depth);
+ }
#endif
if (vfb->priv->fb_pixmap == None)
{
@@ -838,6 +858,15 @@
#ifdef HAVE_XSHM
vfb->priv->use_x_shm = XShmQueryExtension (vfb->priv->xdisplay) != False;
+ if (vfb->priv->use_x_shm)
+ {
+ int major, minor;
+ Bool shared_pixmaps;
+
+ XShmQueryVersion (vfb->priv->xdisplay, &major, &minor, &shared_pixmaps);
+ if (!shared_pixmaps)
+ vfb->priv->use_x_shm = FALSE;
+ }
#endif
g_signal_connect_swapped (vfb->priv->screen, "size-changed",