Xvnc with RENDER - almost working

Peter Åstrand astrand "at" cendio.se
Wed Feb 23 12:11:01 2005


I'm attaching two patches that adds RENDER support to Xvnc in Fedora 3. It 
works, except that I've found a small glitch when using the menus in 
OpenOffice: Sometimes, some of the menu choices disappears. See 
screenshot at http://www.cendio.se/~peter/vnc-render-oo.png.

I've verified this problem both with Fedoras VNC package (with my attached 
patches), and with the TightVNC 1.5 series (using xorg 6.8.2).

A screenshot in the VNC session displays the menus correctly. Also, 
doing a "Refresh screen" in the VNC client fixes the problem.

Any ideas?

-- 
Peter Estrand		Chief Developer
Cendio			www.thinlinc.com
Teknikringen 3		www.cendio.se
583 30 Linkvping        Phone: +46-13-21 46 00
--- programs/Xserver/vnc/Xvnc/xvnc.cc.orig	2005-02-23 11:43:12.375579586 +0100
+++ programs/Xserver/vnc/Xvnc/xvnc.cc	2005-02-23 11:46:21.276332115 +0100
@@ -151,6 +151,7 @@
 static Bool vfbPixmapDepths[33];
 static char needswap = 0;
 static int lastScreen = -1;
+static Bool Render = TRUE;
 
 static bool displaySpecified = false;
 static bool wellKnownSocketsCreated = false;
@@ -235,6 +236,10 @@
            VENDOR_STRING);
     ErrorF("-screen scrn WxHxD     set screen's width, height, depth\n");
     ErrorF("-pixdepths list-of-int support given pixmap depths\n");
+#ifdef RENDER
+    ErrorF("+/-render		   turn on/off RENDER extension support"
+	   "(default on)\n");
+#endif
     ErrorF("-linebias n            adjust thin line pixelization\n");
     ErrorF("-blackpixel n          pixel value for black\n");
     ErrorF("-whitepixel n          pixel value for white\n");
@@ -331,6 +336,18 @@
     return ret;
   }
 
+  if (strcmp (argv[i], "+render") == 0)	/* +render */
+  {
+    Render = TRUE;
+    return 1;
+  }
+  
+  if (strcmp (argv[i], "-render") == 0)	/* -render */
+  {
+    Render = FALSE;
+    return 1;
+  }
+
   if (strcmp (argv[i], "-blackpixel") == 0)	/* -blackpixel n */
   {
     Pixel pix;
@@ -831,6 +848,12 @@
   if (!fbScreenInit(pScreen, pbits, pvfb->width, pvfb->height,
                     dpi, dpi, pvfb->paddedWidth, pvfb->bitsPerPixel))
       return FALSE;
+
+#ifdef RENDER
+  if (ret && Render) 
+      fbPictureInit(pScreen, 0, 0); 
+#endif
+
 #else
   switch (pvfb->bitsPerPixel)
   {
@@ -946,6 +969,17 @@
     vfbPixmapDepths[vfbScreens[i].depth] = TRUE;
   }
 
+  /* RENDER needs a good set of pixmaps. */
+  if (Render) {
+      vfbPixmapDepths[1] = TRUE;
+      vfbPixmapDepths[4] = TRUE;
+      vfbPixmapDepths[8] = TRUE;
+/*    vfbPixmapDepths[15] = TRUE; */
+      vfbPixmapDepths[16] = TRUE;
+      vfbPixmapDepths[24] = TRUE;
+      vfbPixmapDepths[32] = TRUE;
+  }
+
   for (i = 1; i <= 32; i++)
   {
     if (vfbPixmapDepths[i])
--- vnc.spec~	2004-10-06 14:00:29.000000000 +0200
+++ vnc.spec	2005-02-23 11:49:28.000000000 +0100
@@ -25,6 +25,7 @@
 Patch10:   vnc-def.patch
 Patch11:   vnc-xorg.patch
 Patch12:   vnc-sparc.patch
+Patch13:   render.patch
 License:   GPL
 Group:     User Interface/Desktops
 BuildRoot: %{_tmppath}/%{name}-%{version}-root
@@ -68,6 +69,9 @@
 %patch10 -p1 -b .def
 %patch11 -p1 -b .xorg
 %patch12 -p1 -b .sparc
+cd xc
+%patch13 -p0 -b .render
+cd ..
 
 # Apply the patch from the VNC tarball.
 filterdiff -x'*/cfbglblt8.c' xc.patch | patch -p0