Blame SOURCES/tigervnc-xserver117.patch

288618
diff -up xorg-server-1.17.1/configure.ac.xserver116-rebased xorg-server-1.17.1/configure.ac
288618
--- xorg-server-1.17.1/configure.ac.xserver116-rebased	2015-02-10 22:43:52.000000000 +0000
288618
+++ xorg-server-1.17.1/configure.ac	2015-02-13 16:14:05.074515927 +0000
288618
@@ -74,6 +74,7 @@ dnl forcing an entire recompile.x
288618
 AC_CONFIG_HEADERS(include/version-config.h)
288618
 
288618
 AM_PROG_AS
288618
+AC_PROG_CXX
288618
 AC_PROG_LN_S
288618
 LT_PREREQ([2.2])
288618
 LT_INIT([disable-static win32-dll])
288618
@@ -1795,6 +1796,10 @@ if test "x$XVFB" = xyes; then
288618
 	AC_SUBST([XVFB_SYS_LIBS])
288618
 fi
288618
 
288618
+dnl Xvnc DDX
288618
+AC_SUBST([XVNC_CPPFLAGS], ["-DHAVE_DIX_CONFIG_H $XSERVER_CFLAGS"])
288618
+AC_SUBST([XVNC_LIBS], ["$FB_LIB $FIXES_LIB $XEXT_LIB $CONFIG_LIB $DBE_LIB $RECORD_LIB $GLX_LIBS $RANDR_LIB $RENDER_LIB $DAMAGE_LIB $DRI3_LIB $PRESENT_LIB $MIEXT_SYNC_LIB $MIEXT_DAMAGE_LIB $MIEXT_SHADOW_LIB $XI_LIB $XKB_LIB $XKB_STUB_LIB $COMPOSITE_LIB $MAIN_LIB"])
288618
+AC_SUBST([XVNC_SYS_LIBS], ["$GLX_SYS_LIBS"])
288618
 
288618
 dnl Xnest DDX
288618
 
288618
@@ -1830,6 +1835,8 @@ if test "x$XORG" = xauto; then
288618
 fi
288618
 AC_MSG_RESULT([$XORG])
288618
 
288618
+AC_DEFINE_UNQUOTED(XORG_VERSION_CURRENT, [$VENDOR_RELEASE], [Current Xorg version])
288618
+
288618
 if test "x$XORG" = xyes; then
288618
 	XORG_DDXINCS='-I$(top_srcdir)/hw/xfree86 -I$(top_srcdir)/hw/xfree86/include -I$(top_srcdir)/hw/xfree86/common'
288618
 	XORG_OSINCS='-I$(top_srcdir)/hw/xfree86/os-support -I$(top_srcdir)/hw/xfree86/os-support/bus -I$(top_srcdir)/os'
288618
@@ -2059,7 +2066,6 @@ if test "x$XORG" = xyes; then
288618
 	AC_DEFINE(XORG_SERVER, 1, [Building Xorg server])
288618
 	AC_DEFINE(XORGSERVER, 1, [Building Xorg server])
288618
 	AC_DEFINE(XFree86Server, 1, [Building XFree86 server])
288618
-	AC_DEFINE_UNQUOTED(XORG_VERSION_CURRENT, [$VENDOR_RELEASE], [Current Xorg version])
288618
 	AC_DEFINE(NEED_XF86_TYPES, 1, [Need XFree86 typedefs])
288618
 	AC_DEFINE(NEED_XF86_PROTOTYPES, 1, [Need XFree86 helper functions])
288618
 	AC_DEFINE(__XSERVERNAME__, "Xorg", [Name of X server])
288618
@@ -2599,6 +2605,7 @@ hw/dmx/Makefile
288618
 hw/dmx/man/Makefile
288618
 hw/vfb/Makefile
288618
 hw/vfb/man/Makefile
288618
+hw/vnc/Makefile
288618
 hw/xnest/Makefile
288618
 hw/xnest/man/Makefile
288618
 hw/xwin/Makefile
288618
diff -up xorg-server-1.17.1/hw/Makefile.am.xserver116-rebased xorg-server-1.17.1/hw/Makefile.am
288618
--- xorg-server-1.17.1/hw/Makefile.am.xserver116-rebased	2014-04-16 21:24:00.000000000 +0100
288618
+++ xorg-server-1.17.1/hw/Makefile.am	2015-02-13 16:14:05.131516821 +0000
288618
@@ -38,7 +38,8 @@ SUBDIRS =			\
288618
 	$(DMX_SUBDIRS)		\
288618
 	$(KDRIVE_SUBDIRS)	\
288618
 	$(XQUARTZ_SUBDIRS)	\
