blob: 1c03317f240f6f583072e7dc21c6694c784cd468 [file] [log] [blame]
Dominik Muth292c4f52016-04-11 22:52:26 +02001diff -ur xorg-server.orig/configure.ac xorg-server/configure.ac
2--- xorg-server.orig/configure.ac 2016-04-09 21:28:27.007999965 +0200
3+++ xorg-server/configure.ac 2016-04-09 21:28:57.587999860 +0200
4@@ -74,6 +74,7 @@
5 AC_CONFIG_HEADERS(include/version-config.h)
6
7 AM_PROG_AS
8+AC_PROG_CXX
9 AC_PROG_LN_S
10 LT_PREREQ([2.2])
11 LT_INIT([disable-static win32-dll])
12@@ -1828,6 +1829,10 @@
13 AC_SUBST([XVFB_SYS_LIBS])
14 fi
15
16+dnl Xvnc DDX
17+AC_SUBST([XVNC_CPPFLAGS], ["-DHAVE_DIX_CONFIG_H $XSERVER_CFLAGS"])
18+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"])
19+AC_SUBST([XVNC_SYS_LIBS], ["$GLX_SYS_LIBS"])
20
21 dnl Xnest DDX
22
23@@ -1863,6 +1868,8 @@
24 fi
25 AC_MSG_RESULT([$XORG])
26
27+AC_DEFINE_UNQUOTED(XORG_VERSION_CURRENT, [$VENDOR_RELEASE], [Current Xorg version])
28+
29 if test "x$XORG" = xyes; then
30 XORG_DDXINCS='-I$(top_srcdir)/hw/xfree86 -I$(top_srcdir)/hw/xfree86/include -I$(top_srcdir)/hw/xfree86/common'
31 XORG_OSINCS='-I$(top_srcdir)/hw/xfree86/os-support -I$(top_srcdir)/hw/xfree86/os-support/bus -I$(top_srcdir)/os'
32@@ -2081,7 +2088,6 @@
33 AC_DEFINE(XORG_SERVER, 1, [Building Xorg server])
34 AC_DEFINE(XORGSERVER, 1, [Building Xorg server])
35 AC_DEFINE(XFree86Server, 1, [Building XFree86 server])
36- AC_DEFINE_UNQUOTED(XORG_VERSION_CURRENT, [$VENDOR_RELEASE], [Current Xorg version])
37 AC_DEFINE(NEED_XF86_TYPES, 1, [Need XFree86 typedefs])
38 AC_DEFINE(NEED_XF86_PROTOTYPES, 1, [Need XFree86 helper functions])
39 AC_DEFINE(__XSERVERNAME__, "Xorg", [Name of X server])
40@@ -2653,6 +2659,7 @@
41 hw/dmx/man/Makefile
42 hw/vfb/Makefile
43 hw/vfb/man/Makefile
44+hw/vnc/Makefile
45 hw/xnest/Makefile
46 hw/xnest/man/Makefile
47 hw/xwin/Makefile
48diff -ur xorg-server.orig/hw/Makefile.am xorg-server/hw/Makefile.am
49--- xorg-server.orig/hw/Makefile.am 2016-04-09 21:28:27.059999965 +0200
50+++ xorg-server/hw/Makefile.am 2016-04-09 21:28:57.587999860 +0200
Brian P. Hinzd2a0fab2016-05-07 15:33:01 -040051@@ -43,6 +43,7 @@
Dominik Muth292c4f52016-04-11 22:52:26 +020052 $(KDRIVE_SUBDIRS) \
53 $(XQUARTZ_SUBDIRS) \
Brian P. Hinzd2a0fab2016-05-07 15:33:01 -040054- $(XWAYLAND_SUBDIRS)
55+ $(XWAYLAND_SUBDIRS) \
Dominik Muth292c4f52016-04-11 22:52:26 +020056+ vnc
57
Brian P. Hinzd2a0fab2016-05-07 15:33:01 -040058 DIST_SUBDIRS = dmx xfree86 vfb xnest xwin xquartz kdrive xwayland
Dominik Muth292c4f52016-04-11 22:52:26 +020059
60diff -ur xorg-server.orig/mi/miinitext.c xorg-server/mi/miinitext.c
61--- xorg-server.orig/mi/miinitext.c 2016-04-09 21:28:27.015999965 +0200
62+++ xorg-server/mi/miinitext.c 2016-04-09 21:28:57.587999860 +0200
63@@ -114,6 +114,10 @@
64 #include "micmap.h"
65 #include "globals.h"
66
67+#ifdef TIGERVNC
Pierre Ossmand959e7a2016-09-22 16:22:52 +020068+extern void vncExtensionInit(void);
Dominik Muth292c4f52016-04-11 22:52:26 +020069+#endif
70+
71 /* The following is only a small first step towards run-time
72 * configurable extensions.
73 */
74@@ -238,6 +242,9 @@
75
76 /* List of built-in (statically linked) extensions */
77 static const ExtensionModule staticExtensions[] = {
78+#ifdef TIGERVNC
79+ {vncExtensionInit, "VNC-EXTENSION", NULL},
80+#endif
81 {GEExtensionInit, "Generic Event Extension", &noGEExtension},
82 {ShapeExtensionInit, "SHAPE", NULL},
83 #ifdef MITSHM
84diff -ur xorg-server.orig/os/WaitFor.c xorg-server/os/WaitFor.c
85--- xorg-server.orig/os/WaitFor.c 2016-04-09 21:28:27.071999965 +0200
86+++ xorg-server/os/WaitFor.c 2016-04-09 21:28:57.587999860 +0200
87@@ -125,6 +125,9 @@
88 static void CheckAllTimers(void);
89 static volatile OsTimerPtr timers = NULL;
90
91+extern void vncWriteBlockHandler(fd_set *fds);
92+extern void vncWriteWakeupHandler(int nfds, fd_set *fds);
93+
94 /*****************
95 * WaitForSomething:
96 * Make the server suspend until there is
97@@ -150,6 +153,7 @@
98 INT32 timeout = 0;
99 fd_set clientsReadable;
100 fd_set clientsWritable;
101+ fd_set socketsWritable;
102 int curclient;
103 int selecterr;
104 static int nready;
105@@ -213,6 +217,9 @@
106 XFD_COPYSET(&AllSockets, &LastSelectMask);
107 }
108
109+ FD_ZERO(&socketsWritable);
110+ vncWriteBlockHandler(&socketsWritable);
111+
112 BlockHandler((void *) &wt, (void *) &LastSelectMask);
113 if (NewOutputPending)
114 FlushAllOutput();
115@@ -224,10 +231,20 @@
116 i = Select(MaxClients, &LastSelectMask, &clientsWritable, NULL, wt);
117 }
118 else {
119- i = Select(MaxClients, &LastSelectMask, NULL, NULL, wt);
120+ if (AnyClientsWriteBlocked)
121+ XFD_ORSET(&socketsWritable, &ClientsWriteBlocked, &socketsWritable);
122+
123+ if (XFD_ANYSET(&socketsWritable)) {
124+ i = Select(MaxClients, &LastSelectMask, &socketsWritable, NULL, wt);
125+ if (AnyClientsWriteBlocked)
126+ XFD_ANDSET(&clientsWritable, &socketsWritable, &ClientsWriteBlocked);
127+ } else {
128+ i = Select(MaxClients, &LastSelectMask, NULL, NULL, wt);
129+ }
130 }
131 selecterr = GetErrno();
132 WakeupHandler(i, (void *) &LastSelectMask);
133+ vncWriteWakeupHandler(i, &socketsWritable);
134 if (i <= 0) { /* An error or timeout occurred */
135 if (dispatchException)
136 return 0;