blob: 82b02c13fc6760117e309256bdee3bd6c272950e [file] [log] [blame]
Tim Waughd822c362014-09-03 12:38:15 +01001diff -up xserver/configure.ac.vnc xserver/configure.ac
2--- xserver/configure.ac.vnc 2013-04-09 16:35:38.000000000 +0200
3+++ xserver/configure.ac 2013-04-09 18:16:31.000000000 +0200
4@@ -72,6 +72,7 @@ dnl forcing an entire recompile.x
5 AC_CONFIG_HEADERS(include/version-config.h)
6
7 AM_PROG_AS
8+AC_PROG_CXX
9 AC_PROG_LN_S
10 AC_LIBTOOL_WIN32_DLL
11 AC_DISABLE_STATIC
12@@ -1028,7 +1029,6 @@ fi
13 if test "x$WAYLAND" = xyes; then
14 PKG_CHECK_MODULES(XWAYLAND, $WAYLAND_MODULES)
15 AC_DEFINE(XORG_WAYLAND, 1, [Support wayland mode])
16- WAYLAND_SCANNER_RULES(['$(top_srcdir)/hw/xfree86/xwayland'])
17 fi
18 AM_CONDITIONAL(WAYLAND, [test "x$WAYLAND" = xyes])
19
20@@ -1573,6 +1573,10 @@ if test "x$XVFB" = xyes; then
21 AC_SUBST([XVFB_SYS_LIBS])
22 fi
23
24+dnl Xvnc DDX
25+AC_SUBST([XVNC_CPPFLAGS], ["-DHAVE_DIX_CONFIG_H $XSERVER_CFLAGS"])
26+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"])
27+AC_SUBST([XVNC_SYS_LIBS], ["$GLX_SYS_LIBS"])
28
29 dnl Xnest DDX
30
31@@ -1608,6 +1612,8 @@ if test "x$XORG" = xauto; then
32 fi
33 AC_MSG_RESULT([$XORG])
34
35+AC_DEFINE_UNQUOTED(XORG_VERSION_CURRENT, [$VENDOR_RELEASE], [Current Xorg version])
36+
37 if test "x$XORG" = xyes; then
38 XORG_DDXINCS='-I$(top_srcdir)/hw/xfree86 -I$(top_srcdir)/hw/xfree86/include -I$(top_srcdir)/hw/xfree86/common'
39 XORG_OSINCS='-I$(top_srcdir)/hw/xfree86/os-support -I$(top_srcdir)/hw/xfree86/os-support/bus -I$(top_srcdir)/os'
40@@ -1827,7 +1833,6 @@ if test "x$XORG" = xyes; then
41 AC_DEFINE(XORG_SERVER, 1, [Building Xorg server])
42 AC_DEFINE(XORGSERVER, 1, [Building Xorg server])
43 AC_DEFINE(XFree86Server, 1, [Building XFree86 server])
44- AC_DEFINE_UNQUOTED(XORG_VERSION_CURRENT, [$VENDOR_RELEASE], [Current Xorg version])
45 AC_DEFINE(NEED_XF86_TYPES, 1, [Need XFree86 typedefs])
46 AC_DEFINE(NEED_XF86_PROTOTYPES, 1, [Need XFree86 helper functions])
47 AC_DEFINE(__XSERVERNAME__, "Xorg", [Name of X server])
48@@ -2292,6 +2297,7 @@ hw/dmx/Makefile
49 hw/dmx/man/Makefile
50 hw/vfb/Makefile
51 hw/vfb/man/Makefile
52+hw/vnc/Makefile
53 hw/xnest/Makefile
54 hw/xnest/man/Makefile
55 hw/xwin/Makefile
56diff -up xserver/hw/Makefile.am.vnc xserver/hw/Makefile.am
57--- xserver/hw/Makefile.am.vnc 2013-04-09 16:36:46.000000000 +0200
58+++ xserver/hw/Makefile.am 2013-04-09 18:16:31.000000000 +0200
59@@ -33,7 +33,8 @@ SUBDIRS = \
60 $(XNEST_SUBDIRS) \
61 $(DMX_SUBDIRS) \
62 $(KDRIVE_SUBDIRS) \
63- $(XQUARTZ_SUBDIRS)
64+ $(XQUARTZ_SUBDIRS) \
65+ vnc
66
67 DIST_SUBDIRS = dmx xfree86 vfb xnest xwin xquartz kdrive
68
69diff -up xserver/mi/miinitext.c.vnc xserver/mi/miinitext.c
70--- xserver/mi/miinitext.c.vnc 2013-04-09 16:37:21.000000000 +0200
71+++ xserver/mi/miinitext.c 2013-04-09 18:16:31.000000000 +0200
72@@ -112,6 +112,10 @@ SOFTWARE.
73 #include "micmap.h"
74 #include "globals.h"
75
76+#ifdef TIGERVNC
77+extern void vncExtensionInit(INITARGS);
78+#endif
79+
80 /* The following is only a small first step towards run-time
81 * configurable extensions.
82 */
83@@ -238,6 +242,9 @@ EnableDisableExtensionError(const char *
84
85 /* List of built-in (statically linked) extensions */
86 static ExtensionModule staticExtensions[] = {
87+#ifdef TIGERVNC
88+ {vncExtensionInit, "VNC-EXTENSION", NULL},
89+#endif
90 {GEExtensionInit, "Generic Event Extension", &noGEExtension},
91 {ShapeExtensionInit, "SHAPE", NULL},
92 #ifdef MITSHM
93diff -up xserver/os/WaitFor.c.vnc xserver/os/WaitFor.c
94--- xserver/os/WaitFor.c.vnc 2013-04-10 14:51:13.000000000 +0200
95+++ xserver/os/WaitFor.c 2013-04-10 14:55:40.000000000 +0200
96@@ -124,6 +124,9 @@ static void DoTimer(OsTimerPtr timer, CA
97 static void CheckAllTimers(void);
98 static OsTimerPtr timers = NULL;
99
100+extern void vncWriteBlockHandler(fd_set *fds);
101+extern void vncWriteWakeupHandler(int nfds, fd_set *fds);
102+
103 /*****************
104 * WaitForSomething:
105 * Make the server suspend until there is
106@@ -149,6 +152,7 @@ WaitForSomething(int *pClientsReady)
107 INT32 timeout = 0;
108 fd_set clientsReadable;
109 fd_set clientsWritable;
110+ fd_set socketsWritable;
111 int curclient;
112 int selecterr;
113 static int nready;
114@@ -207,6 +211,9 @@ WaitForSomething(int *pClientsReady)
115 XFD_COPYSET(&AllSockets, &LastSelectMask);
116 }
117
118+ FD_ZERO(&socketsWritable);
119+ vncWriteBlockHandler(&socketsWritable);
120+
121 BlockHandler((pointer) &wt, (pointer) &LastSelectMask);
122 if (NewOutputPending)
123 FlushAllOutput();
124@@ -218,10 +225,20 @@ WaitForSomething(int *pClientsReady)
125 i = Select(MaxClients, &LastSelectMask, &clientsWritable, NULL, wt);
126 }
127 else {
128- i = Select(MaxClients, &LastSelectMask, NULL, NULL, wt);
129+ if (AnyClientsWriteBlocked)
130+ XFD_ORSET(&socketsWritable, &ClientsWriteBlocked, &socketsWritable);
131+
132+ if (XFD_ANYSET(&socketsWritable)) {
133+ i = Select (MaxClients, &LastSelectMask, &socketsWritable, NULL, wt);
134+ if (AnyClientsWriteBlocked)
135+ XFD_ANDSET(&clientsWritable, &socketsWritable, &ClientsWriteBlocked);
136+ } else {
137+ i = Select (MaxClients, &LastSelectMask, NULL, NULL, wt);
138+ }
139 }
140 selecterr = GetErrno();
141 WakeupHandler(i, (pointer) &LastSelectMask);
142+ vncWriteWakeupHandler(i, &socketsWritable);
143 if (i <= 0) { /* An error or timeout occurred */
144 if (dispatchException)
145 return 0;