288618
-	$(XWAYLAND_SUBDIRS)
288618
+	$(XWAYLAND_SUBDIRS)	\
288618
+	vnc
288618
 
288618
 DIST_SUBDIRS = dmx xfree86 vfb xnest xwin xquartz kdrive xwayland
288618
 
288618
diff -up xorg-server-1.17.1/mi/miinitext.c.xserver116-rebased xorg-server-1.17.1/mi/miinitext.c
288618
--- xorg-server-1.17.1/mi/miinitext.c.xserver116-rebased	2015-01-17 23:42:52.000000000 +0000
288618
+++ xorg-server-1.17.1/mi/miinitext.c	2015-02-13 16:14:05.131516821 +0000
288618
@@ -111,6 +111,10 @@ SOFTWARE.
288618
 #include "micmap.h"
288618
 #include "globals.h"
288618
 
288618
+#ifdef TIGERVNC
288618
+extern void vncExtensionInit(INITARGS);
288618
+#endif
288618
+
288618
 /* The following is only a small first step towards run-time
288618
  * configurable extensions.
288618
  */
288618
@@ -235,6 +239,9 @@ EnableDisableExtensionError(const char *
288618
 
288618
 /* List of built-in (statically linked) extensions */
288618
 static const ExtensionModule staticExtensions[] = {
288618
+#ifdef TIGERVNC
288618
+    {vncExtensionInit, "VNC-EXTENSION", NULL},
288618
+#endif
288618
     {GEExtensionInit, "Generic Event Extension", &noGEExtension},
288618
     {ShapeExtensionInit, "SHAPE", NULL},
288618
 #ifdef MITSHM
288618
diff -up xorg-server-1.17.1/os/WaitFor.c.xserver116-rebased xorg-server-1.17.1/os/WaitFor.c
288618
--- xorg-server-1.17.1/os/WaitFor.c.xserver116-rebased	2015-01-26 18:40:30.000000000 +0000
288618
+++ xorg-server-1.17.1/os/WaitFor.c	2015-02-13 16:14:05.132516837 +0000
288618
@@ -125,6 +125,9 @@ static void DoTimer(OsTimerPtr timer, CA
288618
 static void CheckAllTimers(void);
288618
 static volatile OsTimerPtr timers = NULL;
288618
 
288618
+extern void vncWriteBlockHandler(fd_set *fds);
288618
+extern void vncWriteWakeupHandler(int nfds, fd_set *fds);
288618
+
288618
 /*****************
288618
  * WaitForSomething:
288618
  *     Make the server suspend until there is
288618
@@ -150,6 +153,7 @@ WaitForSomething(int *pClientsReady)
288618
     INT32 timeout = 0;
288618
     fd_set clientsReadable;
288618
     fd_set clientsWritable;
288618
+    fd_set socketsWritable;
288618
     int curclient;
288618
     int selecterr;
288618
     static int nready;
288618
@@ -212,6 +216,9 @@ WaitForSomething(int *pClientsReady)
288618
             XFD_COPYSET(&AllSockets, &LastSelectMask);
288618
         }
288618
 
288618
+        FD_ZERO(&socketsWritable);
288618
+        vncWriteBlockHandler(&socketsWritable);
288618
+
288618
         BlockHandler((void *) &wt, (void *) &LastSelectMask);
288618
         if (NewOutputPending)
288618
             FlushAllOutput();
288618
@@ -223,10 +230,20 @@ WaitForSomething(int *pClientsReady)
288618
             i = Select(MaxClients, &LastSelectMask, &clientsWritable, NULL, wt);
288618
         }
288618
         else {
288618
-            i = Select(MaxClients, &LastSelectMask, NULL, NULL, wt);
288618
+	    if (AnyClientsWriteBlocked)
288618
+		XFD_ORSET(&socketsWritable, &ClientsWriteBlocked, &socketsWritable);
288618
+
288618
+	    if (XFD_ANYSET(&socketsWritable)) {
288618
+		i = Select(MaxClients, &LastSelectMask, &socketsWritable, NULL, wt);
288618
+		if (AnyClientsWriteBlocked)
288618
+		    XFD_ANDSET(&clientsWritable, &socketsWritable, &ClientsWriteBlocked);
288618
+	    } else {
288618
+		i = Select(MaxClients, &LastSelectMask, NULL, NULL, wt);
288618
+	    }
288618
         }
288618
         selecterr = GetErrno();
288618
         WakeupHandler(i, (void *) &LastSelectMask);
288618
+	vncWriteWakeupHandler(i, &socketsWritable);
288618
         if (i <= 0) {           /* An error or timeout occurred */
288618
             if (dispatchException)
288618
                 return 0;