Pierre Ossman | 2a87ddc | 2013-04-10 13:07:01 +0000 | [diff] [blame] | 1 | diff -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 |
Adam Tkac | a0f89fb | 2013-01-24 12:13:35 +0000 | [diff] [blame] | 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 | @@ -1573,6 +1574,10 @@ if test "x$XVFB" = xyes; then |
| 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 $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 | @@ -1608,6 +1613,8 @@ if test "x$XORG" = xauto; then |
| 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' |
Pierre Ossman | 2a87ddc | 2013-04-10 13:07:01 +0000 | [diff] [blame] | 32 | @@ -1827,7 +1834,6 @@ if test "x$XORG" = xyes; then |
Adam Tkac | a0f89fb | 2013-01-24 12:13:35 +0000 | [diff] [blame] | 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]) |
Pierre Ossman | 2a87ddc | 2013-04-10 13:07:01 +0000 | [diff] [blame] | 40 | @@ -2292,6 +2298,7 @@ hw/dmx/Makefile |
Adam Tkac | a0f89fb | 2013-01-24 12:13:35 +0000 | [diff] [blame] | 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 |
Pierre Ossman | 2a87ddc | 2013-04-10 13:07:01 +0000 | [diff] [blame] | 48 | diff -up xserver/hw/Makefile.am.vnc xserver/hw/Makefile.am |
| 49 | --- xserver/hw/Makefile.am.vnc 2013-04-09 16:36:46.000000000 +0200 |
| 50 | +++ xserver/hw/Makefile.am 2013-04-09 18:16:31.000000000 +0200 |
Adam Tkac | a0f89fb | 2013-01-24 12:13:35 +0000 | [diff] [blame] | 51 | @@ -33,7 +33,8 @@ SUBDIRS = \ |
| 52 | $(XNEST_SUBDIRS) \ |
| 53 | $(DMX_SUBDIRS) \ |
| 54 | $(KDRIVE_SUBDIRS) \ |
| 55 | - $(XQUARTZ_SUBDIRS) |
| 56 | + $(XQUARTZ_SUBDIRS) \ |
| 57 | + vnc |
| 58 | |
| 59 | DIST_SUBDIRS = dmx xfree86 vfb xnest xwin xquartz kdrive |
| 60 | |
Pierre Ossman | 2a87ddc | 2013-04-10 13:07:01 +0000 | [diff] [blame] | 61 | diff -up xserver/mi/miinitext.c.vnc xserver/mi/miinitext.c |
| 62 | --- xserver/mi/miinitext.c.vnc 2013-04-09 16:37:21.000000000 +0200 |
| 63 | +++ xserver/mi/miinitext.c 2013-04-09 18:16:31.000000000 +0200 |
Adam Tkac | a0f89fb | 2013-01-24 12:13:35 +0000 | [diff] [blame] | 64 | @@ -112,6 +112,10 @@ SOFTWARE. |
| 65 | #include "micmap.h" |
| 66 | #include "globals.h" |
| 67 | |
| 68 | +#ifdef TIGERVNC |
| 69 | +extern void vncExtensionInit(INITARGS); |
| 70 | +#endif |
| 71 | + |
| 72 | /* The following is only a small first step towards run-time |
| 73 | * configurable extensions. |
| 74 | */ |
Pierre Ossman | 5cb75ac | 2013-05-08 11:22:04 +0000 | [diff] [blame^] | 75 | @@ -238,6 +242,9 @@ EnableDisableExtensionError(const char * |
| 76 | |
| 77 | /* List of built-in (statically linked) extensions */ |
| 78 | static ExtensionModule staticExtensions[] = { |
Adam Tkac | a0f89fb | 2013-01-24 12:13:35 +0000 | [diff] [blame] | 79 | +#ifdef TIGERVNC |
| 80 | + {vncExtensionInit, "VNC-EXTENSION", NULL}, |
| 81 | +#endif |
Pierre Ossman | 5cb75ac | 2013-05-08 11:22:04 +0000 | [diff] [blame^] | 82 | {GEExtensionInit, "Generic Event Extension", &noGEExtension}, |
| 83 | {ShapeExtensionInit, "SHAPE", NULL}, |
| 84 | #ifdef MITSHM |
Pierre Ossman | 2a87ddc | 2013-04-10 13:07:01 +0000 | [diff] [blame] | 85 | diff -up xserver/os/WaitFor.c.vnc xserver/os/WaitFor.c |
| 86 | --- xserver/os/WaitFor.c.vnc 2013-04-10 14:51:13.000000000 +0200 |
| 87 | +++ xserver/os/WaitFor.c 2013-04-10 14:55:40.000000000 +0200 |
| 88 | @@ -124,6 +124,9 @@ static void DoTimer(OsTimerPtr timer, CA |
| 89 | static void CheckAllTimers(void); |
| 90 | static OsTimerPtr timers = NULL; |
| 91 | |
| 92 | +extern void vncWriteBlockHandler(fd_set *fds); |
| 93 | +extern void vncWriteWakeupHandler(int nfds, fd_set *fds); |
| 94 | + |
| 95 | /***************** |
| 96 | * WaitForSomething: |
| 97 | * Make the server suspend until there is |
| 98 | @@ -149,6 +152,7 @@ WaitForSomething(int *pClientsReady) |
| 99 | INT32 timeout = 0; |
| 100 | fd_set clientsReadable; |
| 101 | fd_set clientsWritable; |
| 102 | + fd_set socketsWritable; |
| 103 | int curclient; |
| 104 | int selecterr; |
| 105 | static int nready; |
| 106 | @@ -207,6 +211,9 @@ WaitForSomething(int *pClientsReady) |
| 107 | XFD_COPYSET(&AllSockets, &LastSelectMask); |
| 108 | } |
| 109 | |
| 110 | + FD_ZERO(&socketsWritable); |
| 111 | + vncWriteBlockHandler(&socketsWritable); |
| 112 | + |
| 113 | BlockHandler((pointer) &wt, (pointer) &LastSelectMask); |
| 114 | if (NewOutputPending) |
| 115 | FlushAllOutput(); |
| 116 | @@ -218,10 +225,20 @@ WaitForSomething(int *pClientsReady) |
| 117 | i = Select(MaxClients, &LastSelectMask, &clientsWritable, NULL, wt); |
| 118 | } |
| 119 | else { |
| 120 | - i = Select(MaxClients, &LastSelectMask, NULL, NULL, wt); |
| 121 | + if (AnyClientsWriteBlocked) |
| 122 | + XFD_ORSET(&socketsWritable, &ClientsWriteBlocked, &socketsWritable); |
| 123 | + |
| 124 | + if (XFD_ANYSET(&socketsWritable)) { |
| 125 | + i = Select (MaxClients, &LastSelectMask, &socketsWritable, NULL, wt); |
| 126 | + if (AnyClientsWriteBlocked) |
| 127 | + XFD_ANDSET(&clientsWritable, &socketsWritable, &ClientsWriteBlocked); |
| 128 | + } else { |
| 129 | + i = Select (MaxClients, &LastSelectMask, NULL, NULL, wt); |
| 130 | + } |
| 131 | } |
| 132 | selecterr = GetErrno(); |
| 133 | WakeupHandler(i, (pointer) &LastSelectMask); |
| 134 | + vncWriteWakeupHandler(i, &socketsWritable); |
| 135 | if (i <= 0) { /* An error or timeout occurred */ |
| 136 | if (dispatchException) |
| 137 | return 0; |