diff --git a/EXA-mixed-ModifyPixmapHeader-pitch-fixes.-bug-33929.patch b/EXA-mixed-ModifyPixmapHeader-pitch-fixes.-bug-33929.patch deleted file mode 100644 index faadaf5..0000000 --- a/EXA-mixed-ModifyPixmapHeader-pitch-fixes.-bug-33929.patch +++ /dev/null @@ -1,57 +0,0 @@ -From 7b3b7efe78dec87c8059ea0d0985f08a97f0633d Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Michel=20D=C3=A4nzer?= -Date: Thu, 24 Feb 2011 12:17:57 +0100 -Subject: [PATCH] EXA/mixed: ModifyPixmapHeader pitch fixes. (bug #33929) -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -If there's a GPU copy and a non-zero devKind was passed in, set the GPU copy -pitch to that instead of to a possibly bogus value derived from the new width. -This is e.g. used by the radeon driver's drmmode_xf86crtc_resize hook, fixes -https://bugs.freedesktop.org/show_bug.cgi?id=33929 . - -On the other hand, the system memory copy doesn't need the pitch to be aligned -beyond the PixmapBytePad of the width. - -Signed-off-by: Michel Dänzer -Acked-by: Cyril Brulebois -Tested-by: Cyril Brulebois -Reported-by: Thierry Vignaud -Tested-by: Thierry Vignaud -Signed-off-by: Keith Packard -(cherry picked from commit 31704510f448706524b7b7085cc4ff0ada7bfe7e) ---- - exa/exa_mixed.c | 9 +++++---- - 1 files changed, 5 insertions(+), 4 deletions(-) - -diff --git a/exa/exa_mixed.c b/exa/exa_mixed.c -index 606f1e1..fd1afb2 100644 ---- a/exa/exa_mixed.c -+++ b/exa/exa_mixed.c -@@ -175,8 +175,10 @@ exaModifyPixmapHeader_mixed(PixmapPtr pPixmap, int width, int height, int depth, - depth != pPixmap->drawable.depth || - bitsPerPixel != pPixmap->drawable.bitsPerPixel) { - if (pExaPixmap->driverPriv) { -- exaSetFbPitch(pExaScr, pExaPixmap, -- width, height, bitsPerPixel); -+ if (devKind > 0) -+ pExaPixmap->fb_pitch = devKind; -+ else -+ exaSetFbPitch(pExaScr, pExaPixmap, width, height, bitsPerPixel); - - exaSetAccelBlock(pExaScr, pExaPixmap, - width, height, bitsPerPixel); -@@ -187,8 +189,7 @@ exaModifyPixmapHeader_mixed(PixmapPtr pPixmap, int width, int height, int depth, - if (has_gpu_copy && pExaPixmap->sys_ptr) { - free(pExaPixmap->sys_ptr); - pExaPixmap->sys_ptr = NULL; -- pExaPixmap->sys_pitch = devKind > 0 ? devKind : -- PixmapBytePad(width, depth); -+ pExaPixmap->sys_pitch = PixmapBytePad(width, depth); - DamageUnregister(&pPixmap->drawable, pExaPixmap->pDamage); - DamageDestroy(pExaPixmap->pDamage); - pExaPixmap->pDamage = NULL; --- -1.7.4.1 - diff --git a/xorg-server-xf4vnc.patch b/N-VNC-Add-support-for-VNC.patch similarity index 92% rename from xorg-server-xf4vnc.patch rename to N-VNC-Add-support-for-VNC.patch index 4a13680..9827d3b 100644 --- a/xorg-server-xf4vnc.patch +++ b/N-VNC-Add-support-for-VNC.patch @@ -1,6 +1,143 @@ ---- xorg-server-1.7.99/Makefile.am -+++ xorg-server-1.7.99/Makefile.am -@@ -17,6 +17,10 @@ +From: Egbert Eich +Date: Tue, 6 Sep 2011 16:53:08 +0200 +Subject: [PATCH] VNC: Add support for VNC. +Patch-Mainline: Currently no upstream project. +Git-commit: f3b09280968200b06c872a96c4b490d13e7c5338 +Signed-off: Egbert Eich + +This is based upon http://people.freedesktop.org/~dbn/xorg-server-xf4vnc.patch +but has been modified heavily to apply and compile with 10.3. + +Signed-off-by: Egbert Eich +--- + Makefile.am | 5 + + configure.ac | 54 + + hw/Makefile.am | 7 +- + hw/dmx/Makefile.am | 12 +- + hw/dmx/dmxinit.c | 7 + + hw/dmx/dmxsync.c | 7 + + hw/dmx/dmxvnc.h | 9 + + hw/dmx/input/dmxinputinit.c | 12 +- + hw/dmx/input/dmxinputinit.h | 5 + + hw/dmx/vnc/.gitignore | 36 + + hw/dmx/vnc/Makefile.am | 43 + + hw/dmx/vnc/vncInit.c | 441 ++++++++ + hw/dmx/vnc/vncint.h | 150 +++ + hw/vnc/LICENCE.TXT | 340 ++++++ + hw/vnc/Makefile.am | 55 + + hw/vnc/README | 14 + + hw/vnc/auth.c | 554 ++++++++++ + hw/vnc/cmap.c | 159 +++ + hw/vnc/corre.c | 343 ++++++ + hw/vnc/cursor.c | 398 +++++++ + hw/vnc/cutpaste.c | 86 ++ + hw/vnc/d3des.c | 428 ++++++++ + hw/vnc/d3des.h | 51 + + hw/vnc/dispcur.c | 784 ++++++++++++++ + hw/vnc/dpmsstubs.c | 52 + + hw/vnc/draw.c | 1942 ++++++++++++++++++++++++++++++++++ + hw/vnc/hextile.c | 341 ++++++ + hw/vnc/httpd.c | 519 +++++++++ + hw/vnc/init.c | 1054 +++++++++++++++++++ + hw/vnc/kbdptr.c | 616 +++++++++++ + hw/vnc/keyboard.h | 34 + + hw/vnc/loginauth.c | 142 +++ + hw/vnc/rdp.c | 145 +++ + hw/vnc/rfb.h | 747 +++++++++++++ + hw/vnc/rfbkeyb.c | 519 +++++++++ + hw/vnc/rfbmouse.c | 260 +++++ + hw/vnc/rfbproto.h | 1362 ++++++++++++++++++++++++ + hw/vnc/rfbserver.c | 2269 ++++++++++++++++++++++++++++++++++++++++ + hw/vnc/rre.c | 317 ++++++ + hw/vnc/sockets.c | 648 ++++++++++++ + hw/vnc/sprite.c | 2088 ++++++++++++++++++++++++++++++++++++ + hw/vnc/sprite.h | 131 +++ + hw/vnc/spritest.h | 134 +++ + hw/vnc/stats.c | 117 ++ + hw/vnc/symlink-vnc.sh | 198 ++++ + hw/vnc/tableinitcmtemplate.c | 95 ++ + hw/vnc/tableinittctemplate.c | 146 +++ + hw/vnc/tabletranstemplate.c | 135 +++ + hw/vnc/tight.c | 1774 +++++++++++++++++++++++++++++++ + hw/vnc/translate.c | 496 +++++++++ + hw/vnc/vncauth.c | 252 +++++ + hw/vnc/vncauth.h | 33 + + hw/vnc/vncext.c | 807 ++++++++++++++ + hw/vnc/xistubs.c | 312 ++++++ + hw/vnc/zlib.c | 308 ++++++ + hw/xfree86/Makefile.am | 5 + + hw/xfree86/dixmods/Makefile.am | 10 + + hw/xfree86/vnc/.gitignore | 36 + + hw/xfree86/vnc/Makefile.am | 51 + + hw/xfree86/vnc/README | 1 + + hw/xfree86/vnc/vncInit.c | 626 +++++++++++ + hw/xfree86/vnc/vncint.h | 148 +++ + mi/miinitext.c | 12 + + xcliplist/Makefile.am | 16 + + xcliplist/cliplist.c | 128 +++ + xcliplist/cliplistmod.c | 49 + + 66 files changed, 23072 insertions(+), 3 deletions(-) + create mode 100644 hw/dmx/dmxvnc.h + create mode 100644 hw/dmx/vnc/.gitignore + create mode 100644 hw/dmx/vnc/Makefile.am + create mode 100644 hw/dmx/vnc/vncInit.c + create mode 100644 hw/dmx/vnc/vncint.h + create mode 100644 hw/vnc/LICENCE.TXT + create mode 100644 hw/vnc/Makefile.am + create mode 100644 hw/vnc/README + create mode 100644 hw/vnc/auth.c + create mode 100644 hw/vnc/cmap.c + create mode 100644 hw/vnc/corre.c + create mode 100644 hw/vnc/cursor.c + create mode 100644 hw/vnc/cutpaste.c + create mode 100644 hw/vnc/d3des.c + create mode 100644 hw/vnc/d3des.h + create mode 100644 hw/vnc/dispcur.c + create mode 100644 hw/vnc/dpmsstubs.c + create mode 100644 hw/vnc/draw.c + create mode 100644 hw/vnc/hextile.c + create mode 100644 hw/vnc/httpd.c + create mode 100644 hw/vnc/init.c + create mode 100644 hw/vnc/kbdptr.c + create mode 100644 hw/vnc/keyboard.h + create mode 100644 hw/vnc/loginauth.c + create mode 100644 hw/vnc/rdp.c + create mode 100644 hw/vnc/rfb.h + create mode 100644 hw/vnc/rfbkeyb.c + create mode 100644 hw/vnc/rfbmouse.c + create mode 100644 hw/vnc/rfbproto.h + create mode 100644 hw/vnc/rfbserver.c + create mode 100644 hw/vnc/rre.c + create mode 100644 hw/vnc/sockets.c + create mode 100644 hw/vnc/sprite.c + create mode 100644 hw/vnc/sprite.h + create mode 100644 hw/vnc/spritest.h + create mode 100644 hw/vnc/stats.c + create mode 100644 hw/vnc/symlink-vnc.sh + create mode 100644 hw/vnc/tableinitcmtemplate.c + create mode 100644 hw/vnc/tableinittctemplate.c + create mode 100644 hw/vnc/tabletranstemplate.c + create mode 100644 hw/vnc/tight.c + create mode 100644 hw/vnc/translate.c + create mode 100644 hw/vnc/vncauth.c + create mode 100644 hw/vnc/vncauth.h + create mode 100644 hw/vnc/vncext.c + create mode 100644 hw/vnc/xistubs.c + create mode 100644 hw/vnc/zlib.c + create mode 100644 hw/xfree86/vnc/.gitignore + create mode 100644 hw/xfree86/vnc/Makefile.am + create mode 100644 hw/xfree86/vnc/README + create mode 100644 hw/xfree86/vnc/vncInit.c + create mode 100644 hw/xfree86/vnc/vncint.h + create mode 100644 xcliplist/Makefile.am + create mode 100644 xcliplist/cliplist.c + create mode 100644 xcliplist/cliplistmod.c + +diff --git a/Makefile.am b/Makefile.am +index 62c8d95..69b8d22 100644 +--- a/Makefile.am ++++ b/Makefile.am +@@ -17,6 +17,10 @@ if RECORD RECORD_DIR=record endif @@ -11,7 +148,7 @@ SUBDIRS = \ doc \ include \ -@@ -36,6 +40,7 @@ +@@ -36,6 +40,7 @@ SUBDIRS = \ damageext \ $(COMPOSITE_DIR) \ $(GLX_DIR) \ @@ -19,9 +156,11 @@ exa \ config \ hw \ ---- xorg-server-1.9.0/configure.ac.orig 2010-08-21 02:30:34.000000000 +0200 -+++ xorg-server-1.9.0/configure.ac 2010-08-23 14:11:04.000000000 +0200 -@@ -649,6 +649,8 @@ +diff --git a/configure.ac b/configure.ac +index 781a6b0..7e708c3 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -647,6 +647,8 @@ AC_ARG_ENABLE(libdrm, AS_HELP_STRING([--enable-libdrm], [Build Xorg with dnl DDXes. AC_ARG_ENABLE(xorg, AS_HELP_STRING([--enable-xorg], [Build Xorg server (default: auto)]), [XORG=$enableval], [XORG=auto]) @@ -30,7 +169,7 @@ AC_ARG_ENABLE(dmx, AS_HELP_STRING([--enable-dmx], [Build DMX server (default: auto)]), [DMX=$enableval], [DMX=auto]) AC_ARG_ENABLE(xvfb, AS_HELP_STRING([--enable-xvfb], [Build Xvfb server (default: yes)]), [XVFB=$enableval], [XVFB=yes]) AC_ARG_ENABLE(xnest, AS_HELP_STRING([--enable-xnest], [Build Xnest server (default: auto)]), [XNEST=$enableval], [XNEST=auto]) -@@ -1163,6 +1165,20 @@ +@@ -1160,6 +1162,20 @@ AM_CONDITIONAL(VGAHW, test "x$VGAHW" = xyes) AM_CONDITIONAL(VBE, test "x$VBE" = xyes) AM_CONDITIONAL(INT10MODULE, test "x$INT10MODULE" = xyes) @@ -51,7 +190,7 @@ AC_DEFINE(SHAPE, 1, [Support SHAPE extension]) AC_DEFINE_DIR(XKB_BASE_DIRECTORY, XKBPATH, [Path to XKB data]) -@@ -1500,6 +1516,40 @@ +@@ -1500,6 +1516,40 @@ dnl --------------------------------------------------------------------------- dnl DDX section. dnl --------------------------------------------------------------------------- @@ -73,7 +212,7 @@ + XVNC_CFLAGS="-DVNCSERVER -DHAVE_XVNC_CONFIG_H" + AC_SUBST([XVNC_CFLAGS]) + VNC_INCLUDES="$XEXT_INC $RENDER_INC $XTRAP_INC $RECORD_INC" -+ XVNC_LIBS="$CONFIG_LIB $XSERVER_LIBS $FB_LIB $MI_LIB $FIXES_LIB $XEXT_LIB $DBE_LIB $XTRAP_LIB $RECORD_LIB $GLX_LIBS $RENDER_LIB $RANDR_LIB $DAMAGE_LIB $MIEXT_DAMAGE_LIB $MIEXT_SHADOW_LIB $XI_LIB $XKB_LIB $XKB_STUB_LIB $COMPOSITE_LIB $XPSTUBS_LIB $CWRAP_LIB $OS_LIB $LIBS" ++ XVNC_LIBS="$XEXT_LIB $MAIN_LIB $CONFIG_LIB $XSERVER_LIBS $FB_LIB $MI_LIB $DBE_LIB $XTRAP_LIB $RECORD_LIB $GLX_LIBS $RENDER_LIB $RANDR_LIB $COMPOSITE_LIB $DAMAGE_LIB $MIEXT_SYNC_LIB $MIEXT_DAMAGE_LIB $MIEXT_SHADOW_LIB $XI_LIB $XKB_LIB $XKB_STUB_LIB $XPSTUBS_LIB $CWRAP_LIB $OS_LIB $FIXES_LIB $LIBS" + AC_SUBST([XVNC_LIBS]) + + if test "x$GLX" = xyes; then @@ -92,7 +231,7 @@ dnl Xvfb DDX AC_MSG_CHECKING([whether to build Xvfb DDX]) -@@ -2202,6 +2252,7 @@ +@@ -2209,6 +2259,7 @@ Xext/Makefile Xi/Makefile xfixes/Makefile exa/Makefile @@ -100,30 +239,28 @@ hw/Makefile hw/xfree86/Makefile hw/xfree86/common/Makefile -@@ -2235,6 +2286,7 @@ +@@ -2242,6 +2293,7 @@ hw/xfree86/ramdac/Makefile hw/xfree86/shadowfb/Makefile hw/xfree86/vbe/Makefile hw/xfree86/vgahw/Makefile +hw/xfree86/vnc/Makefile hw/xfree86/x86emu/Makefile hw/xfree86/xaa/Makefile - hw/xfree86/xf8_16bpp/Makefile -@@ -2246,8 +2298,10 @@ - hw/dmx/examples/Makefile - hw/dmx/input/Makefile + hw/xfree86/utils/Makefile +@@ -2257,6 +2309,8 @@ hw/dmx/input/Makefile hw/dmx/glxProxy/Makefile -+hw/dmx/vnc/Makefile hw/dmx/Makefile - hw/vfb/Makefile + hw/dmx/man/Makefile ++hw/dmx/vnc/Makefile +hw/vnc/Makefile + hw/vfb/Makefile + hw/vfb/man/Makefile hw/xnest/Makefile - hw/xwin/Makefile - hw/xwin/glx/Makefile -Index: xorg-server-1.6.3.901/Makefile.am -================================================================================ ---- xorg-server-1.7.99/hw/Makefile.am -+++ xorg-server-1.7.99/hw/Makefile.am -@@ -22,6 +22,10 @@ +diff --git a/hw/Makefile.am b/hw/Makefile.am +index 6c2cc6b..6c98f21 100644 +--- a/hw/Makefile.am ++++ b/hw/Makefile.am +@@ -22,6 +22,10 @@ if KDRIVE KDRIVE_SUBDIRS = kdrive endif @@ -134,7 +271,8 @@ Index: xorg-server-1.6.3.901/Makefile.am if XQUARTZ XQUARTZ_SUBDIRS = xquartz endif -@@ -33,8 +37,9 @@ +@@ -32,10 +36,11 @@ SUBDIRS = \ + $(XVFB_SUBDIRS) \ $(XNEST_SUBDIRS) \ $(DMX_SUBDIRS) \ + $(VNC_SUBDIRS) \ @@ -145,31 +283,43 @@ Index: xorg-server-1.6.3.901/Makefile.am +DIST_SUBDIRS = dmx xfree86 vfb xnest xwin xquartz kdrive vnc relink: ---- xorg-server-1.7.99/hw/dmx/Makefile.am -+++ xorg-server-1.7.99/hw/dmx/Makefile.am -@@ -1,6 +1,6 @@ --DIST_SUBDIRS = input config glxProxy examples doc -+DIST_SUBDIRS = input vnc config glxProxy examples doc - --SUBDIRS = input config examples -+SUBDIRS = input vnc config examples + $(AM_V_at)for i in $(SUBDIRS) ; do $(MAKE) -C $$i relink || exit 1 ; done +diff --git a/hw/dmx/Makefile.am b/hw/dmx/Makefile.am +index e0b201b..4def812 100644 +--- a/hw/dmx/Makefile.am ++++ b/hw/dmx/Makefile.am +@@ -2,6 +2,16 @@ + SUBDIRS = input config examples doc man bin_PROGRAMS = Xdmx - if XINERAMA ---- xorg-server-1.7.99/hw/dmx/dmx-config.h -+++ xorg-server-1.7.99/hw/dmx/dmx-config.h -@@ -72,4 +72,7 @@ - /* Enable the DMX extension */ - #define DMXEXT - -+/* Enable VNC ability */ -+#define DMXVNC 1 ++if VNC ++SUBDIRS += vnc ++JPEG_LIBS = -ljpeg ++CRYPT_LIBS = -lcrypt ++DMXVNC_LIBS = vnc/libdmxvnc.a \ ++ $(JPEG_LIBS) \ ++ $(CRYPT_LIBS) ++DMXVNCCGLAGS = -DDMXVNC=1 ++endif + - #endif /* DMX_CONFIG_H */ ---- xorg-server-1.7.99/hw/dmx/dmxinit.c -+++ xorg-server-1.7.99/hw/dmx/dmxinit.c -@@ -79,6 +79,10 @@ - ); + if XINERAMA + PANORAMIX_SRCS = $(top_srcdir)/Xext/panoramiX.c + endif +@@ -83,7 +93,7 @@ XDMX_LIBS = \ + + Xdmx_LDFLAGS = $(LD_EXPORT_SYMBOLS_FLAG) + Xdmx_DEPENDENCIES= $(XDMX_LIBS) +-Xdmx_LDADD = $(XDMX_LIBS) $(XDMX_SYS_LIBS) $(XSERVER_SYS_LIBS) ++Xdmx_LDADD = $(DMXVNC_LIBS) $(XDMX_LIBS) $(XDMX_SYS_LIBS) $(XSERVER_SYS_LIBS) + + relink: + $(AM_V_at)rm -f Xdmx$(EXEEXT) && $(MAKE) Xdmx$(EXEEXT) +diff --git a/hw/dmx/dmxinit.c b/hw/dmx/dmxinit.c +index 74b3582..a0c9511 100644 +--- a/hw/dmx/dmxinit.c ++++ b/hw/dmx/dmxinit.c +@@ -71,6 +71,10 @@ + #include #endif /* GLXEXT */ +#ifdef DMXVNC @@ -179,7 +329,7 @@ Index: xorg-server-1.6.3.901/Makefile.am /* Global variables available to all Xserver/hw/dmx routines. */ int dmxNumScreens; DMXScreenInfo *dmxScreens; -@@ -807,6 +811,9 @@ +@@ -794,6 +798,9 @@ void InitOutput(ScreenInfo *pScreenInfo, int argc, char *argv[]) dmxLog(dmxInfo, "Shadow framebuffer support %s\n", dmxShadowFB ? "enabled" : "disabled"); @@ -189,24 +339,11 @@ Index: xorg-server-1.6.3.901/Makefile.am } /* RATS: Assuming the fp string (which comes from the command-line argv -@@ -1039,3 +1046,14 @@ - ErrorF(" Ctrl-Alt-q Quit (core devices only)\n"); - ErrorF(" Ctrl-Alt-F* Switch to VC (local only)\n"); - } -+ -+#ifdef DDXTIME -+/** Return wall-clock time in milliseconds. */ -+CARD32 GetTimeInMillis(void) -+{ -+ struct timeval tp; -+ -+ gettimeofday(&tp, 0); -+ return tp.tv_sec * 1000 + tp.tv_usec / 1000; -+} -+#endif ---- xorg-server-1.7.99/hw/dmx/dmxsync.c -+++ xorg-server-1.7.99/hw/dmx/dmxsync.c -@@ -99,9 +99,16 @@ +diff --git a/hw/dmx/dmxsync.c b/hw/dmx/dmxsync.c +index 2c7ccb8..b6c3ebe 100644 +--- a/hw/dmx/dmxsync.c ++++ b/hw/dmx/dmxsync.c +@@ -99,9 +99,16 @@ static void dmxSyncBlockHandler(pointer blockData, OSTimePtr pTimeout, TimerForce(dmxSyncTimer); } @@ -223,29 +360,26 @@ Index: xorg-server-1.6.3.901/Makefile.am } /** Request the XSync() batching optimization with the specified \a ---- xorg-server-1.7.99/hw/dmx/input/Makefile.am -+++ xorg-server-1.7.99/hw/dmx/input/Makefile.am -@@ -61,6 +61,7 @@ - AM_CFLAGS = $(DIX_CFLAGS) \ - -I$(top_srcdir)/hw/dmx \ - -DHAVE_DMX_CONFIG_H \ -+ -DDMXVNC=1 \ - $(GLX_DEFS) \ - @DMXMODULES_CFLAGS@ - ---- xorg-server-1.7.99/hw/dmx/input/dmxcommon.c -+++ xorg-server-1.7.99/hw/dmx/input/dmxcommon.c -@@ -648,7 +648,6 @@ - dmxLogInput(dmxInput, "Keyboard busy, waiting\n"); - else - dmxLogInput(dmxInput, "Keyboard error, waiting\n"); -- - /* Don't generate X11 protocol for a bit */ - for (tmp = GetTimeInMillis(); GetTimeInMillis() - tmp < 250;) { - usleep(250); /* This ends up sleeping only until ---- xorg-server-1.7.99/hw/dmx/input/dmxinputinit.c -+++ xorg-server-1.7.99/hw/dmx/input/dmxinputinit.c -@@ -372,6 +372,11 @@ +diff --git a/hw/dmx/dmxvnc.h b/hw/dmx/dmxvnc.h +new file mode 100644 +index 0000000..cde7895 +--- /dev/null ++++ b/hw/dmx/dmxvnc.h +@@ -0,0 +1,9 @@ ++#ifndef _DMX_VNC_H_ ++# define _DMX_VNC_H_ ++ ++int ChangePointerDevice (DeviceIntPtr old_dev, DeviceIntPtr new_dev, ++ unsigned char x, unsigned char y); ++ ++int ChangeKeyboardDevice (DeviceIntPtr old_dev, DeviceIntPtr new_dev); ++ ++#endif +diff --git a/hw/dmx/input/dmxinputinit.c b/hw/dmx/input/dmxinputinit.c +index 5cbd620..47dcd17 100644 +--- a/hw/dmx/input/dmxinputinit.c ++++ b/hw/dmx/input/dmxinputinit.c +@@ -364,6 +364,11 @@ static void dmxKeyboardFreeNames(XkbComponentNamesPtr names) static int dmxKeyboardOn(DeviceIntPtr pDevice, DMXLocalInitInfo *info) { GETDMXINPUTFROMPDEVICE; @@ -257,7 +391,7 @@ Index: xorg-server-1.6.3.901/Makefile.am XkbRMLVOSet rmlvo; rmlvo.rules = dmxConfigGetXkbRules(); -@@ -451,7 +456,9 @@ +@@ -443,7 +448,9 @@ static int dmxDeviceOnOff(DeviceIntPtr pDevice, int what) } if (info.keyClass) { XkbRMLVOSet rmlvo; @@ -268,9 +402,9 @@ Index: xorg-server-1.6.3.901/Makefile.am rmlvo.rules = dmxConfigGetXkbRules(); rmlvo.model = dmxConfigGetXkbModel(); rmlvo.layout = dmxConfigGetXkbLayout(); -@@ -499,6 +506,9 @@ +@@ -493,6 +500,9 @@ static int dmxDeviceOnOff(DeviceIntPtr pDevice, int what) info.res[i], info.minres[i], - info.maxres[i]); + info.maxres[i], Absolute); } +#ifdef DMXVNC + vncSetPointerDevice(pDevice); @@ -278,9 +412,11 @@ Index: xorg-server-1.6.3.901/Makefile.am } if (info.focusClass) InitFocusClassDeviceStruct(pDevice); if (info.proximityClass) InitProximityClassDeviceStruct(pDevice); ---- xorg-server-1.7.99/hw/dmx/input/dmxinputinit.h -+++ xorg-server-1.7.99/hw/dmx/input/dmxinputinit.h -@@ -288,4 +288,9 @@ +diff --git a/hw/dmx/input/dmxinputinit.h b/hw/dmx/input/dmxinputinit.h +index 5a4a410..8ec7501 100644 +--- a/hw/dmx/input/dmxinputinit.h ++++ b/hw/dmx/input/dmxinputinit.h +@@ -288,4 +288,9 @@ extern int dmxInputAttachConsole(const char *name, int isCore, extern int dmxInputAttachBackend(int physicalScreen, int isCore, int *id); @@ -290,8 +426,11 @@ Index: xorg-server-1.6.3.901/Makefile.am +#endif + #endif ---- xorg-server-1.7.99/hw/dmx/vnc/.gitignore -+++ xorg-server-1.7.99/hw/dmx/vnc/.gitignore +diff --git a/hw/dmx/vnc/.gitignore b/hw/dmx/vnc/.gitignore +new file mode 100644 +index 0000000..d14621f +--- /dev/null ++++ b/hw/dmx/vnc/.gitignore @@ -0,0 +1,36 @@ +auth.c +cmap.c @@ -329,8 +468,11 @@ Index: xorg-server-1.6.3.901/Makefile.am +vncext.c +xistubs.c +zlib.c ---- xorg-server-1.7.99/hw/dmx/vnc/Makefile.am -+++ xorg-server-1.7.99/hw/dmx/vnc/Makefile.am +diff --git a/hw/dmx/vnc/Makefile.am b/hw/dmx/vnc/Makefile.am +new file mode 100644 +index 0000000..48c07bd +--- /dev/null ++++ b/hw/dmx/vnc/Makefile.am @@ -0,0 +1,43 @@ +noinst_LIBRARIES = libdmxvnc.a + @@ -375,9 +517,12 @@ Index: xorg-server-1.6.3.901/Makefile.am + @DMXMODULES_CFLAGS@ + +###EXTRA_DIST = dmxdetach.c ---- xorg-server-1.7.99/hw/dmx/vnc/vncInit.c -+++ xorg-server-1.7.99/hw/dmx/vnc/vncInit.c -@@ -0,0 +1,453 @@ +diff --git a/hw/dmx/vnc/vncInit.c b/hw/dmx/vnc/vncInit.c +new file mode 100644 +index 0000000..81b6a18 +--- /dev/null ++++ b/hw/dmx/vnc/vncInit.c +@@ -0,0 +1,441 @@ +/* + * Copyright (C) 2002 Alan Hourihane. All Rights Reserved. + * @@ -425,8 +570,11 @@ Index: xorg-server-1.6.3.901/Makefile.am + +#include + -+int vncScreenPrivateIndex = -1; -+int rfbGCIndex = -1; ++struct _DevPrivateKeyRec VNCScreenKeyRec; ++DevPrivateKey VNCScreenKey = &VNCScreenKeyRec; ++struct _DevPrivateKeyRec rfbGCKeyRec; ++DevPrivateKey rfbGCKey = &rfbGCKeyRec; ++ +int inetdSock = -1; +Atom VNC_LAST_CLIENT_ID = 0; +Atom VNC_CONNECT = 0; @@ -458,7 +606,7 @@ Index: xorg-server-1.6.3.901/Makefile.am + + time(&clock); + strftime(buf, 255, "%d/%m/%Y %H:%M:%S ", localtime(&clock)); -+ fprintf(stderr, buf); ++ fprintf(stderr, "%s\n", buf); + + vfprintf(stderr, format, args); + fflush(stderr); @@ -494,7 +642,7 @@ Index: xorg-server-1.6.3.901/Makefile.am + VisualPtr v = NULL; + int i; + -+ pScreenPriv = xalloc(sizeof(vncScreenRec)); ++ pScreenPriv = malloc(sizeof(vncScreenRec)); + pScreenPriv->width = dmxGlobalWidth; + pScreenPriv->height = dmxGlobalHeight; + pScreenPriv->rfbAuthTries = 0; @@ -557,13 +705,9 @@ Index: xorg-server-1.6.3.901/Makefile.am + = pScreenPriv->rfbServerFormat.blueShift = 0; + } + -+ /* Allocate/init TheVNCScreen object */ -+ vncScreenPrivateIndex = 0; -+ + TheVNCScreen = (ScreenPtr) Xcalloc(1, sizeof(struct _Screen)); -+ TheVNCScreen->devPrivates = (DevUnion *) Xcalloc(1, sizeof(DevUnion)); -+ TheVNCScreen->devPrivates[vncScreenPrivateIndex].ptr = pScreenPriv; + TheVNCScreen->GetImage = nopGetImage; ++ dixSetPrivate(&TheVNCScreen->devPrivates, VNCScreenKey, pScreenPriv); + + rfbInitSockets(TheVNCScreen); + if (inetdSock == -1) @@ -612,21 +756,16 @@ Index: xorg-server-1.6.3.901/Makefile.am +#ifndef XFree86LOADER + if (VNCGeneration != serverGeneration) { + VNCGeneration = serverGeneration; -+ if ( ((vncScreenPrivateIndex = AllocateScreenPrivateIndex()) < 0) || -+ ((rfbGCIndex = AllocateGCPrivateIndex()) < 0) ) ++ if (!dixRegisterPrivateKey(VNCScreenKey, PRIVATE_SCREEN, 0) ++ || !dixRegisterPrivateKey(rfbGCKey, PRIVATE_GC, 0)) + return FALSE; + } +#endif + -+ if (!AllocateGCPrivate(pScreen, rfbGCIndex, sizeof(rfbGCRec))) { -+ ErrorF("VNCInit(): failed to allocate GCIndex\n"); -+ return FALSE; -+ } -+ -+ if (!(pScreenPriv = xalloc(sizeof(vncScreenRec)))) ++ if (!(pScreenPriv = malloc(sizeof(vncScreenRec)))) + return FALSE; + -+ pScreen->devPrivates[vncScreenPrivateIndex].ptr = (pointer)pScreenPriv; ++ dixSetPrivate(&pScreen->devPrivates, VNCScreenKey, pScreenPriv); + + pScreenPriv->rfbAuthTries = 0; + pScreenPriv->rfbAuthTooManyTries = FALSE; @@ -715,11 +854,8 @@ Index: xorg-server-1.6.3.901/Makefile.am + + pScreenPriv->CloseScreen = pScreen->CloseScreen; + pScreenPriv->CreateGC = pScreen->CreateGC; -+ pScreenPriv->PaintWindowBackground = pScreen->PaintWindowBackground; -+ pScreenPriv->PaintWindowBorder = pScreen->PaintWindowBorder; + pScreenPriv->CopyWindow = pScreen->CopyWindow; + pScreenPriv->ClearToBackground = pScreen->ClearToBackground; -+ pScreenPriv->RestoreAreas = pScreen->RestoreAreas; + pScreenPriv->WakeupHandler = pScreen->WakeupHandler; + pScreenPriv->InstallColormap = pScreen->InstallColormap; + pScreenPriv->UninstallColormap = pScreen->UninstallColormap; @@ -740,11 +876,8 @@ Index: xorg-server-1.6.3.901/Makefile.am +#endif + pScreen->CloseScreen = rfbCloseScreen; + pScreen->CreateGC = rfbCreateGC; -+ pScreen->PaintWindowBackground = rfbPaintWindowBackground; -+ pScreen->PaintWindowBorder = rfbPaintWindowBorder; + pScreen->CopyWindow = rfbCopyWindow; + pScreen->ClearToBackground = rfbClearToBackground; -+ pScreen->RestoreAreas = rfbRestoreAreas; + pScreen->WakeupHandler = rfbWakeupHandler; + pScreen->InstallColormap = rfbInstallColormap; + pScreen->UninstallColormap = rfbUninstallColormap; @@ -831,9 +964,12 @@ Index: xorg-server-1.6.3.901/Makefile.am + rfbCheckFds(pScreen); + httpCheckFds(pScreen); +} ---- xorg-server-1.7.99/hw/dmx/vnc/vncint.h -+++ xorg-server-1.7.99/hw/dmx/vnc/vncint.h -@@ -0,0 +1,153 @@ +diff --git a/hw/dmx/vnc/vncint.h b/hw/dmx/vnc/vncint.h +new file mode 100644 +index 0000000..6b6cd91 +--- /dev/null ++++ b/hw/dmx/vnc/vncint.h +@@ -0,0 +1,150 @@ +/* + * Copyright (C) 2002 Alan Hourihane. All Rights Reserved. + * @@ -863,7 +999,7 @@ Index: xorg-server-1.6.3.901/Makefile.am +extern int vncScreenPrivateIndex; + +#define VNCPTR(pScreen)\ -+ (vncScreenPtr)((pScreen)->devPrivates[vncScreenPrivateIndex].ptr) ++ (vncScreenPtr)(dixLookupPrivate(&(pScreen)->devPrivates, VNCScreenKey)) + +typedef struct { + int rfbPort; @@ -950,11 +1086,8 @@ Index: xorg-server-1.6.3.901/Makefile.am + + CloseScreenProcPtr CloseScreen; + CreateGCProcPtr CreateGC; -+ PaintWindowBackgroundProcPtr PaintWindowBackground; -+ PaintWindowBorderProcPtr PaintWindowBorder; + CopyWindowProcPtr CopyWindow; + ClearToBackgroundProcPtr ClearToBackground; -+ RestoreAreasProcPtr RestoreAreas; + ScreenWakeupHandlerProcPtr WakeupHandler; + InstallColormapProcPtr InstallColormap; + UninstallColormapProcPtr UninstallColormap; @@ -987,8 +1120,11 @@ Index: xorg-server-1.6.3.901/Makefile.am + +#endif /* _VNCINT_H_ */ + ---- xorg-server-1.7.99/hw/vnc/LICENCE.TXT -+++ xorg-server-1.7.99/hw/vnc/LICENCE.TXT +diff --git a/hw/vnc/LICENCE.TXT b/hw/vnc/LICENCE.TXT +new file mode 100644 +index 0000000..ae3b531 +--- /dev/null ++++ b/hw/vnc/LICENCE.TXT @@ -0,0 +1,340 @@ + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 @@ -1330,9 +1466,12 @@ Index: xorg-server-1.6.3.901/Makefile.am +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Library General +Public License instead of this License. ---- xorg-server-1.7.99/hw/vnc/Makefile.am -+++ xorg-server-1.7.99/hw/vnc/Makefile.am -@@ -0,0 +1,54 @@ +diff --git a/hw/vnc/Makefile.am b/hw/vnc/Makefile.am +new file mode 100644 +index 0000000..36a88c6 +--- /dev/null ++++ b/hw/vnc/Makefile.am +@@ -0,0 +1,55 @@ +# XXX This Makefile.am probably needs some work. + +bin_PROGRAMS = Xvnc @@ -1371,7 +1510,7 @@ Index: xorg-server-1.6.3.901/Makefile.am + +JPEG_LIBS = -ljpeg +CRYPT_LIBS = -lcrypt -+FB_LIBS = ../../fb/.libs/libfb.a ++Z_LIBS = -lz + +AM_CFLAGS = $(DIX_CFLAGS) $(XVNC_CFLAGS) -I$(top_srcdir)/hw/dmx/vnc -DCHROMIUM=1 + @@ -1382,13 +1521,17 @@ Index: xorg-server-1.6.3.901/Makefile.am + $(JPEG_LIBS) \ + $(CRYPT_LIBS) \ + $(XSERVER_SYS_LIBS) \ -+ $(VNCMODULES_LIBS) ++ $(VNCMODULES_LIBS) \ ++ $(Z_LIBS) + + +relink: + rm -f Xvnc && $(MAKE) Xvnc ---- xorg-server-1.7.99/hw/vnc/README -+++ xorg-server-1.7.99/hw/vnc/README +diff --git a/hw/vnc/README b/hw/vnc/README +new file mode 100644 +index 0000000..d65d560 +--- /dev/null ++++ b/hw/vnc/README @@ -0,0 +1,14 @@ + +This is the directory containing the code specific to the TightVNC X server (Xvnc). @@ -1404,9 +1547,12 @@ Index: xorg-server-1.6.3.901/Makefile.am + +Moved to X.org modular tree by Brian Paul. + ---- xorg-server-1.7.99/hw/vnc/auth.c -+++ xorg-server-1.7.99/hw/vnc/auth.c -@@ -0,0 +1,566 @@ +diff --git a/hw/vnc/auth.c b/hw/vnc/auth.c +new file mode 100644 +index 0000000..47a5a92 +--- /dev/null ++++ b/hw/vnc/auth.c +@@ -0,0 +1,554 @@ +/* + * auth.c - deal with authentication. + * @@ -1455,8 +1601,7 @@ Index: xorg-server-1.6.3.901/Makefile.am + */ + +void -+rfbAuthNewClient(cl) -+ rfbClientPtr cl; ++rfbAuthNewClient(rfbClientPtr cl) +{ + VNCSCREENPTR(cl->pScreen); + int securityType = rfbSecTypeInvalid; @@ -1494,9 +1639,7 @@ Index: xorg-server-1.6.3.901/Makefile.am + */ + +static void -+rfbSendSecurityType(cl, securityType) -+ rfbClientPtr cl; -+ int securityType; ++rfbSendSecurityType(rfbClientPtr cl, int securityType) +{ + CARD32 value32; + @@ -1535,9 +1678,7 @@ Index: xorg-server-1.6.3.901/Makefile.am + */ + +static void -+rfbSendSecurityTypeList(cl, primaryType) -+ rfbClientPtr cl; -+ int primaryType; ++rfbSendSecurityTypeList(rfbClientPtr cl, int primaryType) +{ + int count = 1; + @@ -1565,8 +1706,7 @@ Index: xorg-server-1.6.3.901/Makefile.am + */ + +void -+rfbProcessClientSecurityType(cl) -+ rfbClientPtr cl; ++rfbProcessClientSecurityType(rfbClientPtr cl) +{ + int n, count, i; + CARD8 chosenType; @@ -1627,8 +1767,7 @@ Index: xorg-server-1.6.3.901/Makefile.am + */ + +static void -+rfbSendTunnelingCaps(cl) -+ rfbClientPtr cl; ++rfbSendTunnelingCaps(rfbClientPtr cl) +{ + rfbTunnelingCapsMsg caps; + CARD32 nTypes = 0; /* we don't support tunneling yet */ @@ -1656,8 +1795,7 @@ Index: xorg-server-1.6.3.901/Makefile.am + */ + +void -+rfbProcessClientTunnelingType(cl) -+ rfbClientPtr cl; ++rfbProcessClientTunnelingType(rfbClientPtr cl) +{ + /* If we were called, then something's really wrong. */ + rfbLog("rfbProcessClientTunnelingType: not implemented\n"); @@ -1672,8 +1810,7 @@ Index: xorg-server-1.6.3.901/Makefile.am + */ + +static void -+rfbSendAuthCaps(cl) -+ rfbClientPtr cl; ++rfbSendAuthCaps(rfbClientPtr cl) +{ + VNCSCREENPTR(cl->pScreen); + Bool authRequired; @@ -1730,8 +1867,7 @@ Index: xorg-server-1.6.3.901/Makefile.am + */ + +void -+rfbProcessClientAuthType(cl) -+ rfbClientPtr cl; ++rfbProcessClientAuthType(rfbClientPtr cl) +{ + CARD32 auth_type; + int n, i; @@ -1784,8 +1920,7 @@ Index: xorg-server-1.6.3.901/Makefile.am + */ + +static void -+rfbVncAuthSendChallenge(cl) -+ rfbClientPtr cl; ++rfbVncAuthSendChallenge(rfbClientPtr cl) +{ + vncRandomBytes(cl->authChallenge); + if (WriteExact(cl->sock, (char *)cl->authChallenge, CHALLENGESIZE) < 0) { @@ -1804,8 +1939,7 @@ Index: xorg-server-1.6.3.901/Makefile.am + */ + +void -+rfbVncAuthProcessResponse(cl) -+ rfbClientPtr cl; ++rfbVncAuthProcessResponse(rfbClientPtr cl) +{ + VNCSCREENPTR(cl->pScreen); + char passwdFullControl[9]; @@ -1973,9 +2107,12 @@ Index: xorg-server-1.6.3.901/Makefile.am + return pVNC->rfbAuthTooManyTries; +} + ---- xorg-server-1.7.99/hw/vnc/cmap.c -+++ xorg-server-1.7.99/hw/vnc/cmap.c -@@ -0,0 +1,166 @@ +diff --git a/hw/vnc/cmap.c b/hw/vnc/cmap.c +new file mode 100644 +index 0000000..67a3812 +--- /dev/null ++++ b/hw/vnc/cmap.c +@@ -0,0 +1,159 @@ +/* + * cmap.c + * @@ -2037,9 +2174,7 @@ Index: xorg-server-1.6.3.901/Makefile.am +#include "rfb.h" + +int -+rfbListInstalledColormaps(pScreen, pmaps) -+ ScreenPtr pScreen; -+ Colormap *pmaps; ++rfbListInstalledColormaps(ScreenPtr pScreen, Colormap *pmaps) +{ + VNCSCREENPTR(pScreen); + /* By the time we are processing requests, we can guarantee that there @@ -2058,8 +2193,7 @@ Index: xorg-server-1.6.3.901/Makefile.am + + +void -+rfbInstallColormap(pmap) -+ ColormapPtr pmap; ++rfbInstallColormap(ColormapPtr pmap) +{ + VNCSCREENPTR(pmap->pScreen); + @@ -2082,8 +2216,7 @@ Index: xorg-server-1.6.3.901/Makefile.am +} + +void -+rfbUninstallColormap(pmap) -+ ColormapPtr pmap; ++rfbUninstallColormap(ColormapPtr pmap) +{ + VNCSCREENPTR(pmap->pScreen); + @@ -2091,9 +2224,9 @@ Index: xorg-server-1.6.3.901/Makefile.am + { + if (pmap->mid != pmap->pScreen->defColormap) + { -+ pVNC->rfbInstalledColormap = -+ (ColormapPtr) LookupIDByType(pmap->pScreen->defColormap, -+ RT_COLORMAP); ++ dixLookupResourceByType((pointer)&pVNC->rfbInstalledColormap, ++ pmap->pScreen->defColormap, RT_COLORMAP, ++ NullClient, DixUnknownAccess); + (*pmap->pScreen->InstallColormap)(pVNC->rfbInstalledColormap); + } + } @@ -2112,10 +2245,7 @@ Index: xorg-server-1.6.3.901/Makefile.am + */ + +void -+rfbStoreColors(pmap, ndef, pdefs) -+ ColormapPtr pmap; -+ int ndef; -+ xColorItem *pdefs; ++rfbStoreColors(ColormapPtr pmap, int ndef, xColorItem *pdefs) +{ + VNCSCREENPTR(pmap->pScreen); + int i; @@ -2142,9 +2272,12 @@ Index: xorg-server-1.6.3.901/Makefile.am + pmap->pScreen->StoreColors = rfbStoreColors; +#endif +} ---- xorg-server-1.7.99/hw/vnc/corre.c -+++ xorg-server-1.7.99/hw/vnc/corre.c -@@ -0,0 +1,353 @@ +diff --git a/hw/vnc/corre.c b/hw/vnc/corre.c +new file mode 100644 +index 0000000..5f7f087 +--- /dev/null ++++ b/hw/vnc/corre.c +@@ -0,0 +1,343 @@ +/* + * corre.c + * @@ -2207,9 +2340,7 @@ Index: xorg-server-1.6.3.901/Makefile.am + */ + +Bool -+rfbSendRectEncodingCoRRE(cl, x, y, w, h) -+ rfbClientPtr cl; -+ int x, y, w, h; ++rfbSendRectEncodingCoRRE(rfbClientPtr cl, int x, int y, int w, int h) +{ + if (h > cl->correMaxHeight) { + return (rfbSendRectEncodingCoRRE(cl, x, y, w, cl->correMaxHeight) && @@ -2234,9 +2365,7 @@ Index: xorg-server-1.6.3.901/Makefile.am + */ + +static Bool -+rfbSendSmallRectEncodingCoRRE(cl, x, y, w, h) -+ rfbClientPtr cl; -+ int x, y, w, h; ++rfbSendSmallRectEncodingCoRRE(rfbClientPtr cl, int x, int y, int w, int h) +{ + VNCSCREENPTR(cl->pScreen); + rfbFramebufferUpdateRectHeader rect; @@ -2249,17 +2378,17 @@ Index: xorg-server-1.6.3.901/Makefile.am + if (rreBeforeBufSize < maxRawSize) { + rreBeforeBufSize = maxRawSize; + if (rreBeforeBuf == NULL) -+ rreBeforeBuf = (unsigned char *)xalloc(rreBeforeBufSize); ++ rreBeforeBuf = (unsigned char *)malloc(rreBeforeBufSize); + else -+ rreBeforeBuf = (unsigned char *)xrealloc(rreBeforeBuf, rreBeforeBufSize); ++ rreBeforeBuf = (unsigned char *)realloc(rreBeforeBuf, rreBeforeBufSize); + } + + if (rreAfterBufSize < maxRawSize) { + rreAfterBufSize = maxRawSize; + if (rreAfterBuf == NULL) -+ rreAfterBuf = (unsigned char *)xalloc(rreAfterBufSize); ++ rreAfterBuf = (unsigned char *)malloc(rreAfterBufSize); + else -+ rreAfterBuf = (unsigned char *)xrealloc(rreAfterBuf, rreAfterBufSize); ++ rreAfterBuf = (unsigned char *)realloc(rreAfterBuf, rreAfterBufSize); + } + + (*cl->translateFn)(cl->pScreen, cl->translateLookupTable, @@ -2354,10 +2483,7 @@ Index: xorg-server-1.6.3.901/Makefile.am + +#define DEFINE_SUBRECT_ENCODE(bpp) \ +static int \ -+subrectEncode##bpp(data,w,h) \ -+ CARD##bpp *data; \ -+ int w; \ -+ int h; \ ++subrectEncode##bpp(CARD##bpp *data, int w, int h) \ +{ \ + CARD##bpp cl; \ + rfbCoRRERectangle subrect; \ @@ -2454,10 +2580,7 @@ Index: xorg-server-1.6.3.901/Makefile.am + * getBgColour() gets the most prevalent colour in a byte array. + */ +static CARD32 -+getBgColour(data,size,bpp) -+ char *data; -+ int size; -+ int bpp; ++getBgColour(char *data, int size, int bpp) +{ + +#define NUMCLRS 256 @@ -2498,9 +2621,12 @@ Index: xorg-server-1.6.3.901/Makefile.am + + return maxclr; +} ---- xorg-server-1.7.99/hw/vnc/cursor.c -+++ xorg-server-1.7.99/hw/vnc/cursor.c -@@ -0,0 +1,407 @@ +diff --git a/hw/vnc/cursor.c b/hw/vnc/cursor.c +new file mode 100644 +index 0000000..2892393 +--- /dev/null ++++ b/hw/vnc/cursor.c +@@ -0,0 +1,398 @@ +/* + * cursor.c - support for cursor shape updates. + * @@ -2536,6 +2662,7 @@ Index: xorg-server-1.6.3.901/Makefile.am +#include "sprite.h" +#include "cursorstr.h" +#include "servermd.h" ++#include "inputstr.h" + + +/* Copied from Xvnc/lib/font/util/utilbitmap.c */ @@ -2590,9 +2717,7 @@ Index: xorg-server-1.6.3.901/Makefile.am + */ + +Bool -+rfbSendCursorShape(cl, pScreen) -+ rfbClientPtr cl; -+ ScreenPtr pScreen; ++rfbSendCursorShape(rfbClientPtr cl, ScreenPtr pScreen) +{ + VNCSCREENPTR(pScreen); + CursorPtr pCursor; @@ -2747,14 +2872,12 @@ Index: xorg-server-1.6.3.901/Makefile.am + * Send cursor position (PointerPos pseudo-encoding). + */ +Bool -+rfbSendCursorPos(cl, pScreen) -+ rfbClientPtr cl; -+ ScreenPtr pScreen; ++rfbSendCursorPos(rfbClientPtr cl, ScreenPtr pScreen) +{ + VNCSCREENPTR(pScreen); + rfbFramebufferUpdateRectHeader rect; +#if XFREE86VNC -+ ScreenPtr pCursorScreen = miPointerCurrentScreen(); /*XXX deprecated*/ ++ ScreenPtr pCursorScreen = miPointerGetScreen(inputInfo.pointer); +#endif + int x, y; + @@ -2765,7 +2888,7 @@ Index: xorg-server-1.6.3.901/Makefile.am + +#if XFREE86VNC + if (pScreen == pCursorScreen) -+ miPointerPosition(&x, &y); ++ miPointerGetPosition(inputInfo.pointer, &x, &y); +#else + rfbSpriteGetCursorPos(pScreen, &x, &y); +#endif @@ -2802,10 +2925,7 @@ Index: xorg-server-1.6.3.901/Makefile.am + ((CARD32)(b) * ((fmt)->blueMax + 1) >> 16) << (fmt)->blueShift) + +static int -+EncodeRichCursorData8(buf, fmt, pCursor) -+ unsigned char *buf; -+ rfbPixelFormat *fmt; -+ CursorPtr pCursor; ++EncodeRichCursorData8(unsigned char *buf, rfbPixelFormat *fmt, CursorPtr pCursor) +{ + int widthPixels, widthBytes; + int x, y, b; @@ -2849,11 +2969,8 @@ Index: xorg-server-1.6.3.901/Makefile.am +#define DEFINE_RICH_ENCODE(bpp) \ + \ +static int \ -+EncodeRichCursorData##bpp(pScreen, buf, fmt, pCursor) \ -+ ScreenPtr pScreen; \ -+ unsigned char *buf; \ -+ rfbPixelFormat *fmt; \ -+ CursorPtr pCursor; \ ++EncodeRichCursorData##bpp(ScreenPtr pScreen, unsigned char *buf, \ ++ rfbPixelFormat *fmt, CursorPtr pCursor) \ +{ \ + VNCSCREENPTR(pScreen); \ + int widthPixels, widthBytes; \ @@ -2908,9 +3025,12 @@ Index: xorg-server-1.6.3.901/Makefile.am +DEFINE_RICH_ENCODE(16) +DEFINE_RICH_ENCODE(32) + ---- xorg-server-1.7.99/hw/vnc/cutpaste.c -+++ xorg-server-1.7.99/hw/vnc/cutpaste.c -@@ -0,0 +1,87 @@ +diff --git a/hw/vnc/cutpaste.c b/hw/vnc/cutpaste.c +new file mode 100644 +index 0000000..bdb0d44 +--- /dev/null ++++ b/hw/vnc/cutpaste.c +@@ -0,0 +1,86 @@ +/* + * cutpaste.c - routines to deal with cut & paste buffers / selection. + * @@ -2963,15 +3083,14 @@ Index: xorg-server-1.6.3.901/Makefile.am +void +rfbSetXCutText(char *str, int len) +{ -+ int i = 0; + Selection *pSel; + + inSetXCutText = TRUE; -+ ChangeWindowProperty(WindowTable[0], XA_CUT_BUFFER0, XA_STRING, ++ ChangeWindowProperty(screenInfo.screens[0]->root, XA_CUT_BUFFER0, XA_STRING, + 8, PropModeReplace, len, + (pointer)str, TRUE); + -+ if (dixLookupSelection(&pSel, XA_PRIMARY, serverClient, DixSetAttrAccess)) { ++ if (dixLookupSelection(&pSel, XA_PRIMARY, serverClient, DixSetAttrAccess) == Success) { + xEvent event; + + if (pSel->client) { @@ -2979,7 +3098,7 @@ Index: xorg-server-1.6.3.901/Makefile.am + event.u.selectionClear.time = GetTimeInMillis(); + event.u.selectionClear.window = pSel->window; + event.u.selectionClear.atom = pSel->selection; -+ (void) TryClientEvents (pSel->client, &event, 1, ++ (void) TryClientEvents (pSel->client, NULL, &event, 1, + NoEventMask, NoEventMask /* CantBeFiltered */, + NullGrab); + } @@ -2998,9 +3117,12 @@ Index: xorg-server-1.6.3.901/Makefile.am + if (!inSetXCutText) + rfbSendServerCutText(str, len); +} ---- xorg-server-1.7.99/hw/vnc/d3des.c -+++ xorg-server-1.7.99/hw/vnc/d3des.c -@@ -0,0 +1,437 @@ +diff --git a/hw/vnc/d3des.c b/hw/vnc/d3des.c +new file mode 100644 +index 0000000..e9f57ca +--- /dev/null ++++ b/hw/vnc/d3des.c +@@ -0,0 +1,428 @@ +/* + * This is D3DES (V5.09) by Richard Outerbridge with the double and + * triple-length support removed for use in VNC. Also the bytebit[] array @@ -3069,9 +3191,7 @@ Index: xorg-server-1.6.3.901/Makefile.am + 40, 51, 30, 36, 46, 54, 29, 39, 50, 44, 32, 47, + 43, 48, 38, 55, 33, 52, 45, 41, 49, 35, 28, 31 }; + -+void deskey(key, edf) /* Thanks to James Gillogly & Phil Karn! */ -+unsigned char *key; -+int edf; ++void deskey(unsigned char *key, int edf) /* Thanks to James Gillogly & Phil Karn! */ +{ + register int i, j, l, m, n; + unsigned char pc1m[56], pcr[56]; @@ -3106,8 +3226,7 @@ Index: xorg-server-1.6.3.901/Makefile.am + return; + } + -+static void cookey(raw1) -+register unsigned long *raw1; ++static void cookey(register unsigned long *raw1) +{ + register unsigned long *cook, *raw0; + unsigned long dough[32]; @@ -3129,8 +3248,7 @@ Index: xorg-server-1.6.3.901/Makefile.am + return; + } + -+void cpkey(into) -+register unsigned long *into; ++void cpkey(register unsigned long *into) +{ + register unsigned long *from, *endp; + @@ -3139,8 +3257,7 @@ Index: xorg-server-1.6.3.901/Makefile.am + return; + } + -+void usekey(from) -+register unsigned long *from; ++void usekey(register unsigned long *from) +{ + register unsigned long *to, *endp; + @@ -3149,8 +3266,7 @@ Index: xorg-server-1.6.3.901/Makefile.am + return; + } + -+void des(inblock, outblock) -+unsigned char *inblock, *outblock; ++void des(unsigned char *inblock, unsigned char *outblock) +{ + unsigned long work[2]; + @@ -3160,9 +3276,8 @@ Index: xorg-server-1.6.3.901/Makefile.am + return; + } + -+static void scrunch(outof, into) -+register unsigned char *outof; -+register unsigned long *into; ++static void scrunch(register unsigned char *outof, ++ register unsigned long *into) +{ + *into = (*outof++ & 0xffL) << 24; + *into |= (*outof++ & 0xffL) << 16; @@ -3175,9 +3290,8 @@ Index: xorg-server-1.6.3.901/Makefile.am + return; + } + -+static void unscrun(outof, into) -+register unsigned long *outof; -+register unsigned char *into; ++static void unscrun(register unsigned long *outof, ++ register unsigned char *into) +{ + *into++ = (*outof >> 24) & 0xffL; + *into++ = (*outof >> 16) & 0xffL; @@ -3334,8 +3448,7 @@ Index: xorg-server-1.6.3.901/Makefile.am + 0x10041040L, 0x00041000L, 0x00041000L, 0x00001040L, + 0x00001040L, 0x00040040L, 0x10000000L, 0x10041000L }; + -+static void desfunc(block, keys) -+register unsigned long *block, *keys; ++static void desfunc(register unsigned long *block, register unsigned long *keys) +{ + register unsigned long fval, work, right, leftt; + register int round; @@ -3438,8 +3551,11 @@ Index: xorg-server-1.6.3.901/Makefile.am + * + * d3des V5.0a rwo 9208.07 18:44 Graven Imagery + **********************************************************************/ ---- xorg-server-1.7.99/hw/vnc/d3des.h -+++ xorg-server-1.7.99/hw/vnc/d3des.h +diff --git a/hw/vnc/d3des.h b/hw/vnc/d3des.h +new file mode 100644 +index 0000000..ea3da44 +--- /dev/null ++++ b/hw/vnc/d3des.h @@ -0,0 +1,51 @@ +/* + * This is D3DES (V5.09) by Richard Outerbridge with the double and @@ -3492,9 +3608,12 @@ Index: xorg-server-1.6.3.901/Makefile.am + +/* d3des.h V5.09 rwo 9208.04 15:06 Graven Imagery + ********************************************************************/ ---- xorg-server-1.7.99/hw/vnc/dispcur.c -+++ xorg-server-1.7.99/hw/vnc/dispcur.c -@@ -0,0 +1,792 @@ +diff --git a/hw/vnc/dispcur.c b/hw/vnc/dispcur.c +new file mode 100644 +index 0000000..96d4137 +--- /dev/null ++++ b/hw/vnc/dispcur.c +@@ -0,0 +1,784 @@ +/* + * dispcur.c + * @@ -3571,7 +3690,10 @@ Index: xorg-server-1.6.3.901/Makefile.am + +/* per-screen private data */ + -+static DevPrivateKey rfbDCScreenKey = &rfbDCScreenKey; ++static DevPrivateKeyRec rfbDCScreenKeyRec; ++#define rfbDCScreenKey (&rfbDCScreenKeyRec) ++static DevPrivateKeyRec rfbScreenKeyRec; ++#define rfbScreenKey (&rfbScreenKeyRec) + +static Bool rfbDCCloseScreen(int index, ScreenPtr pScreen); + @@ -3631,7 +3753,13 @@ Index: xorg-server-1.6.3.901/Makefile.am +{ + rfbDCScreenPtr pScreenPriv; + -+ pScreenPriv = (rfbDCScreenPtr) xalloc (sizeof (rfbDCScreenRec)); ++ if (!dixRegisterPrivateKey(rfbDCScreenKey, PRIVATE_SCREEN, 0)) ++ return FALSE; ++ ++ if (!dixRegisterPrivateKey(rfbScreenKey, PRIVATE_CURSOR_BITS, 0)) ++ return FALSE; ++ ++ pScreenPriv = (rfbDCScreenPtr) malloc (sizeof (rfbDCScreenRec)); + if (!pScreenPriv) + return FALSE; + @@ -3660,7 +3788,7 @@ Index: xorg-server-1.6.3.901/Makefile.am + + if (!rfbSpriteInitialize (pScreen, &rfbDCFuncs, screenFuncs)) + { -+ xfree ((pointer) pScreenPriv); ++ free ((pointer) pScreenPriv); + return FALSE; + } + return TRUE; @@ -3671,8 +3799,7 @@ Index: xorg-server-1.6.3.901/Makefile.am +#define tossPict(pict) (pict ? FreePicture (pict, 0) : 0) + +static Bool -+rfbDCCloseScreen (index, pScreen) -+ ScreenPtr pScreen; ++rfbDCCloseScreen (int index, ScreenPtr pScreen) +{ + rfbDCScreenPtr pScreenPriv; + @@ -3692,17 +3819,15 @@ Index: xorg-server-1.6.3.901/Makefile.am + tossPict (pScreenPriv->pRootPicture); + tossPict (pScreenPriv->pTempPicture); +#endif -+ xfree ((pointer) pScreenPriv); ++ free ((pointer) pScreenPriv); + return (*pScreen->CloseScreen) (index, pScreen); +} + +static Bool -+rfbDCRealizeCursor (pScreen, pCursor) -+ ScreenPtr pScreen; -+ CursorPtr pCursor; ++rfbDCRealizeCursor (ScreenPtr pScreen, CursorPtr pCursor) +{ + if (pCursor->bits->refcnt <= 1) -+ dixSetPrivate(&pCursor->bits->devPrivates, pScreen, NULL); ++ dixSetPrivate(&pCursor->bits->devPrivates, rfbScreenKey, NULL); + return TRUE; +} + @@ -3753,7 +3878,7 @@ Index: xorg-server-1.6.3.901/Makefile.am + GCPtr pGC; + XID gcvals[3]; + -+ pPriv = (rfbDCCursorPtr) xalloc (sizeof (rfbDCCursorRec)); ++ pPriv = (rfbDCCursorPtr) malloc (sizeof (rfbDCCursorRec)); + if (!pPriv) + return (rfbDCCursorPtr)NULL; +#ifdef ARGB_CURSOR @@ -3766,7 +3891,7 @@ Index: xorg-server-1.6.3.901/Makefile.am + pFormat = PictureMatchFormat (pScreen, 32, PICT_a8r8g8b8); + if (!pFormat) + { -+ xfree ((pointer) pPriv); ++ free ((pointer) pPriv); + return (rfbDCCursorPtr)NULL; + } + @@ -3776,14 +3901,14 @@ Index: xorg-server-1.6.3.901/Makefile.am + pCursor->bits->height, 32, 0); + if (!pPixmap) + { -+ xfree ((pointer) pPriv); ++ free ((pointer) pPriv); + return (rfbDCCursorPtr)NULL; + } + pGC = GetScratchGC (32, pScreen); + if (!pGC) + { + (*pScreen->DestroyPixmap) (pPixmap); -+ xfree ((pointer) pPriv); ++ free ((pointer) pPriv); + return (rfbDCCursorPtr)NULL; + } + ValidateGC (&pPixmap->drawable, pGC); @@ -3797,10 +3922,10 @@ Index: xorg-server-1.6.3.901/Makefile.am + (*pScreen->DestroyPixmap) (pPixmap); + if (!pPriv->pPicture) + { -+ xfree ((pointer) pPriv); ++ free ((pointer) pPriv); + return (rfbDCCursorPtr)NULL; + } -+ dixSetPrivate(&pCursor->bits->devPrivates, pScreen, pPriv); ++ dixSetPrivate(&pCursor->bits->devPrivates, rfbScreenKey, pPriv); + return pPriv; + } + pPriv->pPicture = 0; @@ -3808,17 +3933,17 @@ Index: xorg-server-1.6.3.901/Makefile.am + pPriv->sourceBits = (*pScreen->CreatePixmap) (pScreen, pCursor->bits->width, pCursor->bits->height, 1, 0); + if (!pPriv->sourceBits) + { -+ xfree ((pointer) pPriv); ++ free ((pointer) pPriv); + return (rfbDCCursorPtr)NULL; + } + pPriv->maskBits = (*pScreen->CreatePixmap) (pScreen, pCursor->bits->width, pCursor->bits->height, 1, 0); + if (!pPriv->maskBits) + { + (*pScreen->DestroyPixmap) (pPriv->sourceBits); -+ xfree ((pointer) pPriv); ++ free ((pointer) pPriv); + return (rfbDCCursorPtr)NULL; + } -+ dixSetPrivate(&pCursor->bits->devPrivates, pScreen, pPriv); ++ dixSetPrivate(&pCursor->bits->devPrivates, rfbScreenKey, pPriv); + + /* create the two sets of bits, clipping as appropriate */ + @@ -3834,7 +3959,7 @@ Index: xorg-server-1.6.3.901/Makefile.am + 0, 0, pCursor->bits->width, pCursor->bits->height, + 0, XYPixmap, (char *)pCursor->bits->source); + gcvals[0] = GXand; -+ ChangeGC (pGC, GCFunction, gcvals); ++ ChangeGCXIDs (NullClient, pGC, GCFunction, gcvals); + ValidateGC ((DrawablePtr)pPriv->sourceBits, pGC); + (*pGC->ops->PutImage) ((DrawablePtr)pPriv->sourceBits, pGC, 1, + 0, 0, pCursor->bits->width, pCursor->bits->height, @@ -3842,13 +3967,13 @@ Index: xorg-server-1.6.3.901/Makefile.am + + /* mask bits -- pCursor->mask & ~pCursor->source */ + gcvals[0] = GXcopy; -+ ChangeGC (pGC, GCFunction, gcvals); ++ ChangeGCXIDs (NullClient, pGC, GCFunction, gcvals); + ValidateGC ((DrawablePtr)pPriv->maskBits, pGC); + (*pGC->ops->PutImage) ((DrawablePtr)pPriv->maskBits, pGC, 1, + 0, 0, pCursor->bits->width, pCursor->bits->height, + 0, XYPixmap, (char *)pCursor->bits->mask); + gcvals[0] = GXandInverted; -+ ChangeGC (pGC, GCFunction, gcvals); ++ ChangeGCXIDs (NullClient, pGC, GCFunction, gcvals); + ValidateGC ((DrawablePtr)pPriv->maskBits, pGC); + (*pGC->ops->PutImage) ((DrawablePtr)pPriv->maskBits, pGC, 1, + 0, 0, pCursor->bits->width, pCursor->bits->height, @@ -3858,14 +3983,12 @@ Index: xorg-server-1.6.3.901/Makefile.am +} + +static Bool -+rfbDCUnrealizeCursor (pScreen, pCursor) -+ ScreenPtr pScreen; -+ CursorPtr pCursor; ++rfbDCUnrealizeCursor (ScreenPtr pScreen, CursorPtr pCursor) +{ + rfbDCCursorPtr pPriv; + + pPriv = (rfbDCCursorPtr)dixLookupPrivate(&pCursor->bits->devPrivates, -+ pScreen); ++ rfbScreenKey); + if (pPriv && (pCursor->bits->refcnt <= 1)) + { + if (pPriv->sourceBits) @@ -3876,8 +3999,8 @@ Index: xorg-server-1.6.3.901/Makefile.am + if (pPriv->pPicture) + FreePicture (pPriv->pPicture, 0); +#endif -+ xfree ((pointer) pPriv); -+ dixSetPrivate(&pCursor->bits->devPrivates, pScreen, NULL); ++ free ((pointer) pPriv); ++ dixSetPrivate(&pCursor->bits->devPrivates, rfbScreenKey, NULL); + } + return TRUE; +} @@ -3890,7 +4013,7 @@ Index: xorg-server-1.6.3.901/Makefile.am + if (sourceGC->fgPixel != source) + { + gcvals[0] = source; -+ DoChangeGC (sourceGC, GCForeground, gcvals, 0); ++ ChangeGCXIDs (NullClient, sourceGC, GCForeground, gcvals); + } + if (sourceGC->serialNumber != pDrawable->serialNumber) + ValidateGC (pDrawable, sourceGC); @@ -3898,7 +4021,7 @@ Index: xorg-server-1.6.3.901/Makefile.am + if (maskGC->fgPixel != mask) + { + gcvals[0] = mask; -+ DoChangeGC (maskGC, GCForeground, gcvals, 0); ++ ChangeGCXIDs (NullClient, maskGC, GCForeground, gcvals); + } + if (maskGC->serialNumber != pDrawable->serialNumber) + ValidateGC (pDrawable, maskGC); @@ -3918,25 +4041,20 @@ Index: xorg-server-1.6.3.901/Makefile.am + gcvals[1] = FALSE; + pGC = CreateGC((DrawablePtr)pWin, + GCSubwindowMode|GCGraphicsExposures, gcvals, &status, (XID)0, serverClient); -+ if (pGC && pWin->drawable.pScreen->DrawGuarantee) -+ (*pWin->drawable.pScreen->DrawGuarantee) (pWin, pGC, GuaranteeVisBack); + *ppGC = pGC; + return pGC; +} + +static Bool -+rfbDCPutUpCursor (pScreen, pCursor, x, y, source, mask) -+ ScreenPtr pScreen; -+ CursorPtr pCursor; -+ int x, y; -+ unsigned long source, mask; ++rfbDCPutUpCursor (ScreenPtr pScreen, CursorPtr pCursor, int x, int y, unsigned long source, ++ unsigned long mask) +{ + rfbDCScreenPtr pScreenPriv; + rfbDCCursorPtr pPriv; + WindowPtr pWin; + + pPriv = (rfbDCCursorPtr)dixLookupPrivate(&pCursor->bits->devPrivates, -+ pScreen); ++ rfbScreenKey); + if (!pPriv) + { + pPriv = rfbDCRealize(pScreen, pCursor); @@ -3945,7 +4063,7 @@ Index: xorg-server-1.6.3.901/Makefile.am + } + pScreenPriv = (rfbDCScreenPtr)dixLookupPrivate(&pScreen->devPrivates, + rfbDCScreenKey); -+ pWin = WindowTable[pScreen->myNum]; ++ pWin = pScreen->root; +#ifdef ARGB_CURSOR + if (pPriv->pPicture) + { @@ -3980,9 +4098,7 @@ Index: xorg-server-1.6.3.901/Makefile.am +} + +static Bool -+rfbDCSaveUnderCursor (pScreen, x, y, w, h) -+ ScreenPtr pScreen; -+ int x, y, w, h; ++rfbDCSaveUnderCursor (ScreenPtr pScreen, int x, int y, int w, int h) +{ + rfbDCScreenPtr pScreenPriv; + PixmapPtr pSave; @@ -3992,7 +4108,7 @@ Index: xorg-server-1.6.3.901/Makefile.am + pScreenPriv = (rfbDCScreenPtr)dixLookupPrivate(&pScreen->devPrivates, + rfbDCScreenKey); + pSave = pScreenPriv->pSave; -+ pWin = WindowTable[pScreen->myNum]; ++ pWin = pScreen->root; + if (!pSave || pSave->drawable.width < w || pSave->drawable.height < h) + { + if (pSave) @@ -4013,9 +4129,7 @@ Index: xorg-server-1.6.3.901/Makefile.am +} + +static Bool -+rfbDCRestoreUnderCursor (pScreen, x, y, w, h) -+ ScreenPtr pScreen; -+ int x, y, w, h; ++rfbDCRestoreUnderCursor (ScreenPtr pScreen, int x, int y, int w, int h) +{ + rfbDCScreenPtr pScreenPriv; + PixmapPtr pSave; @@ -4025,7 +4139,7 @@ Index: xorg-server-1.6.3.901/Makefile.am + pScreenPriv = (rfbDCScreenPtr)dixLookupPrivate(&pScreen->devPrivates, + rfbDCScreenKey); + pSave = pScreenPriv->pSave; -+ pWin = WindowTable[pScreen->myNum]; ++ pWin = pScreen->root; + if (!pSave) + return FALSE; + if (!EnsureGC(pScreenPriv->pRestoreGC, pWin)) @@ -4039,9 +4153,8 @@ Index: xorg-server-1.6.3.901/Makefile.am +} + +static Bool -+rfbDCChangeSave (pScreen, x, y, w, h, dx, dy) -+ ScreenPtr pScreen; -+ int x, y, w, h, dx, dy; ++rfbDCChangeSave (ScreenPtr pScreen, ++ int x, int y, int w, int h, int dx, int dy) +{ + rfbDCScreenPtr pScreenPriv; + PixmapPtr pSave; @@ -4052,7 +4165,7 @@ Index: xorg-server-1.6.3.901/Makefile.am + pScreenPriv = (rfbDCScreenPtr)dixLookupPrivate(&pScreen->devPrivates, + rfbDCScreenKey); + pSave = pScreenPriv->pSave; -+ pWin = WindowTable[pScreen->myNum]; ++ pWin = pScreen->root; + /* + * restore the bits which are about to get trashed + */ @@ -4172,11 +4285,9 @@ Index: xorg-server-1.6.3.901/Makefile.am +} + +static Bool -+rfbDCMoveCursor (pScreen, pCursor, x, y, w, h, dx, dy, source, mask) -+ ScreenPtr pScreen; -+ CursorPtr pCursor; -+ int x, y, w, h, dx, dy; -+ unsigned long source, mask; ++rfbDCMoveCursor (ScreenPtr pScreen, CursorPtr pCursor, ++ int x, int y, int w, int h, int dx, int dy, ++ unsigned long source, unsigned long mask) +{ + rfbDCCursorPtr pPriv; + rfbDCScreenPtr pScreenPriv; @@ -4187,7 +4298,7 @@ Index: xorg-server-1.6.3.901/Makefile.am + PixmapPtr pTemp; + + pPriv = (rfbDCCursorPtr)dixLookupPrivate(&pCursor->bits->devPrivates, -+ pScreen); ++ rfbScreenKey); + if (!pPriv) + { + pPriv = rfbDCRealize(pScreen, pCursor); @@ -4196,7 +4307,7 @@ Index: xorg-server-1.6.3.901/Makefile.am + } + pScreenPriv = (rfbDCScreenPtr)dixLookupPrivate(&pScreen->devPrivates, + rfbDCScreenKey); -+ pWin = WindowTable[pScreen->myNum]; ++ pWin = pScreen->root; + pTemp = pScreenPriv->pTemp; + if (!pTemp || + pTemp->drawable.width != pScreenPriv->pSave->drawable.width || @@ -4287,8 +4398,11 @@ Index: xorg-server-1.6.3.901/Makefile.am + 0, 0, w, h, x, y); + return TRUE; +} ---- xorg-server-1.7.99/hw/vnc/dpmsstubs.c -+++ xorg-server-1.7.99/hw/vnc/dpmsstubs.c +diff --git a/hw/vnc/dpmsstubs.c b/hw/vnc/dpmsstubs.c +new file mode 100644 +index 0000000..ae32324 +--- /dev/null ++++ b/hw/vnc/dpmsstubs.c @@ -0,0 +1,52 @@ +/* $Xorg: dpmsstubs.c,v 1.3 2000/08/17 19:47:56 cpqbld Exp $ */ +/***************************************************************** @@ -4342,9 +4456,12 @@ Index: xorg-server-1.6.3.901/Makefile.am +{ + return FALSE; +} ---- xorg-server-1.7.99/hw/vnc/draw.c -+++ xorg-server-1.7.99/hw/vnc/draw.c -@@ -0,0 +1,2021 @@ +diff --git a/hw/vnc/draw.c b/hw/vnc/draw.c +new file mode 100644 +index 0000000..5269c0f +--- /dev/null ++++ b/hw/vnc/draw.c +@@ -0,0 +1,1942 @@ +/* + * draw.c - drawing routines for the RFB X server. This is a set of + * wrappers around the standard MI/MFB/CFB drawing routines which work out @@ -4408,6 +4525,10 @@ Index: xorg-server-1.6.3.901/Makefile.am + +int rfbDeferUpdateTime = 40; /* ms */ + ++extern DevPrivateKeyRec rfbGCKeyRec; ++#define rfbGCKey (&rfbGCKeyRec) ++ ++ + +/****************************************************************************/ +/* @@ -4564,11 +4685,8 @@ Index: xorg-server-1.6.3.901/Makefile.am + + pScreen->CloseScreen = pVNC->CloseScreen; + pScreen->CreateGC = pVNC->CreateGC; -+ pScreen->PaintWindowBackground = pVNC->PaintWindowBackground; -+ pScreen->PaintWindowBorder = pVNC->PaintWindowBorder; + pScreen->CopyWindow = pVNC->CopyWindow; + pScreen->ClearToBackground = pVNC->ClearToBackground; -+ pScreen->RestoreAreas = pVNC->RestoreAreas; + pScreen->WakeupHandler = pVNC->WakeupHandler; + +#if XFREE86VNC @@ -4578,7 +4696,7 @@ Index: xorg-server-1.6.3.901/Makefile.am + pScreen->StoreColors = pVNC->StoreColors; + pScrn->EnableDisableFBAccess = pVNC->EnableDisableFBAccess; + -+ xfree(pVNC); ++ free(pVNC); +#endif + + TRC((stderr,"Unwrapped screen functions\n")); @@ -4599,7 +4717,7 @@ Index: xorg-server-1.6.3.901/Makefile.am + * control even when switched away. + */ + if (!enable) { -+ WindowPtr pWin = WindowTable[index]; ++ WindowPtr pWin = pScrn->pScreen->root; + ScreenPtr pScreen = pWin->drawable.pScreen; + GCPtr pGC; + xRectangle rect; @@ -4612,10 +4730,10 @@ Index: xorg-server-1.6.3.901/Makefile.am + if (!(pGC = GetScratchGC(pScreen->rootDepth, pScreen))) { + ErrorF("Couldn't blank screen"); + } else { -+ CARD32 attributes[2]; -+ attributes[0] = pScreen->whitePixel; -+ attributes[1] = pScreen->blackPixel; -+ (void)ChangeGC(pGC, GCForeground | GCBackground, attributes); ++ ChangeGCVal attributes[2]; ++ attributes[0].val = pScreen->whitePixel; ++ attributes[1].val = pScreen->blackPixel; ++ (void)ChangeGC(NullClient, pGC, GCForeground | GCBackground, attributes); + + ValidateGC((DrawablePtr)pWin, pGC); + @@ -4664,46 +4782,6 @@ Index: xorg-server-1.6.3.901/Makefile.am + return ret; +} + -+/* -+ * PaintWindowBackground - the region being modified is just the given region. -+ */ -+ -+void -+rfbPaintWindowBackground (WindowPtr pWin, RegionPtr pRegion, int what) -+{ -+ SCREEN_PROLOGUE(pWin->drawable.pScreen,PaintWindowBackground); -+ -+ TRC((stderr,"rfbPaintWindowBackground called\n")); -+ -+ ADD_TO_MODIFIED_REGION(pScreen,pRegion); -+ -+ (*pScreen->PaintWindowBackground) (pWin, pRegion, what); -+ -+ SCHEDULE_FB_UPDATE(pScreen, pVNC); -+ -+ SCREEN_EPILOGUE(PaintWindowBackground,rfbPaintWindowBackground); -+} -+ -+/* -+ * PaintWindowBorder - the region being modified is just the given region. -+ */ -+ -+void -+rfbPaintWindowBorder (WindowPtr pWin, RegionPtr pRegion, int what) -+{ -+ SCREEN_PROLOGUE(pWin->drawable.pScreen,PaintWindowBorder); -+ -+ TRC((stderr,"rfbPaintWindowBorder called\n")); -+ -+ ADD_TO_MODIFIED_REGION(pScreen,pRegion); -+ -+ (*pScreen->PaintWindowBorder) (pWin, pRegion, what); -+ -+ SCHEDULE_FB_UPDATE(pScreen, pVNC); -+ -+ SCREEN_EPILOGUE(PaintWindowBorder,rfbPaintWindowBorder); -+} -+ +#ifdef CHROMIUM +Bool +rfbRealizeWindow(WindowPtr pWin) @@ -4764,7 +4842,7 @@ Index: xorg-server-1.6.3.901/Makefile.am + prevWt->next = wt->next; + else + windowTable = wt->next; -+ xfree(wt); ++ free(wt); + } + else { + prevWt = wt; @@ -4935,31 +5013,6 @@ Index: xorg-server-1.6.3.901/Makefile.am + SCREEN_EPILOGUE(ClearToBackground,rfbClearToBackground); +} + -+/* -+ * RestoreAreas - just be safe here - the region being modified is the whole -+ * exposed region. -+ */ -+ -+RegionPtr -+rfbRestoreAreas (WindowPtr pWin, RegionPtr prgnExposed) -+{ -+ RegionPtr result; -+ SCREEN_PROLOGUE(pWin->drawable.pScreen,RestoreAreas); -+ -+ TRC((stderr,"rfbRestoreAreas called\n")); -+ -+ ADD_TO_MODIFIED_REGION(pScreen, prgnExposed); -+ -+ result = (*pScreen->RestoreAreas) (pWin, prgnExposed); -+ -+ SCHEDULE_FB_UPDATE(pScreen, pVNC); -+ -+ SCREEN_EPILOGUE(RestoreAreas,rfbRestoreAreas); -+ -+ return result; -+} -+ -+ + +/****************************************************************************/ +/* @@ -5022,9 +5075,7 @@ Index: xorg-server-1.6.3.901/Makefile.am + */ + +static void -+rfbChangeGC (pGC, mask) -+ GCPtr pGC; -+ unsigned long mask; ++rfbChangeGC (GCPtr pGC, unsigned long mask) +{ + GC_FUNC_PROLOGUE(pGC); + (*pGC->funcs->ChangeGC) (pGC, mask); @@ -5032,9 +5083,7 @@ Index: xorg-server-1.6.3.901/Makefile.am +} + +static void -+rfbCopyGC (pGCSrc, mask, pGCDst) -+ GCPtr pGCSrc, pGCDst; -+ unsigned long mask; ++rfbCopyGC (GCPtr pGCSrc, unsigned long mask, GCPtr pGCDst) +{ + GC_FUNC_PROLOGUE(pGCDst); + (*pGCDst->funcs->CopyGC) (pGCSrc, mask, pGCDst); @@ -5042,8 +5091,7 @@ Index: xorg-server-1.6.3.901/Makefile.am +} + +static void -+rfbDestroyGC (pGC) -+ GCPtr pGC; ++rfbDestroyGC (GCPtr pGC) +{ + GC_FUNC_PROLOGUE(pGC); + (*pGC->funcs->DestroyGC) (pGC); @@ -5051,11 +5099,7 @@ Index: xorg-server-1.6.3.901/Makefile.am +} + +static void -+rfbChangeClip (pGC, type, pvalue, nrects) -+ GCPtr pGC; -+ int type; -+ pointer pvalue; -+ int nrects; ++rfbChangeClip (GCPtr pGC, int type, pointer pvalue, int nrects) +{ + GC_FUNC_PROLOGUE(pGC); + (*pGC->funcs->ChangeClip) (pGC, type, pvalue, nrects); @@ -5063,8 +5107,7 @@ Index: xorg-server-1.6.3.901/Makefile.am +} + +static void -+rfbDestroyClip(pGC) -+ GCPtr pGC; ++rfbDestroyClip(GCPtr pGC) +{ + GC_FUNC_PROLOGUE(pGC); + (* pGC->funcs->DestroyClip)(pGC); @@ -5072,8 +5115,7 @@ Index: xorg-server-1.6.3.901/Makefile.am +} + +static void -+rfbCopyClip(pgcDst, pgcSrc) -+ GCPtr pgcDst, pgcSrc; ++rfbCopyClip(GCPtr pgcDst, GCPtr pgcSrc) +{ + GC_FUNC_PROLOGUE(pgcDst); + (* pgcDst->funcs->CopyClip)(pgcDst, pgcSrc); @@ -5112,13 +5154,12 @@ Index: xorg-server-1.6.3.901/Makefile.am + */ + +static void -+rfbFillSpans(pDrawable, pGC, nInit, pptInit, pwidthInit, fSorted) -+ DrawablePtr pDrawable; -+ GCPtr pGC; -+ int nInit; /* number of spans to fill */ -+ DDXPointPtr pptInit; /* pointer to list of start points */ -+ int *pwidthInit; /* pointer to list of n widths */ -+ int fSorted; ++rfbFillSpans(DrawablePtr pDrawable, ++ GCPtr pGC, ++ int nInit, /* number of spans to fill */ ++ DDXPointPtr pptInit, /* pointer to list of start points */ ++ int *pwidthInit, /* pointer to list of n widths */ ++ int fSorted ) +{ + GC_OP_PROLOGUE(pDrawable,pGC); + @@ -5397,9 +5438,9 @@ Index: xorg-server-1.6.3.901/Makefile.am + if (npt == 1) + { + nlines = 1; -+ rects = (xRectangle *)xalloc(sizeof(xRectangle)); ++ rects = (xRectangle *)malloc(sizeof(xRectangle)); + if (!rects) { -+ FatalError("rfbPolylines: xalloc failed\n"); ++ FatalError("rfbPolylines: malloc failed\n"); + } + + rects[0].x = ppts[0].x - lw + pDrawable->x; /* being safe here */ @@ -5410,9 +5451,9 @@ Index: xorg-server-1.6.3.901/Makefile.am + else + { + nlines = npt - 1; -+ rects = (xRectangle *)xalloc(nlines*sizeof(xRectangle)); ++ rects = (xRectangle *)malloc(nlines*sizeof(xRectangle)); + if (!rects) { -+ FatalError("rfbPolylines: xalloc failed\n"); ++ FatalError("rfbPolylines: malloc failed\n"); + } + + /* @@ -5467,7 +5508,7 @@ Index: xorg-server-1.6.3.901/Makefile.am + ADD_TO_MODIFIED_REGION(pDrawable->pScreen, tmpRegion); + + REGION_DESTROY(pDrawable->pScreen, tmpRegion); -+ xfree((char *)rects); ++ free((char *)rects); + } + + (*pGC->ops->Polylines) (pDrawable, pGC, mode, npt, ppts); @@ -5496,9 +5537,9 @@ Index: xorg-server-1.6.3.901/Makefile.am + TRC((stderr,"rfbPolySegment called\n")); + + if (nseg) { -+ rects = (xRectangle *)xalloc(nseg*sizeof(xRectangle)); ++ rects = (xRectangle *)malloc(nseg*sizeof(xRectangle)); + if (!rects) { -+ FatalError("rfbPolySegment: xalloc failed\n"); ++ FatalError("rfbPolySegment: malloc failed\n"); + } + + lw = pGC->lineWidth; @@ -5533,7 +5574,7 @@ Index: xorg-server-1.6.3.901/Makefile.am + ADD_TO_MODIFIED_REGION(pDrawable->pScreen, tmpRegion); + + REGION_DESTROY(pDrawable->pScreen, tmpRegion); -+ xfree((char *)rects); ++ free((char *)rects); + } + + (*pGC->ops->PolySegment) (pDrawable, pGC, nseg, segs); @@ -5561,9 +5602,9 @@ Index: xorg-server-1.6.3.901/Makefile.am + TRC((stderr,"rfbPolyRectangle called\n")); + + if (nrects) { -+ regRects = (xRectangle *)xalloc(nrects*4*sizeof(xRectangle)); ++ regRects = (xRectangle *)malloc(nrects*4*sizeof(xRectangle)); + if (!regRects) { -+ FatalError("rfbPolyRectangle: xalloc failed\n"); ++ FatalError("rfbPolyRectangle: malloc failed\n"); + } + + lw = pGC->lineWidth; @@ -5605,7 +5646,7 @@ Index: xorg-server-1.6.3.901/Makefile.am + ADD_TO_MODIFIED_REGION(pDrawable->pScreen, tmpRegion); + + REGION_DESTROY(pDrawable->pScreen, tmpRegion); -+ xfree((char *)regRects); ++ free((char *)regRects); + } + + (*pGC->ops->PolyRectangle) (pDrawable, pGC, nrects, rects); @@ -5633,9 +5674,9 @@ Index: xorg-server-1.6.3.901/Makefile.am + TRC((stderr,"rfbPolyArc called\n")); + + if (narcs) { -+ rects = (xRectangle *)xalloc(narcs*sizeof(xRectangle)); ++ rects = (xRectangle *)malloc(narcs*sizeof(xRectangle)); + if (!rects) { -+ FatalError("rfbPolyArc: xalloc failed\n"); ++ FatalError("rfbPolyArc: malloc failed\n"); + } + + lw = pGC->lineWidth; @@ -5659,7 +5700,7 @@ Index: xorg-server-1.6.3.901/Makefile.am + ADD_TO_MODIFIED_REGION(pDrawable->pScreen, tmpRegion); + + REGION_DESTROY(pDrawable->pScreen, tmpRegion); -+ xfree((char *)rects); ++ free((char *)rects); + } + + (*pGC->ops->PolyArc) (pDrawable, pGC, narcs, arcs); @@ -5751,9 +5792,9 @@ Index: xorg-server-1.6.3.901/Makefile.am + TRC((stderr,"rfbPolyFillRect called\n")); + + if (nrects) { -+ regRects = (xRectangle *)xalloc(nrects*sizeof(xRectangle)); ++ regRects = (xRectangle *)malloc(nrects*sizeof(xRectangle)); + if (!regRects) { -+ FatalError("rfbPolyFillRect: xalloc failed\n"); ++ FatalError("rfbPolyFillRect: malloc failed\n"); + } + + for (i = 0; i < nrects; i++) { @@ -5771,7 +5812,7 @@ Index: xorg-server-1.6.3.901/Makefile.am + ADD_TO_MODIFIED_REGION(pDrawable->pScreen, tmpRegion); + + REGION_DESTROY(pDrawable->pScreen, tmpRegion); -+ xfree((char *)regRects); ++ free((char *)regRects); + } + + (*pGC->ops->PolyFillRect) (pDrawable, pGC, nrects, rects); @@ -5799,9 +5840,9 @@ Index: xorg-server-1.6.3.901/Makefile.am + TRC((stderr,"rfbPolyFillArc called\n")); + + if (narcs) { -+ rects = (xRectangle *)xalloc(narcs*sizeof(xRectangle)); ++ rects = (xRectangle *)malloc(narcs*sizeof(xRectangle)); + if (!rects) { -+ FatalError("rfbPolyFillArc: xalloc failed\n"); ++ FatalError("rfbPolyFillArc: malloc failed\n"); + } + + lw = pGC->lineWidth; @@ -5825,7 +5866,7 @@ Index: xorg-server-1.6.3.901/Makefile.am + ADD_TO_MODIFIED_REGION(pDrawable->pScreen, tmpRegion); + + REGION_DESTROY(pDrawable->pScreen, tmpRegion); -+ xfree((char *)rects); ++ free((char *)rects); + } + + (*pGC->ops->PolyFillArc) (pDrawable, pGC, narcs, arcs); @@ -6197,12 +6238,9 @@ Index: xorg-server-1.6.3.901/Makefile.am + */ + +static void -+rfbCopyRegion(pScreen, cl, src, dst, dx, dy) -+ ScreenPtr pScreen; -+ rfbClientPtr cl; -+ RegionPtr src; -+ RegionPtr dst; -+ int dx, dy; ++rfbCopyRegion(ScreenPtr pScreen, rfbClientPtr cl, ++ RegionPtr src, RegionPtr dst, ++ int dx, int dy) +{ + RegionRec tmp; + @@ -6366,9 +6404,12 @@ Index: xorg-server-1.6.3.901/Makefile.am + VNCSCREENPTR(pScreen); + SCHEDULE_FB_UPDATE(pScreen, pVNC); +} ---- xorg-server-1.7.99/hw/vnc/hextile.c -+++ xorg-server-1.7.99/hw/vnc/hextile.c -@@ -0,0 +1,350 @@ +diff --git a/hw/vnc/hextile.c b/hw/vnc/hextile.c +new file mode 100644 +index 0000000..9e92c42 +--- /dev/null ++++ b/hw/vnc/hextile.c +@@ -0,0 +1,341 @@ +/* + * hextile.c + * @@ -6412,9 +6453,7 @@ Index: xorg-server-1.6.3.901/Makefile.am + */ + +Bool -+rfbSendRectEncodingHextile(cl, x, y, w, h) -+ rfbClientPtr cl; -+ int x, y, w, h; ++rfbSendRectEncodingHextile(rfbClientPtr cl, int x, int y, int w, int h) +{ + VNCSCREENPTR(cl->pScreen); + rfbFramebufferUpdateRectHeader rect; @@ -6477,9 +6516,7 @@ Index: xorg-server-1.6.3.901/Makefile.am + */ \ + \ +static Bool \ -+sendHextiles##bpp(cl, rx, ry, rw, rh) \ -+ rfbClientPtr cl; \ -+ int rx, ry, rw, rh; \ ++sendHextiles##bpp(rfbClientPtr cl, int rx, int ry, int rw, int rh) \ +{ \ + VNCSCREENPTR(cl->pScreen); \ + int x, y, w, h; \ @@ -6670,13 +6707,8 @@ Index: xorg-server-1.6.3.901/Makefile.am + */ \ + \ +static void \ -+testColours##bpp(data,size,mono,solid,bg,fg) \ -+ CARD##bpp *data; \ -+ int size; \ -+ Bool *mono; \ -+ Bool *solid; \ -+ CARD##bpp *bg; \ -+ CARD##bpp *fg; \ ++testColours##bpp(CARD##bpp *data, int size, Bool *mono, Bool *solid, \ ++ CARD##bpp *bg, CARD##bpp *fg) \ +{ \ + CARD##bpp colour1 = 0, colour2 = 0; \ + int n1 = 0, n2 = 0; \ @@ -6719,8 +6751,11 @@ Index: xorg-server-1.6.3.901/Makefile.am +DEFINE_SEND_HEXTILES(8) +DEFINE_SEND_HEXTILES(16) +DEFINE_SEND_HEXTILES(32) ---- xorg-server-1.7.99/hw/vnc/httpd.c -+++ xorg-server-1.7.99/hw/vnc/httpd.c +diff --git a/hw/vnc/httpd.c b/hw/vnc/httpd.c +new file mode 100644 +index 0000000..5f56ad6 +--- /dev/null ++++ b/hw/vnc/httpd.c @@ -0,0 +1,519 @@ +/* + * httpd.c - a simple HTTP server @@ -7241,9 +7276,12 @@ Index: xorg-server-1.6.3.901/Makefile.am + return TRUE; +} + ---- xorg-server-1.7.99/hw/vnc/init.c -+++ xorg-server-1.7.99/hw/vnc/init.c -@@ -0,0 +1,1078 @@ +diff --git a/hw/vnc/init.c b/hw/vnc/init.c +new file mode 100644 +index 0000000..0977fee +--- /dev/null ++++ b/hw/vnc/init.c +@@ -0,0 +1,1054 @@ +/* + * init.c + * @@ -7336,6 +7374,8 @@ Index: xorg-server-1.6.3.901/Makefile.am +#include "dix.h" +#include "micmap.h" +#include "rfb.h" ++#include "xserver-properties.h" ++#include "exevents.h" + +#ifdef CORBA +#include @@ -7384,7 +7424,7 @@ Index: xorg-server-1.6.3.901/Makefile.am + + +static void -+PointerWarpCursor(ScreenPtr pScreen, int x, int y) ++PointerWarpCursor(DeviceIntPtr pDev, ScreenPtr pScreen, int x, int y) +{ +#if 0 + DeviceIntPtr pDev = NULL; @@ -7419,10 +7459,7 @@ Index: xorg-server-1.6.3.901/Makefile.am + */ + +int -+ddxProcessArgument (argc, argv, i) -+ int argc; -+ char *argv[]; -+ int i; ++ddxProcessArgument (int argc, char *argv[], int i) +{ + VNCSCREENPTR(screenInfo.screens[i]); + static Bool firstTime = TRUE; @@ -7702,10 +7739,7 @@ Index: xorg-server-1.6.3.901/Makefile.am +#endif + +void -+InitOutput(screenInfo, argc, argv) -+ ScreenInfo *screenInfo; -+ int argc; -+ char **argv; ++InitOutput(ScreenInfo *screenInfo, int argc, char **argv) +{ + int i; + initOutputCalled = TRUE; @@ -7798,11 +7832,7 @@ Index: xorg-server-1.6.3.901/Makefile.am +} + +static Bool -+rfbScreenInit(index, pScreen, argc, argv) -+ int index; -+ ScreenPtr pScreen; -+ int argc; -+ char ** argv; ++rfbScreenInit(int index, ScreenPtr pScreen, int argc, char ** argv) +{ + rfbScreenInfoPtr prfb = &rfbScreen; + int dpix = 75, dpiy = 75; @@ -7915,11 +7945,8 @@ Index: xorg-server-1.6.3.901/Makefile.am + prfb->CloseScreen = pScreen->CloseScreen; + prfb->WakeupHandler = pScreen->WakeupHandler; + prfb->CreateGC = pScreen->CreateGC; -+ prfb->PaintWindowBackground = pScreen->PaintWindowBackground; -+ prfb->PaintWindowBorder = pScreen->PaintWindowBorder; + prfb->CopyWindow = pScreen->CopyWindow; + prfb->ClearToBackground = pScreen->ClearToBackground; -+ prfb->RestoreAreas = pScreen->RestoreAreas; +#ifdef CHROMIUM + prfb->RealizeWindow = pScreen->RealizeWindow; + prfb->UnrealizeWindow = pScreen->UnrealizeWindow; @@ -7936,11 +7963,8 @@ Index: xorg-server-1.6.3.901/Makefile.am + pScreen->CloseScreen = rfbCloseScreen; + pScreen->WakeupHandler = rfbWakeupHandler; + pScreen->CreateGC = rfbCreateGC; -+ pScreen->PaintWindowBackground = rfbPaintWindowBackground; -+ pScreen->PaintWindowBorder = rfbPaintWindowBorder; + pScreen->CopyWindow = rfbCopyWindow; + pScreen->ClearToBackground = rfbClearToBackground; -+ pScreen->RestoreAreas = rfbRestoreAreas; +#ifdef CHROMIUM + pScreen->RealizeWindow = rfbRealizeWindow; + pScreen->UnrealizeWindow = rfbUnrealizeWindow; @@ -8016,15 +8040,11 @@ Index: xorg-server-1.6.3.901/Makefile.am + * InitOutput so we can assume that rfbInitSockets has already been called. + */ +void -+InitInput(argc, argv) -+ int argc; -+ char *argv[]; ++InitInput(int argc, char *argv[]) +{ + DeviceIntPtr p, k; -+ k = AddInputDevice(rfbKeybdProc, TRUE); -+ p = AddInputDevice(rfbMouseProc, TRUE); -+ RegisterKeyboardDevice(k); -+ RegisterPointerDevice(p); ++ k = AddInputDevice(serverClient, rfbKeybdProc, TRUE); ++ p = AddInputDevice(serverClient, rfbMouseProc, TRUE); + + mieqInit(); + @@ -8037,9 +8057,7 @@ Index: xorg-server-1.6.3.901/Makefile.am + + +static int -+rfbKeybdProc(pDevice, onoff) -+ DeviceIntPtr pDevice; -+ int onoff; ++rfbKeybdProc(DeviceIntPtr pDevice, int onoff) +{ + KeySymsRec keySyms; + CARD8 modMap[MAP_LENGTH]; @@ -8050,7 +8068,7 @@ Index: xorg-server-1.6.3.901/Makefile.am + case DEVICE_INIT: + vncSetKeyboardDevice(pDevice); + KbdDeviceInit(pDevice, &keySyms, modMap); -+ InitKeyboardDeviceStruct(pDev, &keySyms, modMap, ++ InitKeyboardDeviceStruct(pDevice, NULL, + (BellProcPtr)rfbSendBell, + (KbdCtrlProcPtr)NoopDDA); + break; @@ -8072,11 +8090,11 @@ Index: xorg-server-1.6.3.901/Makefile.am +} + +static int -+rfbMouseProc(pDevice, onoff) -+ DeviceIntPtr pDevice; -+ int onoff; ++rfbMouseProc(DeviceIntPtr pDevice, int onoff) +{ + BYTE map[6]; ++ Atom btn_labels[5] = {0}; ++ Atom axes_labels[2] = {0}; + DevicePtr pDev = (DevicePtr)pDevice; + + switch (onoff) @@ -8088,10 +8106,16 @@ Index: xorg-server-1.6.3.901/Makefile.am + map[3] = 3; + map[4] = 4; + map[5] = 5; -+ InitPointerDeviceStruct(pDev, map, 5, -+ GetMotionHistory, ++ btn_labels[0] = XIGetKnownProperty(BTN_LABEL_PROP_BTN_LEFT); ++ btn_labels[1] = XIGetKnownProperty(BTN_LABEL_PROP_BTN_MIDDLE); ++ btn_labels[2] = XIGetKnownProperty(BTN_LABEL_PROP_BTN_RIGHT); ++ ++ axes_labels[0] = XIGetKnownProperty(AXIS_LABEL_PROP_REL_X); ++ axes_labels[1] = XIGetKnownProperty(AXIS_LABEL_PROP_REL_Y); ++ ++ InitPointerDeviceStruct(pDev, map, 5, btn_labels, + PtrDeviceControl, -+ GetMaximumEventsNum(), 2 /* numAxes */); ++ GetMaximumEventsNum(), 2 /* numAxes */, axes_labels); + vncSetPointerDevice(pDevice); + break; + @@ -8172,38 +8196,33 @@ Index: xorg-server-1.6.3.901/Makefile.am + + +static unsigned char * -+rfbAllocateFramebufferMemory(prfb) -+ rfbScreenInfoPtr prfb; ++rfbAllocateFramebufferMemory(rfbScreenInfoPtr prfb) +{ + if (prfb->pfbMemory) return prfb->pfbMemory; /* already done */ + + prfb->sizeInBytes = (prfb->paddedWidthInBytes * prfb->height); + -+ prfb->pfbMemory = (unsigned char *)Xalloc(prfb->sizeInBytes); ++ prfb->pfbMemory = (unsigned char *)malloc(prfb->sizeInBytes); + + return prfb->pfbMemory; +} + + +static Bool -+rfbCursorOffScreen (ppScreen, x, y) -+ ScreenPtr *ppScreen; -+ int *x, *y; ++rfbCursorOffScreen (ScreenPtr *ppScreen, int *x, int *y) +{ + return FALSE; +} + +static void -+rfbCrossScreen (pScreen, entering) -+ ScreenPtr pScreen; -+ Bool entering; ++rfbCrossScreen (ScreenPtr pScreen, Bool entering) +{ +} + +void -+ddxGiveUp() ++ddxGiveUp(void) +{ -+ Xfree(rfbScreen.pfbMemory); ++ free(rfbScreen.pfbMemory); + if (initOutputCalled) { + char unixSocketName[32]; + sprintf(unixSocketName,"/tmp/.X11-unix/X%s",display); @@ -8215,34 +8234,28 @@ Index: xorg-server-1.6.3.901/Makefile.am +} + +void -+AbortDDX() ++AbortDDX(void) +{ + ddxGiveUp(); +} + +void -+OsVendorInit() ++CloseInput(void) +{ +} + +void -+OsVendorFatalError() ++OsVendorInit(void) +{ +} + -+#ifdef DDXTIME /* from ServerOSDefines */ -+CARD32 -+GetTimeInMillis() -+{ -+ struct timeval tp; -+ -+ X_GETTIMEOFDAY(&tp); -+ return(tp.tv_sec * 1000) + (tp.tv_usec / 1000); -+} -+#endif -+ +void -+ddxUseMsg() ++OsVendorFatalError(void) ++{ ++} ++ ++void ++ddxUseMsg(void) +{ + ErrorF("-geometry WxH set framebuffer width & height\n"); + ErrorF("-depth D set framebuffer depth\n"); @@ -8277,14 +8290,15 @@ Index: xorg-server-1.6.3.901/Makefile.am + exit(1); +} + -+ ++#if 0 +void ddxInitGlobals(void) +{ + /* dummy function called by InitGlobals in os/utils.c */ +} ++#endif + +int -+NewInputDeviceRequest(InputOption *options, DeviceIntPtr *pdev) ++NewInputDeviceRequest(InputOption *options, InputAttributes *attrs, DeviceIntPtr *pdev) +{ + return BadValue; +} @@ -8309,7 +8323,7 @@ Index: xorg-server-1.6.3.901/Makefile.am + + time(&clock); + strftime(buf, 255, "%d/%m/%Y %H:%M:%S ", localtime(&clock)); -+ fprintf(stderr, buf); ++ fprintf(stderr, "%s\n", buf); + + vfprintf(stderr, format, args); + fflush(stderr); @@ -8322,9 +8336,12 @@ Index: xorg-server-1.6.3.901/Makefile.am + rfbLog(""); + perror(str); +} ---- xorg-server-1.7.99/hw/vnc/kbdptr.c -+++ xorg-server-1.7.99/hw/vnc/kbdptr.c -@@ -0,0 +1,458 @@ +diff --git a/hw/vnc/kbdptr.c b/hw/vnc/kbdptr.c +new file mode 100644 +index 0000000..f306022 +--- /dev/null ++++ b/hw/vnc/kbdptr.c +@@ -0,0 +1,616 @@ +/* + * kbdptr.c - deal with keyboard and pointer device over TCP & UDP. + * @@ -8360,17 +8377,170 @@ Index: xorg-server-1.6.3.901/Makefile.am +#define NEED_EVENTS +#include "X11/Xproto.h" +#include "inputstr.h" ++#include "inpututils.h" +#define XK_CYRILLIC +#include +#include +#include "mi.h" +#include "mipointer.h" +#include "keyboard.h" ++#include "xkbsrv.h" + +#ifdef DMXVNC +#include "dmxinput.h" +#endif + ++#if !XFREE86VNC ++ ++#define MIN_KEY_CODE 8 ++#define MAX_KEY_CODE 255 ++#define NO_OF_KEYS (MAX_KEY_CODE - MIN_KEY_CODE + 1) ++#define GLYPHS_PER_KEY 4 ++ ++#define CONTROL_L_KEY_CODE (MIN_KEY_CODE + 29) ++#define CONTROL_R_KEY_CODE (MIN_KEY_CODE + 101) ++#define SHIFT_L_KEY_CODE (MIN_KEY_CODE + 42) ++#define SHIFT_R_KEY_CODE (MIN_KEY_CODE + 54) ++#define META_L_KEY_CODE (MIN_KEY_CODE + 107) ++#define META_R_KEY_CODE (MIN_KEY_CODE + 108) ++#define ALT_L_KEY_CODE (MIN_KEY_CODE + 56) ++#define ALT_R_KEY_CODE (MIN_KEY_CODE + 105) ++ ++static KeySym map[MAX_KEY_CODE * GLYPHS_PER_KEY] = { ++ /* 0x00 */ NoSymbol, NoSymbol, NoSymbol, NoSymbol, ++ /* 0x01 */ XK_Escape, NoSymbol, NoSymbol, NoSymbol, ++ /* 0x02 */ XK_1, XK_exclam, NoSymbol, NoSymbol, ++ /* 0x03 */ XK_2, XK_at, NoSymbol, NoSymbol, ++ /* 0x04 */ XK_3, XK_numbersign, NoSymbol, NoSymbol, ++ /* 0x05 */ XK_4, XK_dollar, NoSymbol, NoSymbol, ++ /* 0x06 */ XK_5, XK_percent, NoSymbol, NoSymbol, ++ /* 0x07 */ XK_6, XK_asciicircum, NoSymbol, NoSymbol, ++ /* 0x08 */ XK_7, XK_ampersand, NoSymbol, NoSymbol, ++ /* 0x09 */ XK_8, XK_asterisk, NoSymbol, NoSymbol, ++ /* 0x0a */ XK_9, XK_parenleft, NoSymbol, NoSymbol, ++ /* 0x0b */ XK_0, XK_parenright, NoSymbol, NoSymbol, ++ /* 0x0c */ XK_minus, XK_underscore, NoSymbol, NoSymbol, ++ /* 0x0d */ XK_equal, XK_plus, NoSymbol, NoSymbol, ++ /* 0x0e */ XK_BackSpace, NoSymbol, NoSymbol, NoSymbol, ++ /* 0x0f */ XK_Tab, XK_ISO_Left_Tab,NoSymbol, NoSymbol, ++ /* 0x10 */ XK_q, XK_Q, NoSymbol, NoSymbol, ++ /* 0x11 */ XK_w, XK_W, NoSymbol, NoSymbol, ++ /* 0x12 */ XK_e, XK_E, NoSymbol, NoSymbol, ++ /* 0x13 */ XK_r, XK_R, NoSymbol, NoSymbol, ++ /* 0x14 */ XK_t, XK_T, NoSymbol, NoSymbol, ++ /* 0x15 */ XK_y, XK_Y, NoSymbol, NoSymbol, ++ /* 0x16 */ XK_u, XK_U, NoSymbol, NoSymbol, ++ /* 0x17 */ XK_i, XK_I, NoSymbol, NoSymbol, ++ /* 0x18 */ XK_o, XK_O, NoSymbol, NoSymbol, ++ /* 0x19 */ XK_p, XK_P, NoSymbol, NoSymbol, ++ /* 0x1a */ XK_bracketleft, XK_braceleft, NoSymbol, NoSymbol, ++ /* 0x1b */ XK_bracketright,XK_braceright, NoSymbol, NoSymbol, ++ /* 0x1c */ XK_Return, NoSymbol, NoSymbol, NoSymbol, ++ /* 0x1d */ XK_Control_L, NoSymbol, NoSymbol, NoSymbol, ++ /* 0x1e */ XK_a, XK_A, NoSymbol, NoSymbol, ++ /* 0x1f */ XK_s, XK_S, NoSymbol, NoSymbol, ++ /* 0x20 */ XK_d, XK_D, NoSymbol, NoSymbol, ++ /* 0x21 */ XK_f, XK_F, NoSymbol, NoSymbol, ++ /* 0x22 */ XK_g, XK_G, NoSymbol, NoSymbol, ++ /* 0x23 */ XK_h, XK_H, NoSymbol, NoSymbol, ++ /* 0x24 */ XK_j, XK_J, NoSymbol, NoSymbol, ++ /* 0x25 */ XK_k, XK_K, NoSymbol, NoSymbol, ++ /* 0x26 */ XK_l, XK_L, NoSymbol, NoSymbol, ++ /* 0x27 */ XK_semicolon, XK_colon, NoSymbol, NoSymbol, ++ /* 0x28 */ XK_quoteright, XK_quotedbl, NoSymbol, NoSymbol, ++ /* 0x29 */ XK_quoteleft, XK_asciitilde, NoSymbol, NoSymbol, ++ /* 0x2a */ XK_Shift_L, NoSymbol, NoSymbol, NoSymbol, ++ /* 0x2b */ XK_backslash, XK_bar, NoSymbol, NoSymbol, ++ /* 0x2c */ XK_z, XK_Z, NoSymbol, NoSymbol, ++ /* 0x2d */ XK_x, XK_X, NoSymbol, NoSymbol, ++ /* 0x2e */ XK_c, XK_C, NoSymbol, NoSymbol, ++ /* 0x2f */ XK_v, XK_V, NoSymbol, NoSymbol, ++ /* 0x30 */ XK_b, XK_B, NoSymbol, NoSymbol, ++ /* 0x31 */ XK_n, XK_N, NoSymbol, NoSymbol, ++ /* 0x32 */ XK_m, XK_M, NoSymbol, NoSymbol, ++ /* 0x33 */ XK_comma, XK_less, NoSymbol, NoSymbol, ++ /* 0x34 */ XK_period, XK_greater, NoSymbol, NoSymbol, ++ /* 0x35 */ XK_slash, XK_question, NoSymbol, NoSymbol, ++ /* 0x36 */ XK_Shift_R, NoSymbol, NoSymbol, NoSymbol, ++ /* 0x37 */ XK_KP_Multiply, NoSymbol, NoSymbol, NoSymbol, ++ /* 0x38 */ XK_Alt_L, XK_Meta_L, NoSymbol, NoSymbol, ++ /* 0x39 */ XK_space, NoSymbol, NoSymbol, NoSymbol, ++ /* 0x3a */ XK_Caps_Lock, NoSymbol, NoSymbol, NoSymbol, ++ /* 0x3b */ XK_F1, NoSymbol, NoSymbol, NoSymbol, ++ /* 0x3c */ XK_F2, NoSymbol, NoSymbol, NoSymbol, ++ /* 0x3d */ XK_F3, NoSymbol, NoSymbol, NoSymbol, ++ /* 0x3e */ XK_F4, NoSymbol, NoSymbol, NoSymbol, ++ /* 0x3f */ XK_F5, NoSymbol, NoSymbol, NoSymbol, ++ /* 0x40 */ XK_F6, NoSymbol, NoSymbol, NoSymbol, ++ /* 0x41 */ XK_F7, NoSymbol, NoSymbol, NoSymbol, ++ /* 0x42 */ XK_F8, NoSymbol, NoSymbol, NoSymbol, ++ /* 0x43 */ XK_F9, NoSymbol, NoSymbol, NoSymbol, ++ /* 0x44 */ XK_F10, NoSymbol, NoSymbol, NoSymbol, ++ /* 0x45 */ XK_Num_Lock, NoSymbol, NoSymbol, NoSymbol, ++ /* 0x46 */ XK_Scroll_Lock, NoSymbol, NoSymbol, NoSymbol, ++ /* 0x47 */ XK_KP_Home, XK_KP_7, NoSymbol, NoSymbol, ++ /* 0x48 */ XK_KP_Up, XK_KP_8, NoSymbol, NoSymbol, ++ /* 0x49 */ XK_KP_Prior, XK_KP_9, NoSymbol, NoSymbol, ++ /* 0x4a */ XK_KP_Subtract, NoSymbol, NoSymbol, NoSymbol, ++ /* 0x4b */ XK_KP_Left, XK_KP_4, NoSymbol, NoSymbol, ++ /* 0x4c */ XK_KP_Begin, XK_KP_5, NoSymbol, NoSymbol, ++ /* 0x4d */ XK_KP_Right, XK_KP_6, NoSymbol, NoSymbol, ++ /* 0x4e */ XK_KP_Add, NoSymbol, NoSymbol, NoSymbol, ++ /* 0x4f */ XK_KP_End, XK_KP_1, NoSymbol, NoSymbol, ++ /* 0x50 */ XK_KP_Down, XK_KP_2, NoSymbol, NoSymbol, ++ /* 0x51 */ XK_KP_Next, XK_KP_3, NoSymbol, NoSymbol, ++ /* 0x52 */ XK_KP_Insert, XK_KP_0, NoSymbol, NoSymbol, ++ /* 0x53 */ XK_KP_Delete, XK_KP_Decimal, NoSymbol, NoSymbol, ++ /* 0x54 */ XK_Sys_Req, NoSymbol, NoSymbol, NoSymbol, ++ /* 0x55 */ NoSymbol, NoSymbol, NoSymbol, NoSymbol, ++ /* 0x56 */ XK_less, XK_greater, NoSymbol, NoSymbol, ++ /* 0x57 */ XK_F11, NoSymbol, NoSymbol, NoSymbol, ++ /* 0x58 */ XK_F12, NoSymbol, NoSymbol, NoSymbol, ++ /* 0x59 */ XK_Home, NoSymbol, NoSymbol, NoSymbol, ++ /* 0x5a */ XK_Up, NoSymbol, NoSymbol, NoSymbol, ++ /* 0x5b */ XK_Prior, NoSymbol, NoSymbol, NoSymbol, ++ /* 0x5c */ XK_Left, NoSymbol, NoSymbol, NoSymbol, ++ /* 0x5d */ XK_Begin, NoSymbol, NoSymbol, NoSymbol, ++ /* 0x5e */ XK_Right, NoSymbol, NoSymbol, NoSymbol, ++ /* 0x5f */ XK_End, NoSymbol, NoSymbol, NoSymbol, ++ /* 0x60 */ XK_Down, NoSymbol, NoSymbol, NoSymbol, ++ /* 0x61 */ XK_Next, NoSymbol, NoSymbol, NoSymbol, ++ /* 0x62 */ XK_Insert, NoSymbol, NoSymbol, NoSymbol, ++ /* 0x63 */ XK_Delete, NoSymbol, NoSymbol, NoSymbol, ++ /* 0x64 */ XK_KP_Enter, NoSymbol, NoSymbol, NoSymbol, ++ /* 0x65 */ XK_Control_R, NoSymbol, NoSymbol, NoSymbol, ++ /* 0x66 */ XK_Pause, NoSymbol, NoSymbol, NoSymbol, ++ /* 0x67 */ XK_Print, NoSymbol, NoSymbol, NoSymbol, ++ /* 0x68 */ XK_KP_Divide, NoSymbol, NoSymbol, NoSymbol, ++ /* 0x69 */ XK_Alt_R, XK_Meta_R, NoSymbol, NoSymbol, ++ /* 0x6a */ XK_Break, NoSymbol, NoSymbol, NoSymbol, ++ /* 0x6b */ XK_Meta_L, NoSymbol, NoSymbol, NoSymbol, ++ /* 0x6c */ XK_Meta_R, NoSymbol, NoSymbol, NoSymbol, ++ /* 0x6d */ XK_Menu, NoSymbol, NoSymbol, NoSymbol, ++ /* 0x6e */ XK_F13, NoSymbol, NoSymbol, NoSymbol, ++ /* 0x6f */ XK_F14, NoSymbol, NoSymbol, NoSymbol, ++ /* 0x70 */ XK_F15, NoSymbol, NoSymbol, NoSymbol, ++ /* 0x71 */ XK_F16, NoSymbol, NoSymbol, NoSymbol, ++ /* 0x72 */ XK_F17, NoSymbol, NoSymbol, NoSymbol, ++ /* 0x73 */ XK_backslash, XK_underscore, NoSymbol, NoSymbol, ++ /* 0x74 */ NoSymbol, NoSymbol, NoSymbol, NoSymbol, ++ /* 0x75 */ NoSymbol, NoSymbol, NoSymbol, NoSymbol, ++ /* 0x76 */ NoSymbol, NoSymbol, NoSymbol, NoSymbol, ++ /* 0x77 */ NoSymbol, NoSymbol, NoSymbol, NoSymbol, ++ /* 0x78 */ NoSymbol, NoSymbol, NoSymbol, NoSymbol, ++ /* 0x79 */ XK_Henkan, XK_Mode_switch, NoSymbol, NoSymbol, ++ /* 0x7a */ NoSymbol, NoSymbol, NoSymbol, NoSymbol, ++ /* 0x7b */ XK_Muhenkan, NoSymbol, NoSymbol, NoSymbol, ++ /* 0x7c */ NoSymbol, NoSymbol, NoSymbol, NoSymbol, ++ /* 0x7d */ XK_backslash, XK_bar, NoSymbol, NoSymbol, ++ /* 0x7e */ NoSymbol, NoSymbol, NoSymbol, NoSymbol, ++ /* 0x7f */ NoSymbol, NoSymbol, NoSymbol, NoSymbol, ++}; ++ ++#define N_PREDEFINED_KEYS (sizeof(map) / (sizeof(KeySym) * GLYPHS_PER_KEY)) ++ ++#endif ++ +#define KEY_IS_PRESSED(keycode) \ + (kbdDevice->key->down[(keycode) >> 3] & (1 << ((keycode) & 7))) + @@ -8396,24 +8566,26 @@ Index: xorg-server-1.6.3.901/Makefile.am + ptrDevice = ptr; +} + -+ +#ifndef DMXVNC +static void +EnqueueMotion(DeviceIntPtr ptrDev, int x, int y) +{ -+ xEvent *events = (xEvent*) calloc(sizeof(xEvent), GetMaximumEventsNum()); + int detail = 0, valuators[2], nevents, i; ++ EventListPtr events; ++ ValuatorMask mask; + valuators[0] = x; + valuators[1] = y; ++ GetEventList(&events); ++ + if (!ptrDev) { + ErrorF("VNC: In EnqueueMotion() ptrDev=NULL\n"); + return; + } ++ valuator_mask_set_range(&mask,0, 2, valuators); + nevents = GetPointerEvents(events, ptrDev, MotionNotify, detail, -+ POINTER_ABSOLUTE, 0, 2, valuators); ++ POINTER_ABSOLUTE, &mask); + for (i = 0; i < nevents; i++) -+ mieqEnqueue(ptrDev, events + i); -+ free(events); ++ mieqEnqueue(ptrDev, (InternalEvent*)(events + i)->event); +} +#endif + @@ -8421,36 +8593,37 @@ Index: xorg-server-1.6.3.901/Makefile.am +static void +EnqueueButton(DeviceIntPtr ptrDev, int type, int detail) +{ -+ xEvent *events = (xEvent*) calloc(sizeof(xEvent), GetMaximumEventsNum()); + int nevents, i; ++ EventListPtr events; ++ GetEventList(&events); ++ + if (!ptrDev) { + ErrorF("VNC: In EnqueueButton() ptrDev=NULL\n"); + return; + } + nevents = GetPointerEvents(events, ptrDev, type, detail, -+ POINTER_ABSOLUTE, 0, 0, NULL/*valuators*/); ++ POINTER_ABSOLUTE, NULL/*valuators*/); + for (i = 0; i < nevents; i++) -+ mieqEnqueue(ptrDev, events + i); -+ free(events); ++ mieqEnqueue(ptrDev, (InternalEvent*)(events + i)->event); +} + + +static void +EnqueueKey(DeviceIntPtr kbdDev, int type, int detail) +{ -+ xEvent *events = (xEvent*) calloc(sizeof(xEvent), GetMaximumEventsNum()); + int nevents, i; ++ EventListPtr events; ++ GetEventList(&events); ++ + if (!kbdDev) { + ErrorF("VNC: In EnqueueKey() kbdDev=NULL\n"); + return; + } + nevents = GetKeyboardEvents(events, kbdDev, type, detail); + for (i = 0; i < nevents; i++) -+ mieqEnqueue(kbdDev, events + i); -+ free(events); ++ mieqEnqueue(kbdDev, (InternalEvent*)(events + i)->event); +} + -+ +/* + * Called when the rfbserver receives a rfbKeyEvent event from a client. + * Put an X keyboard event into the event queue. @@ -8460,6 +8633,7 @@ Index: xorg-server-1.6.3.901/Makefile.am +{ + const int type = down ? KeyPress : KeyRelease; + KeySymsPtr keySyms; ++ XkbStateRec *xkb; + int i; + int keyCode = 0; + int freeIndex = -1; @@ -8472,12 +8646,12 @@ Index: xorg-server-1.6.3.901/Makefile.am + if (!kbdDevice) + return; + -+ keySyms = &kbdDevice->key->curKeySyms; ++ keySyms = XkbGetCoreMap(kbdDevice); + +#ifdef CORBA + if (cl) { + CARD32 clientId = cl->sock; -+ ChangeWindowProperty(WindowTable[0], VNC_LAST_CLIENT_ID, XA_INTEGER, ++ ChangeWindowProperty(screenInfo.screens[0]->root, VNC_LAST_CLIENT_ID, XA_INTEGER, + 32, PropModeReplace, 1, (pointer)&clientId, TRUE); + } +#endif @@ -8583,18 +8757,19 @@ Index: xorg-server-1.6.3.901/Makefile.am + shiftMustBePressed = TRUE; + } + -+ SendMappingNotify(MappingKeyboard, keyCode, 1, serverClient); ++ XkbApplyMappingChange(kbdDevice, keySyms, keyCode, 1, NULL, serverClient); + + ErrorF("KbdAddEvent: unknown KeySym 0x%x - allocating KeyCode %d\n", + (int)keySym, keyCode); + } + ++ xkb = &kbdDevice->key->xkbInfo->state; + if (down) { -+ if (shiftMustBePressed && !(kbdDevice->key->state & ShiftMask)) { ++ if (shiftMustBePressed && !(XkbStateFieldFromRec(xkb) & ShiftMask)) { + fakeShiftPress = TRUE; + EnqueueKey(kbdDevice, KeyPress, SHIFT_L_KEY_CODE); + } -+ if (shiftMustBeReleased && (kbdDevice->key->state & ShiftMask)) { ++ if (shiftMustBeReleased && (XkbStateFieldFromRec(xkb) & ShiftMask)) { + if (KEY_IS_PRESSED(SHIFT_L_KEY_CODE)) { + fakeShiftLRelease = TRUE; + EnqueueKey(kbdDevice, KeyRelease, SHIFT_L_KEY_CODE); @@ -8633,7 +8808,7 @@ Index: xorg-server-1.6.3.901/Makefile.am +#ifdef CORBA + if (cl) { + CARD32 clientId = cl->sock; -+ ChangeWindowProperty(WindowTable[0], VNC_LAST_CLIENT_ID, XA_INTEGER, ++ ChangeWindowProperty(screenInfo.screens[0]->root, VNC_LAST_CLIENT_ID, XA_INTEGER, + 32, PropModeReplace, 1, (pointer)&clientId, TRUE); + } +#endif @@ -8783,9 +8958,12 @@ Index: xorg-server-1.6.3.901/Makefile.am + break; + } +} ---- xorg-server-1.7.99/hw/vnc/keyboard.h -+++ xorg-server-1.7.99/hw/vnc/keyboard.h -@@ -0,0 +1,167 @@ +diff --git a/hw/vnc/keyboard.h b/hw/vnc/keyboard.h +new file mode 100644 +index 0000000..d223b6b +--- /dev/null ++++ b/hw/vnc/keyboard.h +@@ -0,0 +1,34 @@ +/* + * Copyright (C) 2002 Alan Hourihane. All Rights Reserved. + * @@ -8820,142 +8998,12 @@ Index: xorg-server-1.6.3.901/Makefile.am +#define META_R_KEY_CODE (MIN_KEY_CODE + 108) +#define ALT_L_KEY_CODE (MIN_KEY_CODE + 56) +#define ALT_R_KEY_CODE (MIN_KEY_CODE + 105) -+ -+static KeySym map[MAX_KEY_CODE * GLYPHS_PER_KEY] = { -+ /* 0x00 */ NoSymbol, NoSymbol, NoSymbol, NoSymbol, -+ /* 0x01 */ XK_Escape, NoSymbol, NoSymbol, NoSymbol, -+ /* 0x02 */ XK_1, XK_exclam, NoSymbol, NoSymbol, -+ /* 0x03 */ XK_2, XK_at, NoSymbol, NoSymbol, -+ /* 0x04 */ XK_3, XK_numbersign, NoSymbol, NoSymbol, -+ /* 0x05 */ XK_4, XK_dollar, NoSymbol, NoSymbol, -+ /* 0x06 */ XK_5, XK_percent, NoSymbol, NoSymbol, -+ /* 0x07 */ XK_6, XK_asciicircum, NoSymbol, NoSymbol, -+ /* 0x08 */ XK_7, XK_ampersand, NoSymbol, NoSymbol, -+ /* 0x09 */ XK_8, XK_asterisk, NoSymbol, NoSymbol, -+ /* 0x0a */ XK_9, XK_parenleft, NoSymbol, NoSymbol, -+ /* 0x0b */ XK_0, XK_parenright, NoSymbol, NoSymbol, -+ /* 0x0c */ XK_minus, XK_underscore, NoSymbol, NoSymbol, -+ /* 0x0d */ XK_equal, XK_plus, NoSymbol, NoSymbol, -+ /* 0x0e */ XK_BackSpace, NoSymbol, NoSymbol, NoSymbol, -+ /* 0x0f */ XK_Tab, XK_ISO_Left_Tab,NoSymbol, NoSymbol, -+ /* 0x10 */ XK_q, XK_Q, NoSymbol, NoSymbol, -+ /* 0x11 */ XK_w, XK_W, NoSymbol, NoSymbol, -+ /* 0x12 */ XK_e, XK_E, NoSymbol, NoSymbol, -+ /* 0x13 */ XK_r, XK_R, NoSymbol, NoSymbol, -+ /* 0x14 */ XK_t, XK_T, NoSymbol, NoSymbol, -+ /* 0x15 */ XK_y, XK_Y, NoSymbol, NoSymbol, -+ /* 0x16 */ XK_u, XK_U, NoSymbol, NoSymbol, -+ /* 0x17 */ XK_i, XK_I, NoSymbol, NoSymbol, -+ /* 0x18 */ XK_o, XK_O, NoSymbol, NoSymbol, -+ /* 0x19 */ XK_p, XK_P, NoSymbol, NoSymbol, -+ /* 0x1a */ XK_bracketleft, XK_braceleft, NoSymbol, NoSymbol, -+ /* 0x1b */ XK_bracketright,XK_braceright, NoSymbol, NoSymbol, -+ /* 0x1c */ XK_Return, NoSymbol, NoSymbol, NoSymbol, -+ /* 0x1d */ XK_Control_L, NoSymbol, NoSymbol, NoSymbol, -+ /* 0x1e */ XK_a, XK_A, NoSymbol, NoSymbol, -+ /* 0x1f */ XK_s, XK_S, NoSymbol, NoSymbol, -+ /* 0x20 */ XK_d, XK_D, NoSymbol, NoSymbol, -+ /* 0x21 */ XK_f, XK_F, NoSymbol, NoSymbol, -+ /* 0x22 */ XK_g, XK_G, NoSymbol, NoSymbol, -+ /* 0x23 */ XK_h, XK_H, NoSymbol, NoSymbol, -+ /* 0x24 */ XK_j, XK_J, NoSymbol, NoSymbol, -+ /* 0x25 */ XK_k, XK_K, NoSymbol, NoSymbol, -+ /* 0x26 */ XK_l, XK_L, NoSymbol, NoSymbol, -+ /* 0x27 */ XK_semicolon, XK_colon, NoSymbol, NoSymbol, -+ /* 0x28 */ XK_quoteright, XK_quotedbl, NoSymbol, NoSymbol, -+ /* 0x29 */ XK_quoteleft, XK_asciitilde, NoSymbol, NoSymbol, -+ /* 0x2a */ XK_Shift_L, NoSymbol, NoSymbol, NoSymbol, -+ /* 0x2b */ XK_backslash, XK_bar, NoSymbol, NoSymbol, -+ /* 0x2c */ XK_z, XK_Z, NoSymbol, NoSymbol, -+ /* 0x2d */ XK_x, XK_X, NoSymbol, NoSymbol, -+ /* 0x2e */ XK_c, XK_C, NoSymbol, NoSymbol, -+ /* 0x2f */ XK_v, XK_V, NoSymbol, NoSymbol, -+ /* 0x30 */ XK_b, XK_B, NoSymbol, NoSymbol, -+ /* 0x31 */ XK_n, XK_N, NoSymbol, NoSymbol, -+ /* 0x32 */ XK_m, XK_M, NoSymbol, NoSymbol, -+ /* 0x33 */ XK_comma, XK_less, NoSymbol, NoSymbol, -+ /* 0x34 */ XK_period, XK_greater, NoSymbol, NoSymbol, -+ /* 0x35 */ XK_slash, XK_question, NoSymbol, NoSymbol, -+ /* 0x36 */ XK_Shift_R, NoSymbol, NoSymbol, NoSymbol, -+ /* 0x37 */ XK_KP_Multiply, NoSymbol, NoSymbol, NoSymbol, -+ /* 0x38 */ XK_Alt_L, XK_Meta_L, NoSymbol, NoSymbol, -+ /* 0x39 */ XK_space, NoSymbol, NoSymbol, NoSymbol, -+ /* 0x3a */ XK_Caps_Lock, NoSymbol, NoSymbol, NoSymbol, -+ /* 0x3b */ XK_F1, NoSymbol, NoSymbol, NoSymbol, -+ /* 0x3c */ XK_F2, NoSymbol, NoSymbol, NoSymbol, -+ /* 0x3d */ XK_F3, NoSymbol, NoSymbol, NoSymbol, -+ /* 0x3e */ XK_F4, NoSymbol, NoSymbol, NoSymbol, -+ /* 0x3f */ XK_F5, NoSymbol, NoSymbol, NoSymbol, -+ /* 0x40 */ XK_F6, NoSymbol, NoSymbol, NoSymbol, -+ /* 0x41 */ XK_F7, NoSymbol, NoSymbol, NoSymbol, -+ /* 0x42 */ XK_F8, NoSymbol, NoSymbol, NoSymbol, -+ /* 0x43 */ XK_F9, NoSymbol, NoSymbol, NoSymbol, -+ /* 0x44 */ XK_F10, NoSymbol, NoSymbol, NoSymbol, -+ /* 0x45 */ XK_Num_Lock, NoSymbol, NoSymbol, NoSymbol, -+ /* 0x46 */ XK_Scroll_Lock, NoSymbol, NoSymbol, NoSymbol, -+ /* 0x47 */ XK_KP_Home, XK_KP_7, NoSymbol, NoSymbol, -+ /* 0x48 */ XK_KP_Up, XK_KP_8, NoSymbol, NoSymbol, -+ /* 0x49 */ XK_KP_Prior, XK_KP_9, NoSymbol, NoSymbol, -+ /* 0x4a */ XK_KP_Subtract, NoSymbol, NoSymbol, NoSymbol, -+ /* 0x4b */ XK_KP_Left, XK_KP_4, NoSymbol, NoSymbol, -+ /* 0x4c */ XK_KP_Begin, XK_KP_5, NoSymbol, NoSymbol, -+ /* 0x4d */ XK_KP_Right, XK_KP_6, NoSymbol, NoSymbol, -+ /* 0x4e */ XK_KP_Add, NoSymbol, NoSymbol, NoSymbol, -+ /* 0x4f */ XK_KP_End, XK_KP_1, NoSymbol, NoSymbol, -+ /* 0x50 */ XK_KP_Down, XK_KP_2, NoSymbol, NoSymbol, -+ /* 0x51 */ XK_KP_Next, XK_KP_3, NoSymbol, NoSymbol, -+ /* 0x52 */ XK_KP_Insert, XK_KP_0, NoSymbol, NoSymbol, -+ /* 0x53 */ XK_KP_Delete, XK_KP_Decimal, NoSymbol, NoSymbol, -+ /* 0x54 */ XK_Sys_Req, NoSymbol, NoSymbol, NoSymbol, -+ /* 0x55 */ NoSymbol, NoSymbol, NoSymbol, NoSymbol, -+ /* 0x56 */ XK_less, XK_greater, NoSymbol, NoSymbol, -+ /* 0x57 */ XK_F11, NoSymbol, NoSymbol, NoSymbol, -+ /* 0x58 */ XK_F12, NoSymbol, NoSymbol, NoSymbol, -+ /* 0x59 */ XK_Home, NoSymbol, NoSymbol, NoSymbol, -+ /* 0x5a */ XK_Up, NoSymbol, NoSymbol, NoSymbol, -+ /* 0x5b */ XK_Prior, NoSymbol, NoSymbol, NoSymbol, -+ /* 0x5c */ XK_Left, NoSymbol, NoSymbol, NoSymbol, -+ /* 0x5d */ XK_Begin, NoSymbol, NoSymbol, NoSymbol, -+ /* 0x5e */ XK_Right, NoSymbol, NoSymbol, NoSymbol, -+ /* 0x5f */ XK_End, NoSymbol, NoSymbol, NoSymbol, -+ /* 0x60 */ XK_Down, NoSymbol, NoSymbol, NoSymbol, -+ /* 0x61 */ XK_Next, NoSymbol, NoSymbol, NoSymbol, -+ /* 0x62 */ XK_Insert, NoSymbol, NoSymbol, NoSymbol, -+ /* 0x63 */ XK_Delete, NoSymbol, NoSymbol, NoSymbol, -+ /* 0x64 */ XK_KP_Enter, NoSymbol, NoSymbol, NoSymbol, -+ /* 0x65 */ XK_Control_R, NoSymbol, NoSymbol, NoSymbol, -+ /* 0x66 */ XK_Pause, NoSymbol, NoSymbol, NoSymbol, -+ /* 0x67 */ XK_Print, NoSymbol, NoSymbol, NoSymbol, -+ /* 0x68 */ XK_KP_Divide, NoSymbol, NoSymbol, NoSymbol, -+ /* 0x69 */ XK_Alt_R, XK_Meta_R, NoSymbol, NoSymbol, -+ /* 0x6a */ XK_Break, NoSymbol, NoSymbol, NoSymbol, -+ /* 0x6b */ XK_Meta_L, NoSymbol, NoSymbol, NoSymbol, -+ /* 0x6c */ XK_Meta_R, NoSymbol, NoSymbol, NoSymbol, -+ /* 0x6d */ XK_Menu, NoSymbol, NoSymbol, NoSymbol, -+ /* 0x6e */ XK_F13, NoSymbol, NoSymbol, NoSymbol, -+ /* 0x6f */ XK_F14, NoSymbol, NoSymbol, NoSymbol, -+ /* 0x70 */ XK_F15, NoSymbol, NoSymbol, NoSymbol, -+ /* 0x71 */ XK_F16, NoSymbol, NoSymbol, NoSymbol, -+ /* 0x72 */ XK_F17, NoSymbol, NoSymbol, NoSymbol, -+ /* 0x73 */ XK_backslash, XK_underscore, NoSymbol, NoSymbol, -+ /* 0x74 */ NoSymbol, NoSymbol, NoSymbol, NoSymbol, -+ /* 0x75 */ NoSymbol, NoSymbol, NoSymbol, NoSymbol, -+ /* 0x76 */ NoSymbol, NoSymbol, NoSymbol, NoSymbol, -+ /* 0x77 */ NoSymbol, NoSymbol, NoSymbol, NoSymbol, -+ /* 0x78 */ NoSymbol, NoSymbol, NoSymbol, NoSymbol, -+ /* 0x79 */ XK_Henkan, XK_Mode_switch, NoSymbol, NoSymbol, -+ /* 0x7a */ NoSymbol, NoSymbol, NoSymbol, NoSymbol, -+ /* 0x7b */ XK_Muhenkan, NoSymbol, NoSymbol, NoSymbol, -+ /* 0x7c */ NoSymbol, NoSymbol, NoSymbol, NoSymbol, -+ /* 0x7d */ XK_backslash, XK_bar, NoSymbol, NoSymbol, -+ /* 0x7e */ NoSymbol, NoSymbol, NoSymbol, NoSymbol, -+ /* 0x7f */ NoSymbol, NoSymbol, NoSymbol, NoSymbol, -+}; -+ -+#define N_PREDEFINED_KEYS (sizeof(map) / (sizeof(KeySym) * GLYPHS_PER_KEY)) ---- xorg-server-1.7.99/hw/vnc/loginauth.c -+++ xorg-server-1.7.99/hw/vnc/loginauth.c -@@ -0,0 +1,143 @@ +diff --git a/hw/vnc/loginauth.c b/hw/vnc/loginauth.c +new file mode 100644 +index 0000000..5729f36 +--- /dev/null ++++ b/hw/vnc/loginauth.c +@@ -0,0 +1,142 @@ +/* + * loginauth.c - deal with login-style Unix authentication. + * @@ -8993,7 +9041,6 @@ Index: xorg-server-1.6.3.901/Makefile.am +#endif +#include +#include -+#define _XOPEN_SOURCE +#include +#include +#include @@ -9019,8 +9066,8 @@ Index: xorg-server-1.6.3.901/Makefile.am + } + loginLen = Swap32IfLE(loginLen); + passwdLen = Swap32IfLE(passwdLen); -+ loginBuf = (char *)xalloc(loginLen + 1); -+ passwdBuf = (char *)xalloc(passwdLen + 1); ++ loginBuf = (char *)malloc(loginLen + 1); ++ passwdBuf = (char *)malloc(passwdLen + 1); + + n1 = n2 = 0; + if ((n1 = ReadExact(cl->sock, loginBuf, loginLen)) <= 0 || @@ -9099,9 +9146,12 @@ Index: xorg-server-1.6.3.901/Makefile.am + cl->state = RFB_INITIALISATION; +} + ---- xorg-server-1.7.99/hw/vnc/rdp.c -+++ xorg-server-1.7.99/hw/vnc/rdp.c -@@ -0,0 +1,147 @@ +diff --git a/hw/vnc/rdp.c b/hw/vnc/rdp.c +new file mode 100644 +index 0000000..3174209 +--- /dev/null ++++ b/hw/vnc/rdp.c +@@ -0,0 +1,145 @@ +/* + * Copyright (C) 2004 Alan Hourihane. All Rights Reserved. + * @@ -9131,6 +9181,7 @@ Index: xorg-server-1.6.3.901/Makefile.am +#include +#include +#include ++#include +#include "rfb.h" + +typedef struct rdpClientRec { @@ -9144,7 +9195,7 @@ Index: xorg-server-1.6.3.901/Makefile.am + char hdrlen; + unsigned char pdu; +} rdpInRec, *rdpInPtr; -+ ++#if 0 +static void +rdpCloseSock(ScreenPtr pScreen) +{ @@ -9153,24 +9204,19 @@ Index: xorg-server-1.6.3.901/Makefile.am + RemoveEnabledDevice(pVNC->rdpListenSock); + pVNC->rdpListenSock = -1; +} -+ ++#endif +/* + * rdpNewClient is called when a new connection has been made by whatever + * means. + */ -+ ++#if 0 +static rdpClientPtr +rdpNewClient(ScreenPtr pScreen, int sock) +{ + rdpInRec in; + rdpClientPtr cl; -+ BoxRec box; -+ struct sockaddr_in addr; -+ SOCKLEN_T addrlen = sizeof(struct sockaddr_in); -+ VNCSCREENPTR(pScreen); -+ int i; + -+ cl = (rdpClientPtr)xalloc(sizeof(rdpClientRec)); ++ cl = (rdpClientPtr)malloc(sizeof(rdpClientRec)); + + cl->pScreen = pScreen; + @@ -9188,12 +9234,13 @@ Index: xorg-server-1.6.3.901/Makefile.am + + return cl; +} ++#endif +/* + * rdpCheckFds is called from ProcessInputEvents to check for input on the + * HTTP socket(s). If there is input to process, rdpProcessInput is called. + */ -+ -+void ++#if 0 ++static void +rdpCheckFds(ScreenPtr pScreen) +{ + VNCSCREENPTR(pScreen); @@ -9249,9 +9296,13 @@ Index: xorg-server-1.6.3.901/Makefile.am + rdpNewClient(pScreen, sock); + } +} ---- xorg-server-1.7.99/hw/vnc/rfb.h -+++ xorg-server-1.7.99/hw/vnc/rfb.h -@@ -0,0 +1,751 @@ ++#endif +diff --git a/hw/vnc/rfb.h b/hw/vnc/rfb.h +new file mode 100644 +index 0000000..70b1a45 +--- /dev/null ++++ b/hw/vnc/rfb.h +@@ -0,0 +1,747 @@ +/* + * rfb.h - header file for RFB DDX implementation. + * @@ -9443,11 +9494,8 @@ Index: xorg-server-1.6.3.901/Makefile.am + + CloseScreenProcPtr CloseScreen; + CreateGCProcPtr CreateGC; -+ PaintWindowBackgroundProcPtr PaintWindowBackground; -+ PaintWindowBorderProcPtr PaintWindowBorder; + CopyWindowProcPtr CopyWindow; + ClearToBackgroundProcPtr ClearToBackground; -+ RestoreAreasProcPtr RestoreAreas; + ScreenWakeupHandlerProcPtr WakeupHandler; +#ifdef CHROMIUM + RealizeWindowProcPtr RealizeWindow; @@ -9672,7 +9720,7 @@ Index: xorg-server-1.6.3.901/Makefile.am + +#define SAFE_REGION_INIT(pscreen, preg, rect, size) \ +{ \ -+ if ( ( (rect) ) && \ ++ if ( \ + ( ( (rect)->x2 == (rect)->x1 ) || \ + ( (rect)->y2 == (rect)->y1 ) ) ) { \ + REGION_NULL( (pscreen), (preg) ); \ @@ -9818,7 +9866,6 @@ Index: xorg-server-1.6.3.901/Makefile.am +#endif +extern void rfbClearToBackground(WindowPtr, int x, int y, int w, + int h, Bool generateExposures); -+extern RegionPtr rfbRestoreAreas(WindowPtr, RegionPtr); +extern void rfbScheduleUpdate(ScreenPtr pScreen); + +/* dispcur.c */ @@ -10003,9 +10050,12 @@ Index: xorg-server-1.6.3.901/Makefile.am + + +#endif /* RFB_H_INCLUDED */ ---- xorg-server-1.7.99/hw/vnc/rfbkeyb.c -+++ xorg-server-1.7.99/hw/vnc/rfbkeyb.c -@@ -0,0 +1,405 @@ +diff --git a/hw/vnc/rfbkeyb.c b/hw/vnc/rfbkeyb.c +new file mode 100644 +index 0000000..4da29c2 +--- /dev/null ++++ b/hw/vnc/rfbkeyb.c +@@ -0,0 +1,519 @@ +/* + * Copyright (C) 2002 Alan Hourihane. All Rights Reserved. + * @@ -10058,10 +10108,7 @@ Index: xorg-server-1.6.3.901/Makefile.am + +extern void rfbSendBell(void); +extern DeviceIntPtr kbdDevice; -+ -+static const char *DEFAULTS[] = { -+ NULL -+}; ++extern void vncInitKeyb(void); + +#include +#include "keyboard.h" @@ -10091,6 +10138,139 @@ Index: xorg-server-1.6.3.901/Makefile.am +#endif +#endif + ++static KeySym map[MAX_KEY_CODE * GLYPHS_PER_KEY] = { ++ /* 0x00 */ NoSymbol, NoSymbol, NoSymbol, NoSymbol, ++ /* 0x01 */ XK_Escape, NoSymbol, NoSymbol, NoSymbol, ++ /* 0x02 */ XK_1, XK_exclam, NoSymbol, NoSymbol, ++ /* 0x03 */ XK_2, XK_at, NoSymbol, NoSymbol, ++ /* 0x04 */ XK_3, XK_numbersign, NoSymbol, NoSymbol, ++ /* 0x05 */ XK_4, XK_dollar, NoSymbol, NoSymbol, ++ /* 0x06 */ XK_5, XK_percent, NoSymbol, NoSymbol, ++ /* 0x07 */ XK_6, XK_asciicircum, NoSymbol, NoSymbol, ++ /* 0x08 */ XK_7, XK_ampersand, NoSymbol, NoSymbol, ++ /* 0x09 */ XK_8, XK_asterisk, NoSymbol, NoSymbol, ++ /* 0x0a */ XK_9, XK_parenleft, NoSymbol, NoSymbol, ++ /* 0x0b */ XK_0, XK_parenright, NoSymbol, NoSymbol, ++ /* 0x0c */ XK_minus, XK_underscore, NoSymbol, NoSymbol, ++ /* 0x0d */ XK_equal, XK_plus, NoSymbol, NoSymbol, ++ /* 0x0e */ XK_BackSpace, NoSymbol, NoSymbol, NoSymbol, ++ /* 0x0f */ XK_Tab, XK_ISO_Left_Tab,NoSymbol, NoSymbol, ++ /* 0x10 */ XK_q, XK_Q, NoSymbol, NoSymbol, ++ /* 0x11 */ XK_w, XK_W, NoSymbol, NoSymbol, ++ /* 0x12 */ XK_e, XK_E, NoSymbol, NoSymbol, ++ /* 0x13 */ XK_r, XK_R, NoSymbol, NoSymbol, ++ /* 0x14 */ XK_t, XK_T, NoSymbol, NoSymbol, ++ /* 0x15 */ XK_y, XK_Y, NoSymbol, NoSymbol, ++ /* 0x16 */ XK_u, XK_U, NoSymbol, NoSymbol, ++ /* 0x17 */ XK_i, XK_I, NoSymbol, NoSymbol, ++ /* 0x18 */ XK_o, XK_O, NoSymbol, NoSymbol, ++ /* 0x19 */ XK_p, XK_P, NoSymbol, NoSymbol, ++ /* 0x1a */ XK_bracketleft, XK_braceleft, NoSymbol, NoSymbol, ++ /* 0x1b */ XK_bracketright,XK_braceright, NoSymbol, NoSymbol, ++ /* 0x1c */ XK_Return, NoSymbol, NoSymbol, NoSymbol, ++ /* 0x1d */ XK_Control_L, NoSymbol, NoSymbol, NoSymbol, ++ /* 0x1e */ XK_a, XK_A, NoSymbol, NoSymbol, ++ /* 0x1f */ XK_s, XK_S, NoSymbol, NoSymbol, ++ /* 0x20 */ XK_d, XK_D, NoSymbol, NoSymbol, ++ /* 0x21 */ XK_f, XK_F, NoSymbol, NoSymbol, ++ /* 0x22 */ XK_g, XK_G, NoSymbol, NoSymbol, ++ /* 0x23 */ XK_h, XK_H, NoSymbol, NoSymbol, ++ /* 0x24 */ XK_j, XK_J, NoSymbol, NoSymbol, ++ /* 0x25 */ XK_k, XK_K, NoSymbol, NoSymbol, ++ /* 0x26 */ XK_l, XK_L, NoSymbol, NoSymbol, ++ /* 0x27 */ XK_semicolon, XK_colon, NoSymbol, NoSymbol, ++ /* 0x28 */ XK_quoteright, XK_quotedbl, NoSymbol, NoSymbol, ++ /* 0x29 */ XK_quoteleft, XK_asciitilde, NoSymbol, NoSymbol, ++ /* 0x2a */ XK_Shift_L, NoSymbol, NoSymbol, NoSymbol, ++ /* 0x2b */ XK_backslash, XK_bar, NoSymbol, NoSymbol, ++ /* 0x2c */ XK_z, XK_Z, NoSymbol, NoSymbol, ++ /* 0x2d */ XK_x, XK_X, NoSymbol, NoSymbol, ++ /* 0x2e */ XK_c, XK_C, NoSymbol, NoSymbol, ++ /* 0x2f */ XK_v, XK_V, NoSymbol, NoSymbol, ++ /* 0x30 */ XK_b, XK_B, NoSymbol, NoSymbol, ++ /* 0x31 */ XK_n, XK_N, NoSymbol, NoSymbol, ++ /* 0x32 */ XK_m, XK_M, NoSymbol, NoSymbol, ++ /* 0x33 */ XK_comma, XK_less, NoSymbol, NoSymbol, ++ /* 0x34 */ XK_period, XK_greater, NoSymbol, NoSymbol, ++ /* 0x35 */ XK_slash, XK_question, NoSymbol, NoSymbol, ++ /* 0x36 */ XK_Shift_R, NoSymbol, NoSymbol, NoSymbol, ++ /* 0x37 */ XK_KP_Multiply, NoSymbol, NoSymbol, NoSymbol, ++ /* 0x38 */ XK_Alt_L, XK_Meta_L, NoSymbol, NoSymbol, ++ /* 0x39 */ XK_space, NoSymbol, NoSymbol, NoSymbol, ++ /* 0x3a */ XK_Caps_Lock, NoSymbol, NoSymbol, NoSymbol, ++ /* 0x3b */ XK_F1, NoSymbol, NoSymbol, NoSymbol, ++ /* 0x3c */ XK_F2, NoSymbol, NoSymbol, NoSymbol, ++ /* 0x3d */ XK_F3, NoSymbol, NoSymbol, NoSymbol, ++ /* 0x3e */ XK_F4, NoSymbol, NoSymbol, NoSymbol, ++ /* 0x3f */ XK_F5, NoSymbol, NoSymbol, NoSymbol, ++ /* 0x40 */ XK_F6, NoSymbol, NoSymbol, NoSymbol, ++ /* 0x41 */ XK_F7, NoSymbol, NoSymbol, NoSymbol, ++ /* 0x42 */ XK_F8, NoSymbol, NoSymbol, NoSymbol, ++ /* 0x43 */ XK_F9, NoSymbol, NoSymbol, NoSymbol, ++ /* 0x44 */ XK_F10, NoSymbol, NoSymbol, NoSymbol, ++ /* 0x45 */ XK_Num_Lock, NoSymbol, NoSymbol, NoSymbol, ++ /* 0x46 */ XK_Scroll_Lock, NoSymbol, NoSymbol, NoSymbol, ++ /* 0x47 */ XK_KP_Home, XK_KP_7, NoSymbol, NoSymbol, ++ /* 0x48 */ XK_KP_Up, XK_KP_8, NoSymbol, NoSymbol, ++ /* 0x49 */ XK_KP_Prior, XK_KP_9, NoSymbol, NoSymbol, ++ /* 0x4a */ XK_KP_Subtract, NoSymbol, NoSymbol, NoSymbol, ++ /* 0x4b */ XK_KP_Left, XK_KP_4, NoSymbol, NoSymbol, ++ /* 0x4c */ XK_KP_Begin, XK_KP_5, NoSymbol, NoSymbol, ++ /* 0x4d */ XK_KP_Right, XK_KP_6, NoSymbol, NoSymbol, ++ /* 0x4e */ XK_KP_Add, NoSymbol, NoSymbol, NoSymbol, ++ /* 0x4f */ XK_KP_End, XK_KP_1, NoSymbol, NoSymbol, ++ /* 0x50 */ XK_KP_Down, XK_KP_2, NoSymbol, NoSymbol, ++ /* 0x51 */ XK_KP_Next, XK_KP_3, NoSymbol, NoSymbol, ++ /* 0x52 */ XK_KP_Insert, XK_KP_0, NoSymbol, NoSymbol, ++ /* 0x53 */ XK_KP_Delete, XK_KP_Decimal, NoSymbol, NoSymbol, ++ /* 0x54 */ XK_Sys_Req, NoSymbol, NoSymbol, NoSymbol, ++ /* 0x55 */ NoSymbol, NoSymbol, NoSymbol, NoSymbol, ++ /* 0x56 */ XK_less, XK_greater, NoSymbol, NoSymbol, ++ /* 0x57 */ XK_F11, NoSymbol, NoSymbol, NoSymbol, ++ /* 0x58 */ XK_F12, NoSymbol, NoSymbol, NoSymbol, ++ /* 0x59 */ XK_Home, NoSymbol, NoSymbol, NoSymbol, ++ /* 0x5a */ XK_Up, NoSymbol, NoSymbol, NoSymbol, ++ /* 0x5b */ XK_Prior, NoSymbol, NoSymbol, NoSymbol, ++ /* 0x5c */ XK_Left, NoSymbol, NoSymbol, NoSymbol, ++ /* 0x5d */ XK_Begin, NoSymbol, NoSymbol, NoSymbol, ++ /* 0x5e */ XK_Right, NoSymbol, NoSymbol, NoSymbol, ++ /* 0x5f */ XK_End, NoSymbol, NoSymbol, NoSymbol, ++ /* 0x60 */ XK_Down, NoSymbol, NoSymbol, NoSymbol, ++ /* 0x61 */ XK_Next, NoSymbol, NoSymbol, NoSymbol, ++ /* 0x62 */ XK_Insert, NoSymbol, NoSymbol, NoSymbol, ++ /* 0x63 */ XK_Delete, NoSymbol, NoSymbol, NoSymbol, ++ /* 0x64 */ XK_KP_Enter, NoSymbol, NoSymbol, NoSymbol, ++ /* 0x65 */ XK_Control_R, NoSymbol, NoSymbol, NoSymbol, ++ /* 0x66 */ XK_Pause, NoSymbol, NoSymbol, NoSymbol, ++ /* 0x67 */ XK_Print, NoSymbol, NoSymbol, NoSymbol, ++ /* 0x68 */ XK_KP_Divide, NoSymbol, NoSymbol, NoSymbol, ++ /* 0x69 */ XK_Alt_R, XK_Meta_R, NoSymbol, NoSymbol, ++ /* 0x6a */ XK_Break, NoSymbol, NoSymbol, NoSymbol, ++ /* 0x6b */ XK_Meta_L, NoSymbol, NoSymbol, NoSymbol, ++ /* 0x6c */ XK_Meta_R, NoSymbol, NoSymbol, NoSymbol, ++ /* 0x6d */ XK_Menu, NoSymbol, NoSymbol, NoSymbol, ++ /* 0x6e */ XK_F13, NoSymbol, NoSymbol, NoSymbol, ++ /* 0x6f */ XK_F14, NoSymbol, NoSymbol, NoSymbol, ++ /* 0x70 */ XK_F15, NoSymbol, NoSymbol, NoSymbol, ++ /* 0x71 */ XK_F16, NoSymbol, NoSymbol, NoSymbol, ++ /* 0x72 */ XK_F17, NoSymbol, NoSymbol, NoSymbol, ++ /* 0x73 */ XK_backslash, XK_underscore, NoSymbol, NoSymbol, ++ /* 0x74 */ NoSymbol, NoSymbol, NoSymbol, NoSymbol, ++ /* 0x75 */ NoSymbol, NoSymbol, NoSymbol, NoSymbol, ++ /* 0x76 */ NoSymbol, NoSymbol, NoSymbol, NoSymbol, ++ /* 0x77 */ NoSymbol, NoSymbol, NoSymbol, NoSymbol, ++ /* 0x78 */ NoSymbol, NoSymbol, NoSymbol, NoSymbol, ++ /* 0x79 */ XK_Henkan, XK_Mode_switch, NoSymbol, NoSymbol, ++ /* 0x7a */ NoSymbol, NoSymbol, NoSymbol, NoSymbol, ++ /* 0x7b */ XK_Muhenkan, NoSymbol, NoSymbol, NoSymbol, ++ /* 0x7c */ NoSymbol, NoSymbol, NoSymbol, NoSymbol, ++ /* 0x7d */ XK_backslash, XK_bar, NoSymbol, NoSymbol, ++ /* 0x7e */ NoSymbol, NoSymbol, NoSymbol, NoSymbol, ++ /* 0x7f */ NoSymbol, NoSymbol, NoSymbol, NoSymbol, ++}; ++ ++#define N_PREDEFINED_KEYS (sizeof(map) / (sizeof(KeySym) * GLYPHS_PER_KEY)) ++ +void +KbdDeviceInit(DeviceIntPtr pDevice, KeySymsPtr pKeySyms, CARD8 *pModMap) +{ @@ -10112,7 +10292,7 @@ Index: xorg-server-1.6.3.901/Makefile.am + pKeySyms->maxKeyCode = MAX_KEY_CODE; + pKeySyms->mapWidth = GLYPHS_PER_KEY; + -+ pKeySyms->map = (KeySym *)xalloc(sizeof(KeySym) ++ pKeySyms->map = (KeySym *)malloc(sizeof(KeySym) + * MAP_LENGTH * GLYPHS_PER_KEY); + + if (!pKeySyms->map) { @@ -10147,6 +10327,9 @@ Index: xorg-server-1.6.3.901/Makefile.am + CARD8 modMap[MAP_LENGTH]; + DevicePtr pDev = (DevicePtr)device; + ++ if (!device) ++ return BadValue; ++ + switch (onoff) + { + case DEVICE_INIT: @@ -10155,7 +10338,7 @@ Index: xorg-server-1.6.3.901/Makefile.am +#ifdef XKB + if (noXkbExtension) { +#endif -+ InitKeyboardDeviceStruct(pDev, &keySyms, modMap, ++ InitKeyboardDeviceStruct(device, NULL, + (BellProcPtr)rfbSendBell, + (KbdCtrlProcPtr)NoopDDA); +#ifdef XKB @@ -10219,46 +10402,27 @@ Index: xorg-server-1.6.3.901/Makefile.am + xf86rfbKeybControlProc(pInfo->dev, DEVICE_OFF); +} + -+static InputInfoPtr -+xf86rfbKeybInit(InputDriverPtr drv, -+ IDevPtr dev, ++static int ++xf86rfbKeybInit(struct _InputDriverRec *drv, ++ struct _InputInfoRec* pInfo, + int flags) +{ -+ InputInfoPtr pInfo; -+ char *s; -+ Bool from; -+ -+ if (!(pInfo = xf86AllocateInput(drv, 0))) -+ return NULL; -+ + /* Initialise the InputInfoRec. */ -+ pInfo->name = dev->identifier; + pInfo->type_name = "rfbKeyb"; -+ pInfo->flags = XI86_KEYBOARD_CAPABLE; + pInfo->device_control = xf86rfbKeybControlProc; + pInfo->read_input = NULL; +#if 0 + pInfo->motion_history_proc = NULL; +#endif -+ pInfo->history_size = 0; + pInfo->control_proc = NULL; -+ pInfo->close_proc = NULL; + pInfo->switch_mode = NULL; -+ pInfo->conversion_proc = NULL; -+ pInfo->reverse_conversion_proc = NULL; + pInfo->fd = -1; + pInfo->dev = NULL; -+ pInfo->private_flags = 0; -+ pInfo->always_core_feedback = 0; -+ pInfo->conf_idev = dev; + + /* Collect the options, and process the common options. */ -+ xf86CollectInputOptions(pInfo, DEFAULTS, NULL); ++ xf86CollectInputOptions(pInfo, (const char**)drv->default_options); + xf86ProcessCommonOptions(pInfo, pInfo->options); + -+ /* Mark the device configured */ -+ pInfo->flags |= XI86_CONFIGURED; -+ +#ifdef XKB + from = X_DEFAULT; + if (noXkbExtension) @@ -10344,7 +10508,7 @@ Index: xorg-server-1.6.3.901/Makefile.am +#endif + + /* Return the configured device */ -+ return (pInfo); ++ return Success; +} + +#ifdef XFree86LOADER @@ -10396,7 +10560,7 @@ Index: xorg-server-1.6.3.901/Makefile.am + "xf4vnc Project, see http://xf4vnc.sf.net", + MODINFOSTRING1, + MODINFOSTRING2, -+ XF86_VERSION_CURRENT, ++ XORG_VERSION_CURRENT, + 1, 0, 0, + ABI_CLASS_XINPUT, + ABI_XINPUT_VERSION, @@ -10411,8 +10575,11 @@ Index: xorg-server-1.6.3.901/Makefile.am + +#endif /* XFree86LOADER */ +#endif ---- xorg-server-1.7.99/hw/vnc/rfbmouse.c -+++ xorg-server-1.7.99/hw/vnc/rfbmouse.c +diff --git a/hw/vnc/rfbmouse.c b/hw/vnc/rfbmouse.c +new file mode 100644 +index 0000000..4657128 +--- /dev/null ++++ b/hw/vnc/rfbmouse.c @@ -0,0 +1,260 @@ +/* + * Copyright (C) 2002 Alan Hourihane. All Rights Reserved. @@ -10459,15 +10626,14 @@ Index: xorg-server-1.6.3.901/Makefile.am +#include +#endif + -+static const char *DEFAULTS[] = { -+ NULL -+}; +#else +#include +#include +#endif +#include "rfb.h" ++#include "xserver-properties.h" + ++extern void vncInitMouse(void); + +unsigned char ptrAcceleration = 50; + @@ -10507,17 +10673,24 @@ Index: xorg-server-1.6.3.901/Makefile.am + +#if XFREE86VNC +static int -+xf86rfbMouseControlProc(DeviceIntPtr device, int onoff) ++xf86rfbMouseControlProc(DeviceIntPtr dev, int onoff) +{ + BYTE map[6]; -+ DevicePtr pDev = (DevicePtr)device; -+ void *func1; ++ DevicePtr pDev = &dev->public; ++ Atom btn_labels[5] = {0}; ++ Atom axes_labels[2] = {0}; ++ + int (*func2)(void); + ++ if (!dev) ++ return BadValue; ++ ++#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) < 3 + if (LoaderSymbol("GetMotionHistory")) + func1 = LoaderSymbol("GetMotionHistory"); + else + func1 = LoaderSymbol("miPointerGetMotionEvents"); ++#endif + + if (LoaderSymbol("GetMotionHistorySize")) + func2 = LoaderSymbol("GetMotionHistorySize"); @@ -10528,22 +10701,33 @@ Index: xorg-server-1.6.3.901/Makefile.am + switch (onoff) + { + case DEVICE_INIT: -+ vncSetPointerDevice(device); ++ vncSetPointerDevice(dev); + PtrDeviceInit(); + map[1] = 1; + map[2] = 2; + map[3] = 3; + map[4] = 4; + map[5] = 5; -+ InitPointerDeviceStruct(pDev, map, 5, ++ btn_labels[0] = XIGetKnownProperty(BTN_LABEL_PROP_BTN_LEFT); ++ btn_labels[1] = XIGetKnownProperty(BTN_LABEL_PROP_BTN_MIDDLE); ++ btn_labels[2] = XIGetKnownProperty(BTN_LABEL_PROP_BTN_RIGHT); ++ btn_labels[3] = XIGetKnownProperty(BTN_LABEL_PROP_BTN_WHEEL_UP); ++ btn_labels[4] = XIGetKnownProperty(BTN_LABEL_PROP_BTN_WHEEL_DOWN); ++ ++ axes_labels[0] = XIGetKnownProperty(AXIS_LABEL_PROP_REL_X); ++ axes_labels[1] = XIGetKnownProperty(AXIS_LABEL_PROP_REL_Y); ++ ++ InitPointerDeviceStruct(pDev, map, 5, btn_labels, ++#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) < 3 + func1, ++#endif + PtrDeviceControl, -+ (*func2)(), 2); ++ (*func2)(), 2, axes_labels); + break; + + case DEVICE_ON: + pDev->on = TRUE; -+ PtrDeviceOn(device); ++ PtrDeviceOn(dev); + break; + + case DEVICE_OFF: @@ -10568,46 +10752,29 @@ Index: xorg-server-1.6.3.901/Makefile.am + xf86rfbMouseControlProc(pInfo->dev, DEVICE_OFF); +} + -+static InputInfoPtr ++static int +xf86rfbMouseInit(InputDriverPtr drv, -+ IDevPtr dev, ++ InputInfoPtr pInfo, + int flags) +{ -+ InputInfoPtr pInfo; -+ -+ if (!(pInfo = xf86AllocateInput(drv, 0))) -+ return NULL; -+ + /* Initialise the InputInfoRec. */ -+ pInfo->name = dev->identifier; + pInfo->type_name = "rfbMouse"; -+ pInfo->flags = XI86_POINTER_CAPABLE | XI86_SEND_DRAG_EVENTS; + pInfo->device_control = xf86rfbMouseControlProc; + pInfo->read_input = NULL; +#if 0 + pInfo->motion_history_proc = xf86GetMotionEvents; +#endif -+ pInfo->history_size = 0; + pInfo->control_proc = NULL; -+ pInfo->close_proc = NULL; + pInfo->switch_mode = NULL; -+ pInfo->conversion_proc = NULL; -+ pInfo->reverse_conversion_proc = NULL; + pInfo->fd = -1; -+ pInfo->dev = NULL; -+ pInfo->private_flags = 0; -+ pInfo->always_core_feedback = 0; -+ pInfo->conf_idev = dev; ++ // pInfo->dev = NULL; + + /* Collect the options, and process the common options. */ -+ xf86CollectInputOptions(pInfo, DEFAULTS, NULL); ++ xf86CollectInputOptions(pInfo, (const char**)drv->default_options); + xf86ProcessCommonOptions(pInfo, pInfo->options); + -+ /* Mark the device configured */ -+ pInfo->flags |= XI86_CONFIGURED; -+ + /* Return the configured device */ -+ return (pInfo); ++ return Success; +} + +#ifdef XFree86LOADER @@ -10659,7 +10826,7 @@ Index: xorg-server-1.6.3.901/Makefile.am + "xf4vnc Project, see http://xf4vnc.sf.net", + MODINFOSTRING1, + MODINFOSTRING2, -+ XF86_VERSION_CURRENT, ++ XORG_VERSION_CURRENT, + 1, 0, 0, + ABI_CLASS_XINPUT, + ABI_XINPUT_VERSION, @@ -10674,8 +10841,11 @@ Index: xorg-server-1.6.3.901/Makefile.am + +#endif /* XFree86LOADER */ +#endif ---- xorg-server-1.7.99/hw/vnc/rfbproto.h -+++ xorg-server-1.7.99/hw/vnc/rfbproto.h +diff --git a/hw/vnc/rfbproto.h b/hw/vnc/rfbproto.h +new file mode 100644 +index 0000000..5ed86c5 +--- /dev/null ++++ b/hw/vnc/rfbproto.h @@ -0,0 +1,1362 @@ +/* + * Copyright (C) 2000-2004 Constantin Kaplinsky. All Rights Reserved. @@ -12039,9 +12209,12 @@ Index: xorg-server-1.6.3.901/Makefile.am + rfbChromiumStopMsg csd; + rfbChromiumExposeMsg cse; +} rfbClientToServerMsg; ---- xorg-server-1.7.99/hw/vnc/rfbserver.c -+++ xorg-server-1.7.99/hw/vnc/rfbserver.c -@@ -0,0 +1,2308 @@ +diff --git a/hw/vnc/rfbserver.c b/hw/vnc/rfbserver.c +new file mode 100644 +index 0000000..4a12847 +--- /dev/null ++++ b/hw/vnc/rfbserver.c +@@ -0,0 +1,2269 @@ +/* + * rfbserver.c - deal with server-side of the RFB protocol. + * @@ -12097,6 +12270,7 @@ Index: xorg-server-1.6.3.901/Makefile.am +#include "propertyst.h" +#include +#include ++#include + +#ifdef CORBA +#include @@ -12125,7 +12299,7 @@ Index: xorg-server-1.6.3.901/Makefile.am +rfbRootPropertyChange(ScreenPtr pScreen) +{ + PropertyPtr pProp; -+ WindowPtr pWin = WindowTable[pScreen->myNum]; ++ WindowPtr pWin = pScreen->root; + + pProp = wUserProps (pWin); + @@ -12139,8 +12313,8 @@ Index: xorg-server-1.6.3.901/Makefile.am + if ( (text && pProp->data && strncmp(text, pProp->data, pProp->size)) || !text) + rfbGotXCutText(pProp->data, pProp->size); + -+ if (text) xfree(text); -+ text = xalloc(1 + pProp->size); ++ if (text) free(text); ++ text = malloc(1 + pProp->size); + if (! text) return; + if (pProp->data) memcpy(text, pProp->data, pProp->size); + text[pProp->size] = '\0'; @@ -12153,7 +12327,7 @@ Index: xorg-server-1.6.3.901/Makefile.am + int i; + rfbClientPtr cl; + int port = 5500; -+ char *host = (char *)Xalloc(pProp->size+1); ++ char *host = (char *)malloc(pProp->size+1); + memcpy(host, pProp->data, pProp->size); + host[pProp->size] = 0; + for (i = 0; i < pProp->size; i++) { @@ -12184,8 +12358,7 @@ Index: xorg-server-1.6.3.901/Makefile.am +} + +int -+rfbBitsPerPixel(depth) -+ int depth; ++rfbBitsPerPixel(int depth) +{ + if (depth == 1) return 1; + else if (depth <= 8) return 8; @@ -12270,7 +12443,7 @@ Index: xorg-server-1.6.3.901/Makefile.am + WindowPtr pChild; + Bool WasViewable = (Bool)(pWin->viewable); + Bool anyMarked = FALSE; -+ RegionPtr pOldClip = NULL, bsExposed; ++ RegionPtr pOldClip = NULL; +#ifdef DO_SAVE_UNDERS + Bool dosave = FALSE; +#endif @@ -12360,28 +12533,6 @@ Index: xorg-server-1.6.3.901/Makefile.am + (*pScreen->ValidateTree)(pWin, NullWindow, VTOther); + } + -+ if (pWin->backStorage && -+ ((pWin->backingStore == Always) || WasViewable)) -+ { -+ if (!WasViewable) -+ pOldClip = &pWin->clipList; /* a convenient empty region */ -+ bsExposed = (*pScreen->TranslateBackingStore) -+ (pWin, 0, 0, pOldClip, -+ pWin->drawable.x, pWin->drawable.y); -+ if (WasViewable) -+ REGION_DESTROY(pScreen, pOldClip); -+ if (bsExposed) -+ { -+ RegionPtr valExposed = NullRegion; -+ -+ if (pWin->valdata) -+ valExposed = &pWin->valdata->after.exposed; -+ (*pScreen->WindowExposures) (pWin, valExposed, bsExposed); -+ if (valExposed) -+ REGION_EMPTY(pScreen, valExposed); -+ REGION_DESTROY(pScreen, bsExposed); -+ } -+ } + if (WasViewable) + { + if (anyMarked) @@ -12426,7 +12577,7 @@ Index: xorg-server-1.6.3.901/Makefile.am + rfbLog(")\n"); + } + -+ cl = (rfbClientPtr)xalloc(sizeof(rfbClientRec)); ++ cl = (rfbClientPtr)malloc(sizeof(rfbClientRec)); + +#ifdef CHROMIUM + cl->chromium_port = 0; /* no GL application on this port, yet */ @@ -12512,8 +12663,7 @@ Index: xorg-server-1.6.3.901/Makefile.am + */ + +void -+rfbClientConnectionGone(sock) -+ int sock; ++rfbClientConnectionGone(int sock) +{ + rfbClientPtr cl, prev; + int i; @@ -12571,7 +12721,7 @@ Index: xorg-server-1.6.3.901/Makefile.am + + if (cl->translateLookupTable) free(cl->translateLookupTable); + -+ xfree(cl); ++ free(cl); + + GenerateVncDisconnectedEvent(sock); + @@ -12645,8 +12795,7 @@ Index: xorg-server-1.6.3.901/Makefile.am + */ + +static void -+rfbProcessClientProtocolVersion(cl) -+ rfbClientPtr cl; ++rfbProcessClientProtocolVersion(rfbClientPtr cl) +{ + rfbProtocolVersionMsg pv; + int n, major, minor; @@ -12700,9 +12849,7 @@ Index: xorg-server-1.6.3.901/Makefile.am + */ + +void -+rfbClientConnFailed(cl, reason) -+ rfbClientPtr cl; -+ char *reason; ++rfbClientConnFailed(rfbClientPtr cl, char *reason) +{ + int headerLen, reasonLen; + char buf[8]; @@ -12728,8 +12875,7 @@ Index: xorg-server-1.6.3.901/Makefile.am + */ + +static void -+rfbProcessClientInitMessage(cl) -+ rfbClientPtr cl; ++rfbProcessClientInitMessage(rfbClientPtr cl) +{ + VNCSCREENPTR(cl->pScreen); + rfbClientInitMsg ci; @@ -12821,8 +12967,7 @@ Index: xorg-server-1.6.3.901/Makefile.am +#define N_ENC_CAPS 12 + +void -+rfbSendInteractionCaps(cl) -+ rfbClientPtr cl; ++rfbSendInteractionCaps(rfbClientPtr cl) +{ + rfbInteractionCapsMsg intr_caps; + rfbCapabilityInfo enc_list[N_ENC_CAPS]; @@ -12905,8 +13050,7 @@ Index: xorg-server-1.6.3.901/Makefile.am + */ + +static void -+rfbProcessClientNormalMessage(cl) -+ rfbClientPtr cl; ++rfbProcessClientNormalMessage(rfbClientPtr cl) +{ + VNCSCREENPTR(cl->pScreen); + int n; @@ -13111,7 +13255,7 @@ Index: xorg-server-1.6.3.901/Makefile.am + GenerateVncChromiumConnectedEvent(cl->sock); + if (enc == rfbEncodingChromium) { + /* Generate exposures for all windows */ -+ WindowPtr pWin = WindowTable[cl->pScreen->myNum]; ++ WindowPtr pWin = cl->pScreen->root; + rfbSetClip(pWin, 1); + } + else { @@ -13166,8 +13310,8 @@ Index: xorg-server-1.6.3.901/Makefile.am + + { + int x, y; -+ miPointerPosition(&x, &y); /*XXX deprecated*/ -+ (*pVNC->spriteFuncs->SetCursor)(cl->pScreen, pVNC->pCurs, x, y); ++ miPointerGetPosition(inputInfo.pointer, &x, &y); ++ (*pVNC->spriteFuncs->SetCursor)(inputInfo.pointer, cl->pScreen, pVNC->pCurs, x, y); + } +#endif + @@ -13302,12 +13446,12 @@ Index: xorg-server-1.6.3.901/Makefile.am + + msg.cct.length = Swap32IfLE(msg.cct.length); + -+ str = (char *)xalloc(msg.cct.length); ++ str = (char *)malloc(msg.cct.length); + + if ((n = ReadExact(cl->sock, str, msg.cct.length)) <= 0) { + if (n != 0) + rfbLogPerror("rfbProcessClientNormalMessage: read"); -+ xfree(str); ++ free(str); + rfbCloseSock(cl->pScreen, cl->sock); + return; + } @@ -13316,7 +13460,7 @@ Index: xorg-server-1.6.3.901/Makefile.am + if (!cl->viewOnly) + rfbSetXCutText(str, msg.cct.length); + -+ xfree(str); ++ free(str); + return; + +#ifdef CHROMIUM @@ -13339,7 +13483,7 @@ Index: xorg-server-1.6.3.901/Makefile.am + + for (wt = windowTable; wt; wt = nextWt) { + nextWt = wt->next; -+ xfree(wt); ++ free(wt); + } + + windowTable = NULL; @@ -13364,7 +13508,7 @@ Index: xorg-server-1.6.3.901/Makefile.am + nextWt = wt->next; + if (wt->CRwinId == msg.cse.winid) { + WindowPtr pWin; -+ pWin = LookupIDByType(wt->XwinId, RT_WINDOW); ++ dixLookupResourceByType((pointer)&pWin, wt->XwinId, RT_WINDOW, NullClient, DixUnknownAccess); + if (pWin) { + miSendExposures(pWin, &pWin->clipList, + pWin->drawable.x, @@ -13396,9 +13540,7 @@ Index: xorg-server-1.6.3.901/Makefile.am + */ + +Bool -+rfbSendFramebufferUpdate(pScreen, cl) -+ ScreenPtr pScreen; -+ rfbClientPtr cl; ++rfbSendFramebufferUpdate(ScreenPtr pScreen, rfbClientPtr cl) +{ + VNCSCREENPTR(pScreen); + int i; @@ -13658,10 +13800,9 @@ Index: xorg-server-1.6.3.901/Makefile.am + */ + +static Bool -+rfbSendCopyRegion(cl, reg, dx, dy) -+ rfbClientPtr cl; -+ RegionPtr reg; -+ int dx, dy; ++rfbSendCopyRegion(rfbClientPtr cl, ++ RegionPtr reg, ++ int dx, int dy) +{ + VNCSCREENPTR(cl->pScreen); + int nrects, nrectsInBand, x_inc, y_inc, thisRect, firstInNextBand; @@ -13752,9 +13893,7 @@ Index: xorg-server-1.6.3.901/Makefile.am + */ + +Bool -+rfbSendRectEncodingRaw(cl, x, y, w, h) -+ rfbClientPtr cl; -+ int x, y, w, h; ++rfbSendRectEncodingRaw(rfbClientPtr cl, int x, int y, int w, int h) +{ + VNCSCREENPTR(cl->pScreen); + rfbFramebufferUpdateRectHeader rect; @@ -13822,8 +13961,7 @@ Index: xorg-server-1.6.3.901/Makefile.am + */ + +static Bool -+rfbSendLastRectMarker(cl) -+ rfbClientPtr cl; ++rfbSendLastRectMarker(rfbClientPtr cl) +{ + VNCSCREENPTR(cl->pScreen); + rfbFramebufferUpdateRectHeader rect; @@ -13855,8 +13993,7 @@ Index: xorg-server-1.6.3.901/Makefile.am + */ + +Bool -+rfbSendUpdateBuf(cl) -+ rfbClientPtr cl; ++rfbSendUpdateBuf(rfbClientPtr cl) +{ + VNCSCREENPTR(cl->pScreen); + @@ -13886,10 +14023,8 @@ Index: xorg-server-1.6.3.901/Makefile.am + */ + +Bool -+rfbSendSetColourMapEntries(cl, firstColour, nColours) -+ rfbClientPtr cl; -+ int firstColour; -+ int nColours; ++rfbSendSetColourMapEntries(rfbClientPtr cl, int firstColour, ++ int nColours) +{ +#if !XFREE86VNC + VNCSCREENPTR(cl->pScreen); @@ -13909,13 +14044,13 @@ Index: xorg-server-1.6.3.901/Makefile.am + + /* PseudoColor */ +#if XFREE86VNC -+ if (miInstalledMaps[cl->pScreen->myNum]->class == PseudoColor) { ++ if (GetInstalledmiColormap(cl->pScreen)->class == PseudoColor) { +#else + if (pVNC->rfbInstalledColormap->class == PseudoColor) { +#endif + scme->firstColour = Swap16IfLE(firstColour); +#if XFREE86VNC -+ pent = (EntryPtr)&miInstalledMaps[cl->pScreen->myNum]->red[firstColour]; ++ pent = (EntryPtr)&GetInstalledmiColormap(cl->pScreen)->red[firstColour]; +#else + pent = (EntryPtr)&pVNC->rfbInstalledColormap->red[firstColour]; +#endif @@ -13937,12 +14072,12 @@ Index: xorg-server-1.6.3.901/Makefile.am + + /* Break the DirectColor pixel into its r/g/b components */ +#if XFREE86VNC -+ redPart = (firstColour & miInstalledMaps[cl->pScreen->myNum]->pVisual->redMask) -+ >> miInstalledMaps[cl->pScreen->myNum]->pVisual->offsetRed; -+ greenPart = (firstColour & miInstalledMaps[cl->pScreen->myNum]->pVisual->greenMask) -+ >> miInstalledMaps[cl->pScreen->myNum]->pVisual->offsetGreen; -+ bluePart = (firstColour & miInstalledMaps[cl->pScreen->myNum]->pVisual->blueMask) -+ >> miInstalledMaps[cl->pScreen->myNum]->pVisual->offsetBlue; ++ redPart = (firstColour & GetInstalledmiColormap(cl->pScreen)->pVisual->redMask) ++ >> GetInstalledmiColormap(cl->pScreen)->pVisual->offsetRed; ++ greenPart = (firstColour & GetInstalledmiColormap(cl->pScreen)->pVisual->greenMask) ++ >> GetInstalledmiColormap(cl->pScreen)->pVisual->offsetGreen; ++ bluePart = (firstColour & GetInstalledmiColormap(cl->pScreen)->pVisual->blueMask) ++ >> GetInstalledmiColormap(cl->pScreen)->pVisual->offsetBlue; +#else + redPart = (firstColour & pVNC->rfbInstalledColormap->pVisual->redMask) + >> pVNC->rfbInstalledColormap->pVisual->offsetRed; @@ -13961,9 +14096,9 @@ Index: xorg-server-1.6.3.901/Makefile.am + scme->firstColour = Swap16IfLE((greenPart << 8) | bluePart); + +#if XFREE86VNC -+ redEntry = (EntryPtr)&miInstalledMaps[cl->pScreen->myNum]->red[redPart]; -+ greenEntry = (EntryPtr)&miInstalledMaps[cl->pScreen->myNum]->green[greenPart]; -+ blueEntry = (EntryPtr)&miInstalledMaps[cl->pScreen->myNum]->blue[bluePart]; ++ redEntry = (EntryPtr)&GetInstalledmiColormap(cl->pScreen)->red[redPart]; ++ greenEntry = (EntryPtr)&GetInstalledmiColormap(cl->pScreen)->green[greenPart]; ++ blueEntry = (EntryPtr)&GetInstalledmiColormap(cl->pScreen)->blue[bluePart]; +#else + redEntry = (EntryPtr)&pVNC->rfbInstalledColormap->red[redPart]; + greenEntry = (EntryPtr)&pVNC->rfbInstalledColormap->green[greenPart]; @@ -14099,7 +14234,7 @@ Index: xorg-server-1.6.3.901/Makefile.am + prev->next = wt->next; + else + windowTable = wt->next; -+ xfree(wt); ++ free(wt); + } + else { + prev = wt; @@ -14119,7 +14254,7 @@ Index: xorg-server-1.6.3.901/Makefile.am + } + + /* o.k, new window so create new slot information */ -+ newRec = (CRWindowTable *)xalloc(sizeof(CRWindowTable)); ++ newRec = (CRWindowTable *)malloc(sizeof(CRWindowTable)); + if (!newRec) { + rfbLog("Out of memory allocating CRWindowTable.\n"); + return; @@ -14289,8 +14424,7 @@ Index: xorg-server-1.6.3.901/Makefile.am + */ + +void -+rfbNewUDPConnection(sock) -+ int sock; ++rfbNewUDPConnection(int sock) +{ + if (write(sock, &ptrAcceleration, 1) < 0) { + rfbLogPerror("rfbNewUDPConnection: write"); @@ -14350,9 +14484,12 @@ Index: xorg-server-1.6.3.901/Makefile.am + rfbDisconnectUDPSock(pScreen); + } +} ---- xorg-server-1.7.99/hw/vnc/rre.c -+++ xorg-server-1.7.99/hw/vnc/rre.c -@@ -0,0 +1,324 @@ +diff --git a/hw/vnc/rre.c b/hw/vnc/rre.c +new file mode 100644 +index 0000000..1848980 +--- /dev/null ++++ b/hw/vnc/rre.c +@@ -0,0 +1,317 @@ +/* + * rre.c + * @@ -14413,9 +14550,8 @@ Index: xorg-server-1.6.3.901/Makefile.am + */ + +Bool -+rfbSendRectEncodingRRE(cl, x, y, w, h) -+ rfbClientPtr cl; -+ int x, y, w, h; ++rfbSendRectEncodingRRE(rfbClientPtr cl, ++ int x, int y, int w, int h) +{ + VNCSCREENPTR(cl->pScreen); + rfbFramebufferUpdateRectHeader rect; @@ -14428,17 +14564,17 @@ Index: xorg-server-1.6.3.901/Makefile.am + if (rreBeforeBufSize < maxRawSize) { + rreBeforeBufSize = maxRawSize; + if (rreBeforeBuf == NULL) -+ rreBeforeBuf = (unsigned char *)xalloc(rreBeforeBufSize); ++ rreBeforeBuf = (unsigned char *)malloc(rreBeforeBufSize); + else -+ rreBeforeBuf = (unsigned char *)xrealloc(rreBeforeBuf, rreBeforeBufSize); ++ rreBeforeBuf = (unsigned char *)realloc(rreBeforeBuf, rreBeforeBufSize); + } + + if (rreAfterBufSize < maxRawSize) { + rreAfterBufSize = maxRawSize; + if (rreAfterBuf == NULL) -+ rreAfterBuf = (unsigned char *)xalloc(rreAfterBufSize); ++ rreAfterBuf = (unsigned char *)malloc(rreAfterBufSize); + else -+ rreAfterBuf = (unsigned char *)xrealloc(rreAfterBuf, rreAfterBufSize); ++ rreAfterBuf = (unsigned char *)realloc(rreAfterBuf, rreAfterBufSize); + } + + (*cl->translateFn)(cl->pScreen, cl->translateLookupTable, @@ -14533,10 +14669,7 @@ Index: xorg-server-1.6.3.901/Makefile.am + +#define DEFINE_SUBRECT_ENCODE(bpp) \ +static int \ -+subrectEncode##bpp(data,w,h) \ -+ CARD##bpp *data; \ -+ int w; \ -+ int h; \ ++ subrectEncode##bpp(CARD##bpp *data, int w, int h) \ +{ \ + CARD##bpp cl; \ + rfbRectangle subrect; \ @@ -14633,10 +14766,7 @@ Index: xorg-server-1.6.3.901/Makefile.am + * getBgColour() gets the most prevalent colour in a byte array. + */ +static CARD32 -+getBgColour(data,size,bpp) -+ char *data; -+ int size; -+ int bpp; ++getBgColour(char *data, int size, int bpp) +{ + +#define NUMCLRS 256 @@ -14677,9 +14807,12 @@ Index: xorg-server-1.6.3.901/Makefile.am + + return maxclr; +} ---- xorg-server-1.7.99/hw/vnc/sockets.c -+++ xorg-server-1.7.99/hw/vnc/sockets.c -@@ -0,0 +1,656 @@ +diff --git a/hw/vnc/sockets.c b/hw/vnc/sockets.c +new file mode 100644 +index 0000000..39eb88a +--- /dev/null ++++ b/hw/vnc/sockets.c +@@ -0,0 +1,648 @@ +/* + * sockets.c - deal with TCP & UDP sockets. + * @@ -15060,10 +15193,7 @@ Index: xorg-server-1.6.3.901/Makefile.am + */ + +int -+ReadExact(sock, buf, len) -+ int sock; -+ char *buf; -+ int len; ++ReadExact(int sock, char *buf, int len) +{ + int n; + fd_set fds; @@ -15122,10 +15252,7 @@ Index: xorg-server-1.6.3.901/Makefile.am + */ + +int -+WriteExact(sock, buf, len) -+ int sock; -+ char *buf; -+ int len; ++WriteExact(int sock, char *buf, int len) +{ + int n; + fd_set fds; @@ -15226,9 +15353,7 @@ Index: xorg-server-1.6.3.901/Makefile.am + + +int -+ConnectToTcpAddr(host, port) -+ char *host; -+ int port; ++ConnectToTcpAddr(char *host, int port) +{ + struct hostent *hp; + int sock, n; @@ -15336,9 +15461,12 @@ Index: xorg-server-1.6.3.901/Makefile.am + return TRUE; +} +#endif ---- xorg-server-1.7.99/hw/vnc/sprite.c -+++ xorg-server-1.7.99/hw/vnc/sprite.c -@@ -0,0 +1,2279 @@ +diff --git a/hw/vnc/sprite.c b/hw/vnc/sprite.c +new file mode 100644 +index 0000000..0b7f252 +--- /dev/null ++++ b/hw/vnc/sprite.c +@@ -0,0 +1,2088 @@ +/* + * sprite.c + * @@ -15428,32 +15556,24 @@ Index: xorg-server-1.6.3.901/Makefile.am + DDXPointPtr ppt, int *pwidth, int nspans, + char *pdstStart); +static void rfbSpriteSourceValidate(DrawablePtr pDrawable, int x, int y, -+ int width, int height); ++ int width, int height, ++ unsigned int subWIndowMode); +static Bool rfbSpriteCreateGC(GCPtr pGC); -+static void rfbSpriteBlockHandler(int i, pointer blockData, -+ pointer pTimeout, -+ pointer pReadMask); +static void rfbSpriteInstallColormap(ColormapPtr pMap); +static void rfbSpriteStoreColors(ColormapPtr pMap, int ndef, + xColorItem *pdef); + -+static void rfbSpritePaintWindowBackground(WindowPtr pWin, -+ RegionPtr pRegion, int what); -+static void rfbSpritePaintWindowBorder(WindowPtr pWin, -+ RegionPtr pRegion, int what); +static void rfbSpriteCopyWindow(WindowPtr pWin, DDXPointRec ptOldOrg, + RegionPtr pRegion); +static void rfbSpriteClearToBackground(WindowPtr pWin, int x, int y, + int w, int h, + Bool generateExposures); + -+static void rfbSpriteSaveDoomedAreas(WindowPtr pWin, -+ RegionPtr pObscured, int dx, -+ int dy); -+static RegionPtr rfbSpriteRestoreAreas(WindowPtr pWin, RegionPtr pRgnExposed); +static void rfbSpriteComputeSaved(ScreenPtr pScreen); + -+static DevPrivateKey rfbSpriteScreenKey = &rfbSpriteScreenKey; ++static DevPrivateKeyRec rfbSpriteScreenKeyRec; ++#define rfbSpriteScreenKey (&rfbSpriteScreenKeyRec) ++ + +#define SCREEN_PROLOGUE(pScreen, field) ((pScreen)->field = \ + ((rfbSpriteScreenPtr)dixLookupPrivate(&(pScreen)->devPrivates, \ @@ -15485,7 +15605,8 @@ Index: xorg-server-1.6.3.901/Makefile.am + rfbSpriteCopyClip, +}; + -+static DevPrivateKey rfbSpriteGCKey = &rfbSpriteGCKey; ++static DevPrivateKeyRec rfbSpriteGCKeyRec; ++#define rfbSpriteGCKey (&rfbSpriteGCKeyRec) + +#define GC_FUNC_PROLOGUE(pGC) \ + rfbSpriteGCPtr pGCPriv = \ @@ -15630,23 +15751,27 @@ Index: xorg-server-1.6.3.901/Makefile.am + * pointer-sprite method table + */ + -+static Bool rfbSpriteRealizeCursor (ScreenPtr pScreen, CursorPtr pCursor); -+static Bool rfbSpriteUnrealizeCursor (ScreenPtr pScreen, CursorPtr pCursor); -+static void rfbSpriteSetCursor (ScreenPtr pScreen, CursorPtr pCursor, int x, int y); -+static void rfbSpriteMoveCursor (ScreenPtr pScreen, int x, int y); ++static Bool rfbSpriteRealizeCursor (DeviceIntPtr pDev, ScreenPtr pScreen, CursorPtr pCursor); ++static Bool rfbSpriteUnrealizeCursor (DeviceIntPtr pDev, ScreenPtr pScreen, CursorPtr pCursor); ++static void rfbSpriteSetCursor (DeviceIntPtr pDev, ScreenPtr pScreen, CursorPtr pCursor, int x, int y); ++static void rfbSpriteMoveCursor (DeviceIntPtr pDev, ScreenPtr pScreen, int x, int y); ++static Bool rfbSpriteInitializeCursor (DeviceIntPtr pDev, ScreenPtr pScreen); ++static void rfbSpriteCleanupCursor (DeviceIntPtr pDev, ScreenPtr pScreen); + +miPointerSpriteFuncRec rfbSpritePointerFuncs = { + rfbSpriteRealizeCursor, + rfbSpriteUnrealizeCursor, + rfbSpriteSetCursor, + rfbSpriteMoveCursor, ++ rfbSpriteInitializeCursor, ++ rfbSpriteCleanupCursor, +}; + +/* + * other misc functions + */ + -+static Bool rfbDisplayCursor (ScreenPtr pScreen, CursorPtr pCursor); ++static Bool rfbDisplayCursor (DeviceIntPtr pDev, ScreenPtr pScreen, CursorPtr pCursor); + + +/* @@ -15656,23 +15781,24 @@ Index: xorg-server-1.6.3.901/Makefile.am + */ + +Bool -+rfbSpriteInitialize (pScreen, cursorFuncs, screenFuncs) -+ ScreenPtr pScreen; -+ rfbSpriteCursorFuncPtr cursorFuncs; -+ miPointerScreenFuncPtr screenFuncs; ++rfbSpriteInitialize (ScreenPtr pScreen, rfbSpriteCursorFuncPtr cursorFuncs, ++ miPointerScreenFuncPtr screenFuncs) +{ + rfbSpriteScreenPtr pPriv; + VisualPtr pVisual; + -+ if (!dixRequestPrivate(rfbSpriteGCKey, sizeof(rfbSpriteGCRec))) ++ if (!dixRegisterPrivateKey(rfbSpriteScreenKey, PRIVATE_SCREEN, 0)) + return FALSE; + -+ pPriv = (rfbSpriteScreenPtr) xalloc (sizeof (rfbSpriteScreenRec)); ++ if (!dixRegisterPrivateKey(rfbSpriteGCKey, PRIVATE_GC, sizeof(rfbSpriteGCRec))) ++ return FALSE; ++ ++ pPriv = (rfbSpriteScreenPtr) malloc (sizeof (rfbSpriteScreenRec)); + if (!pPriv) + return FALSE; + if (!miPointerInitialize (pScreen, &rfbSpritePointerFuncs, screenFuncs,TRUE)) + { -+ xfree ((pointer) pPriv); ++ free ((pointer) pPriv); + return FALSE; + } + for (pVisual = pScreen->visuals; @@ -15685,21 +15811,13 @@ Index: xorg-server-1.6.3.901/Makefile.am + pPriv->GetSpans = pScreen->GetSpans; + pPriv->SourceValidate = pScreen->SourceValidate; + pPriv->CreateGC = pScreen->CreateGC; -+#if 0 -+ pPriv->BlockHandler = pScreen->BlockHandler; -+#endif + pPriv->InstallColormap = pScreen->InstallColormap; + pPriv->StoreColors = pScreen->StoreColors; + pPriv->DisplayCursor = pScreen->DisplayCursor; + -+ pPriv->PaintWindowBackground = pScreen->PaintWindowBackground; -+ pPriv->PaintWindowBorder = pScreen->PaintWindowBorder; + pPriv->CopyWindow = pScreen->CopyWindow; + pPriv->ClearToBackground = pScreen->ClearToBackground; + -+ pPriv->SaveDoomedAreas = pScreen->SaveDoomedAreas; -+ pPriv->RestoreAreas = pScreen->RestoreAreas; -+ + pPriv->pCursor = NULL; + pPriv->x = 0; + pPriv->y = 0; @@ -15722,20 +15840,12 @@ Index: xorg-server-1.6.3.901/Makefile.am + pScreen->GetSpans = rfbSpriteGetSpans; + pScreen->SourceValidate = rfbSpriteSourceValidate; + pScreen->CreateGC = rfbSpriteCreateGC; -+#if 0 -+ pScreen->BlockHandler = rfbSpriteBlockHandler; -+#endif + pScreen->InstallColormap = rfbSpriteInstallColormap; + pScreen->StoreColors = rfbSpriteStoreColors; + -+ pScreen->PaintWindowBackground = rfbSpritePaintWindowBackground; -+ pScreen->PaintWindowBorder = rfbSpritePaintWindowBorder; + pScreen->CopyWindow = rfbSpriteCopyWindow; + pScreen->ClearToBackground = rfbSpriteClearToBackground; + -+ pScreen->SaveDoomedAreas = rfbSpriteSaveDoomedAreas; -+ pScreen->RestoreAreas = rfbSpriteRestoreAreas; -+ + pScreen->DisplayCursor = rfbDisplayCursor; + + return TRUE; @@ -15751,8 +15861,7 @@ Index: xorg-server-1.6.3.901/Makefile.am + */ + +static Bool -+rfbSpriteCloseScreen (i, pScreen) -+ ScreenPtr pScreen; ++rfbSpriteCloseScreen (int i, ScreenPtr pScreen) +{ + rfbSpriteScreenPtr pScreenPriv; + @@ -15764,32 +15873,24 @@ Index: xorg-server-1.6.3.901/Makefile.am + pScreen->GetSpans = pScreenPriv->GetSpans; + pScreen->SourceValidate = pScreenPriv->SourceValidate; + pScreen->CreateGC = pScreenPriv->CreateGC; -+#if 0 -+ pScreen->BlockHandler = pScreenPriv->BlockHandler; -+#endif + pScreen->InstallColormap = pScreenPriv->InstallColormap; + pScreen->StoreColors = pScreenPriv->StoreColors; + -+ pScreen->PaintWindowBackground = pScreenPriv->PaintWindowBackground; -+ pScreen->PaintWindowBorder = pScreenPriv->PaintWindowBorder; + pScreen->CopyWindow = pScreenPriv->CopyWindow; + pScreen->ClearToBackground = pScreenPriv->ClearToBackground; + -+ pScreen->SaveDoomedAreas = pScreenPriv->SaveDoomedAreas; -+ pScreen->RestoreAreas = pScreenPriv->RestoreAreas; -+ -+ xfree ((pointer) pScreenPriv); ++ free ((pointer) pScreenPriv); + + return (*pScreen->CloseScreen) (i, pScreen); +} + +static void -+rfbSpriteGetImage (pDrawable, sx, sy, w, h, format, planemask, pdstLine) -+ DrawablePtr pDrawable; -+ int sx, sy, w, h; -+ unsigned int format; -+ unsigned long planemask; -+ char *pdstLine; ++rfbSpriteGetImage (DrawablePtr pDrawable, ++ int sx, int sy, int w, int h, ++ unsigned int format, ++ unsigned long planemask, ++ char *pdstLine ++) +{ + ScreenPtr pScreen = pDrawable->pScreen; + rfbSpriteScreenPtr pScreenPriv; @@ -15814,13 +15915,12 @@ Index: xorg-server-1.6.3.901/Makefile.am +} + +static void -+rfbSpriteGetSpans (pDrawable, wMax, ppt, pwidth, nspans, pdstStart) -+ DrawablePtr pDrawable; -+ int wMax; -+ DDXPointPtr ppt; -+ int *pwidth; -+ int nspans; -+ char *pdstStart; ++rfbSpriteGetSpans (DrawablePtr pDrawable, ++ int wMax, ++ DDXPointPtr ppt, ++ int *pwidth, ++ int nspans, ++ char *pdstStart) +{ + ScreenPtr pScreen = pDrawable->pScreen; + rfbSpriteScreenPtr pScreenPriv; @@ -15861,9 +15961,8 @@ Index: xorg-server-1.6.3.901/Makefile.am +} + +static void -+rfbSpriteSourceValidate (pDrawable, x, y, width, height) -+ DrawablePtr pDrawable; -+ int x, y, width, height; ++rfbSpriteSourceValidate (DrawablePtr pDrawable, int x, int y, int width, int height, ++ unsigned int subWindowMode) +{ + ScreenPtr pScreen = pDrawable->pScreen; + rfbSpriteScreenPtr pScreenPriv; @@ -15878,18 +15977,17 @@ Index: xorg-server-1.6.3.901/Makefile.am + ORG_OVERLAP(&pScreenPriv->saved, pDrawable->x, pDrawable->y, + x, y, width, height)) + { -+ rfbSpriteRemoveCursor (pScreen); ++ rfbSpriteRemoveCursor ( pScreen); + } + + if (pScreen->SourceValidate) -+ (*pScreen->SourceValidate) (pDrawable, x, y, width, height); ++ (*pScreen->SourceValidate) (pDrawable, x, y, width, height, subWindowMode); + + SCREEN_EPILOGUE (pScreen, SourceValidate, rfbSpriteSourceValidate); +} + +static Bool -+rfbSpriteCreateGC (pGC) -+ GCPtr pGC; ++rfbSpriteCreateGC (GCPtr pGC) +{ + ScreenPtr pScreen = pGC->pScreen; + Bool ret; @@ -15911,32 +16009,7 @@ Index: xorg-server-1.6.3.901/Makefile.am +} + +static void -+rfbSpriteBlockHandler (i, blockData, pTimeout, pReadmask) -+ int i; -+ pointer blockData; -+ pointer pTimeout; -+ pointer pReadmask; -+{ -+ ScreenPtr pScreen = screenInfo.screens[i]; -+ rfbSpriteScreenPtr pPriv; -+ VNCSCREENPTR(pScreen); -+ -+ pPriv = (rfbSpriteScreenPtr)dixLookupPrivate(&pScreen->devPrivates, -+ rfbSpriteScreenKey); -+ -+ SCREEN_PROLOGUE(pScreen, BlockHandler); -+ -+ (*pScreen->BlockHandler) (i, blockData, pTimeout, pReadmask); -+ -+ SCREEN_EPILOGUE(pScreen, BlockHandler, rfbSpriteBlockHandler); -+ -+ if (!pVNC->cursorIsDrawn && pPriv->shouldBeUp) -+ rfbSpriteRestoreCursor (pScreen); -+} -+ -+static void -+rfbSpriteInstallColormap (pMap) -+ ColormapPtr pMap; ++rfbSpriteInstallColormap (ColormapPtr pMap) +{ + ScreenPtr pScreen = pMap->pScreen; + rfbSpriteScreenPtr pPriv; @@ -15961,10 +16034,9 @@ Index: xorg-server-1.6.3.901/Makefile.am +} + +static void -+rfbSpriteStoreColors (pMap, ndef, pdef) -+ ColormapPtr pMap; -+ int ndef; -+ xColorItem *pdef; ++rfbSpriteStoreColors (ColormapPtr pMap, ++ int ndef, ++ xColorItem *pdef) +{ + ScreenPtr pScreen = pMap->pScreen; + rfbSpriteScreenPtr pPriv; @@ -16075,138 +16147,13 @@ Index: xorg-server-1.6.3.901/Makefile.am +} + +/* -+ * BackingStore wrappers -+ */ -+ -+static void -+rfbSpriteSaveDoomedAreas (pWin, pObscured, dx, dy) -+ WindowPtr pWin; -+ RegionPtr pObscured; -+ int dx, dy; -+{ -+ ScreenPtr pScreen = pWin->drawable.pScreen; -+ rfbSpriteScreenPtr pScreenPriv; -+ BoxRec cursorBox; -+ VNCSCREENPTR(pScreen); -+ -+ SCREEN_PROLOGUE (pScreen, SaveDoomedAreas); -+ -+ pScreenPriv = (rfbSpriteScreenPtr)dixLookupPrivate(&pScreen->devPrivates, -+ rfbSpriteScreenKey); -+ if (pVNC->cursorIsDrawn) -+ { -+ cursorBox = pScreenPriv->saved; -+ -+ if (dx || dy) -+ { -+ cursorBox.x1 += dx; -+ cursorBox.y1 += dy; -+ cursorBox.x2 += dx; -+ cursorBox.y2 += dy; -+ } -+ if (RECT_IN_REGION( pScreen, pObscured, &cursorBox) != rgnOUT) -+ rfbSpriteRemoveCursor (pScreen); -+ } -+ -+ (*pScreen->SaveDoomedAreas) (pWin, pObscured, dx, dy); -+ -+ SCREEN_EPILOGUE (pScreen, SaveDoomedAreas, rfbSpriteSaveDoomedAreas); -+} -+ -+static RegionPtr -+rfbSpriteRestoreAreas (pWin, prgnExposed) -+ WindowPtr pWin; -+ RegionPtr prgnExposed; -+{ -+ ScreenPtr pScreen = pWin->drawable.pScreen; -+ rfbSpriteScreenPtr pScreenPriv; -+ RegionPtr result; -+ VNCSCREENPTR(pScreen); -+ -+ SCREEN_PROLOGUE (pScreen, RestoreAreas); -+ -+ pScreenPriv = (rfbSpriteScreenPtr)dixLookupPrivate(&pScreen->devPrivates, -+ rfbSpriteScreenKey); -+ if (pVNC->cursorIsDrawn) -+ { -+ if (RECT_IN_REGION( pScreen, prgnExposed, &pScreenPriv->saved) != rgnOUT) -+ rfbSpriteRemoveCursor (pScreen); -+ } -+ -+ result = (*pScreen->RestoreAreas) (pWin, prgnExposed); -+ -+ SCREEN_EPILOGUE (pScreen, RestoreAreas, rfbSpriteRestoreAreas); -+ -+ return result; -+} -+ -+/* + * Window wrappers + */ + +static void -+rfbSpritePaintWindowBackground (pWin, pRegion, what) -+ WindowPtr pWin; -+ RegionPtr pRegion; -+ int what; -+{ -+ ScreenPtr pScreen = pWin->drawable.pScreen; -+ rfbSpriteScreenPtr pScreenPriv; -+ VNCSCREENPTR(pScreen); -+ -+ SCREEN_PROLOGUE (pScreen, PaintWindowBackground); -+ -+ pScreenPriv = (rfbSpriteScreenPtr)dixLookupPrivate(&pScreen->devPrivates, -+ rfbSpriteScreenKey); -+ if (pVNC->cursorIsDrawn) -+ { -+ /* -+ * If the cursor is on the same screen as the window, check the -+ * region to paint for the cursor and remove it as necessary -+ */ -+ if (RECT_IN_REGION( pScreen, pRegion, &pScreenPriv->saved) != rgnOUT) -+ rfbSpriteRemoveCursor (pScreen); -+ } -+ -+ (*pScreen->PaintWindowBackground) (pWin, pRegion, what); -+ -+ SCREEN_EPILOGUE (pScreen, PaintWindowBackground, rfbSpritePaintWindowBackground); -+} -+ -+static void -+rfbSpritePaintWindowBorder (pWin, pRegion, what) -+ WindowPtr pWin; -+ RegionPtr pRegion; -+ int what; -+{ -+ ScreenPtr pScreen = pWin->drawable.pScreen; -+ rfbSpriteScreenPtr pScreenPriv; -+ VNCSCREENPTR(pScreen); -+ -+ SCREEN_PROLOGUE (pScreen, PaintWindowBorder); -+ -+ pScreenPriv = (rfbSpriteScreenPtr)dixLookupPrivate(&pScreen->devPrivates, -+ rfbSpriteScreenKey); -+ if (pVNC->cursorIsDrawn) -+ { -+ /* -+ * If the cursor is on the same screen as the window, check the -+ * region to paint for the cursor and remove it as necessary -+ */ -+ if (RECT_IN_REGION( pScreen, pRegion, &pScreenPriv->saved) != rgnOUT) -+ rfbSpriteRemoveCursor (pScreen); -+ } -+ -+ (*pScreen->PaintWindowBorder) (pWin, pRegion, what); -+ -+ SCREEN_EPILOGUE (pScreen, PaintWindowBorder, rfbSpritePaintWindowBorder); -+} -+ -+static void -+rfbSpriteCopyWindow (pWin, ptOldOrg, pRegion) -+ WindowPtr pWin; -+ DDXPointRec ptOldOrg; -+ RegionPtr pRegion; ++rfbSpriteCopyWindow ( WindowPtr pWin, ++ DDXPointRec ptOldOrg, ++ RegionPtr pRegion) +{ + ScreenPtr pScreen = pWin->drawable.pScreen; + rfbSpriteScreenPtr pScreenPriv; @@ -16243,11 +16190,12 @@ Index: xorg-server-1.6.3.901/Makefile.am +} + +static void -+rfbSpriteClearToBackground (pWin, x, y, w, h, generateExposures) -+ WindowPtr pWin; -+ short x,y; -+ unsigned short w,h; -+ Bool generateExposures; ++rfbSpriteClearToBackground (WindowPtr pWin, ++ int x, ++ int y, ++ int w, ++ int h, ++ Bool generateExposures) +{ + ScreenPtr pScreen = pWin->drawable.pScreen; + rfbSpriteScreenPtr pScreenPriv; @@ -16281,10 +16229,7 @@ Index: xorg-server-1.6.3.901/Makefile.am + */ + +static void -+rfbSpriteValidateGC (pGC, changes, pDrawable) -+ GCPtr pGC; -+ unsigned long changes; -+ DrawablePtr pDrawable; ++rfbSpriteValidateGC (GCPtr pGC, unsigned long changes, DrawablePtr pDrawable) +{ + GC_FUNC_PROLOGUE (pGC); + @@ -16308,9 +16253,7 @@ Index: xorg-server-1.6.3.901/Makefile.am +} + +static void -+rfbSpriteChangeGC (pGC, mask) -+ GCPtr pGC; -+ unsigned long mask; ++rfbSpriteChangeGC (GCPtr pGC, unsigned long mask) +{ + GC_FUNC_PROLOGUE (pGC); + @@ -16320,9 +16263,7 @@ Index: xorg-server-1.6.3.901/Makefile.am +} + +static void -+rfbSpriteCopyGC (pGCSrc, mask, pGCDst) -+ GCPtr pGCSrc, pGCDst; -+ unsigned long mask; ++rfbSpriteCopyGC (GCPtr pGCSrc, unsigned long mask, GCPtr pGCDst) +{ + GC_FUNC_PROLOGUE (pGCDst); + @@ -16332,8 +16273,7 @@ Index: xorg-server-1.6.3.901/Makefile.am +} + +static void -+rfbSpriteDestroyGC (pGC) -+ GCPtr pGC; ++rfbSpriteDestroyGC (GCPtr pGC) +{ + GC_FUNC_PROLOGUE (pGC); + @@ -16343,11 +16283,7 @@ Index: xorg-server-1.6.3.901/Makefile.am +} + +static void -+rfbSpriteChangeClip (pGC, type, pvalue, nrects) -+ GCPtr pGC; -+ int type; -+ pointer pvalue; -+ int nrects; ++rfbSpriteChangeClip (GCPtr pGC, int type, pointer pvalue, int nrects) +{ + GC_FUNC_PROLOGUE (pGC); + @@ -16357,8 +16293,7 @@ Index: xorg-server-1.6.3.901/Makefile.am +} + +static void -+rfbSpriteCopyClip(pgcDst, pgcSrc) -+ GCPtr pgcDst, pgcSrc; ++rfbSpriteCopyClip(GCPtr pgcDst, GCPtr pgcSrc) +{ + GC_FUNC_PROLOGUE (pgcDst); + @@ -16368,8 +16303,7 @@ Index: xorg-server-1.6.3.901/Makefile.am +} + +static void -+rfbSpriteDestroyClip(pGC) -+ GCPtr pGC; ++rfbSpriteDestroyClip(GCPtr pGC) +{ + GC_FUNC_PROLOGUE (pGC); + @@ -16383,13 +16317,13 @@ Index: xorg-server-1.6.3.901/Makefile.am + */ + +static void -+rfbSpriteFillSpans(pDrawable, pGC, nInit, pptInit, pwidthInit, fSorted) -+ DrawablePtr pDrawable; -+ GCPtr pGC; -+ int nInit; /* number of spans to fill */ -+ DDXPointPtr pptInit; /* pointer to list of start points */ -+ int *pwidthInit; /* pointer to list of n widths */ -+ int fSorted; ++rfbSpriteFillSpans( ++ DrawablePtr pDrawable, ++ GCPtr pGC, ++ int nInit, /* number of spans to fill */ ++ DDXPointPtr pptInit, /* pointer to list of start points */ ++ int *pwidthInit, /* pointer to list of n widths */ ++ int fSorted) +{ + VNCSCREENPTR(pDrawable->pScreen); + @@ -16421,14 +16355,13 @@ Index: xorg-server-1.6.3.901/Makefile.am +} + +static void -+rfbSpriteSetSpans(pDrawable, pGC, psrc, ppt, pwidth, nspans, fSorted) -+ DrawablePtr pDrawable; -+ GCPtr pGC; -+ char *psrc; -+ register DDXPointPtr ppt; -+ int *pwidth; -+ int nspans; -+ int fSorted; ++rfbSpriteSetSpans(DrawablePtr pDrawable, ++ GCPtr pGC, ++ char *psrc, ++ register DDXPointPtr ppt, ++ int *pwidth, ++ int nspans, ++ int fSorted) +{ + VNCSCREENPTR(pDrawable->pScreen); + @@ -16460,16 +16393,16 @@ Index: xorg-server-1.6.3.901/Makefile.am +} + +static void -+rfbSpritePutImage(pDrawable, pGC, depth, x, y, w, h, leftPad, format, pBits) -+ DrawablePtr pDrawable; -+ GCPtr pGC; -+ int depth; -+ int x; -+ int y; -+ int w; -+ int h; -+ int format; -+ char *pBits; ++rfbSpritePutImage(DrawablePtr pDrawable, ++ GCPtr pGC, ++ int depth, ++ int x, ++ int y, ++ int w, ++ int h, ++ int leftPad, ++ int format, ++ char *pBits) +{ + VNCSCREENPTR(pDrawable->pScreen); + @@ -16492,16 +16425,15 @@ Index: xorg-server-1.6.3.901/Makefile.am +} + +static RegionPtr -+rfbSpriteCopyArea (pSrc, pDst, pGC, srcx, srcy, w, h, dstx, dsty) -+ DrawablePtr pSrc; -+ DrawablePtr pDst; -+ GCPtr pGC; -+ int srcx; -+ int srcy; -+ int w; -+ int h; -+ int dstx; -+ int dsty; ++rfbSpriteCopyArea (DrawablePtr pSrc, ++ DrawablePtr pDst, ++ GCPtr pGC, ++ int srcx, ++ int srcy, ++ int w, ++ int h, ++ int dstx, ++ int dsty) +{ + RegionPtr rgn; + VNCSCREENPTR(pGC->pScreen); @@ -16528,17 +16460,16 @@ Index: xorg-server-1.6.3.901/Makefile.am +} + +static RegionPtr -+rfbSpriteCopyPlane (pSrc, pDst, pGC, srcx, srcy, w, h, dstx, dsty, plane) -+ DrawablePtr pSrc; -+ DrawablePtr pDst; -+ register GCPtr pGC; -+ int srcx, -+ srcy; -+ int w, -+ h; -+ int dstx, -+ dsty; -+ unsigned long plane; ++rfbSpriteCopyPlane (DrawablePtr pSrc, ++ DrawablePtr pDst, ++ register GCPtr pGC, ++ int srcx, ++ int srcy, ++ int w, ++ int h, ++ int dstx, ++ int dsty, ++ unsigned long plane) +{ + RegionPtr rgn; + VNCSCREENPTR(pGC->pScreen); @@ -16567,12 +16498,11 @@ Index: xorg-server-1.6.3.901/Makefile.am +} + +static void -+rfbSpritePolyPoint (pDrawable, pGC, mode, npt, pptInit) -+ DrawablePtr pDrawable; -+ GCPtr pGC; -+ int mode; /* Origin or Previous */ -+ int npt; -+ xPoint *pptInit; ++rfbSpritePolyPoint (DrawablePtr pDrawable, ++ GCPtr pGC, ++ int mode, /* Origin or Previous */ ++ int npt, ++ xPoint *pptInit) +{ + xPoint t; + int n; @@ -16627,12 +16557,11 @@ Index: xorg-server-1.6.3.901/Makefile.am +} + +static void -+rfbSpritePolylines (pDrawable, pGC, mode, npt, pptInit) -+ DrawablePtr pDrawable; -+ GCPtr pGC; -+ int mode; -+ int npt; -+ DDXPointPtr pptInit; ++rfbSpritePolylines (DrawablePtr pDrawable, ++ GCPtr pGC, ++ int mode, ++ int npt, ++ DDXPointPtr pptInit) +{ + BoxPtr cursor; + register DDXPointPtr pts; @@ -16703,11 +16632,10 @@ Index: xorg-server-1.6.3.901/Makefile.am +} + +static void -+rfbSpritePolySegment(pDrawable, pGC, nseg, pSegs) -+ DrawablePtr pDrawable; -+ GCPtr pGC; -+ int nseg; -+ xSegment *pSegs; ++rfbSpritePolySegment(DrawablePtr pDrawable, ++ GCPtr pGC, ++ int nseg, ++ xSegment *pSegs) +{ + int n; + register xSegment *segs; @@ -16747,11 +16675,10 @@ Index: xorg-server-1.6.3.901/Makefile.am +} + +static void -+rfbSpritePolyRectangle(pDrawable, pGC, nrects, pRects) -+ DrawablePtr pDrawable; -+ GCPtr pGC; -+ int nrects; -+ xRectangle *pRects; ++rfbSpritePolyRectangle( DrawablePtr pDrawable, ++ GCPtr pGC, ++ int nrects, ++ xRectangle *pRects) +{ + register xRectangle *rects; + BoxPtr cursor; @@ -16791,11 +16718,10 @@ Index: xorg-server-1.6.3.901/Makefile.am +} + +static void -+rfbSpritePolyArc(pDrawable, pGC, narcs, parcs) -+ DrawablePtr pDrawable; -+ register GCPtr pGC; -+ int narcs; -+ xArc *parcs; ++rfbSpritePolyArc(DrawablePtr pDrawable, ++ register GCPtr pGC, ++ int narcs, ++ xArc *parcs) +{ + BoxPtr cursor; + int lw; @@ -16830,12 +16756,12 @@ Index: xorg-server-1.6.3.901/Makefile.am +} + +static void -+rfbSpriteFillPolygon(pDrawable, pGC, shape, mode, count, pPts) -+ register DrawablePtr pDrawable; -+ register GCPtr pGC; -+ int shape, mode; -+ int count; -+ DDXPointPtr pPts; ++rfbSpriteFillPolygon(register DrawablePtr pDrawable, ++ register GCPtr pGC, ++ int shape, ++ int mode, ++ int count, ++ DDXPointPtr pPts) +{ + int x, y, minx, miny, maxx, maxy; + register DDXPointPtr pts; @@ -16904,11 +16830,11 @@ Index: xorg-server-1.6.3.901/Makefile.am +} + +static void -+rfbSpritePolyFillRect(pDrawable, pGC, nrectFill, prectInit) -+ DrawablePtr pDrawable; -+ GCPtr pGC; -+ int nrectFill; /* number of rectangles to fill */ -+ xRectangle *prectInit; /* Pointer to first rectangle to fill */ ++rfbSpritePolyFillRect(DrawablePtr pDrawable, ++ GCPtr pGC, ++ int nrectFill, /* number of rectangles to fill */ ++ xRectangle *prectInit /* Pointer to first rectangle to fill */ ++ ) +{ + VNCSCREENPTR(pDrawable->pScreen); + @@ -16939,11 +16865,11 @@ Index: xorg-server-1.6.3.901/Makefile.am +} + +static void -+rfbSpritePolyFillArc(pDrawable, pGC, narcs, parcs) -+ DrawablePtr pDrawable; -+ GCPtr pGC; -+ int narcs; -+ xArc *parcs; ++rfbSpritePolyFillArc(DrawablePtr pDrawable, ++ GCPtr pGC, ++ int narcs, ++ xArc *parcs ++ ) +{ + VNCSCREENPTR(pDrawable->pScreen); + @@ -17063,13 +16989,12 @@ Index: xorg-server-1.6.3.901/Makefile.am + unsigned long i; + unsigned int n; + int w; -+ void (*drawFunc)() = NULL; + + Bool imageblt; + + imageblt = (textType == TT_IMAGE8) || (textType == TT_IMAGE16); + -+ charinfo = (CharInfoPtr *) xalloc(count * sizeof(CharInfoPtr)); ++ charinfo = (CharInfoPtr *) malloc(count * sizeof(CharInfoPtr)); + if (!charinfo) + return x; + @@ -17091,33 +17016,39 @@ Index: xorg-server-1.6.3.901/Makefile.am + * convert fonts to their internal form in RealizeFont and optimize text directly, we + * want to invoke the text functions here, not the GlyphBlt functions. + */ -+ switch (textType) + { -+ case TT_POLY8: -+ drawFunc = (void (*)())pGC->ops->PolyText8; -+ break; -+ case TT_IMAGE8: -+ drawFunc = pGC->ops->ImageText8; -+ break; -+ case TT_POLY16: -+ drawFunc = (void (*)())pGC->ops->PolyText16; -+ break; -+ case TT_IMAGE16: -+ drawFunc = pGC->ops->ImageText16; -+ break; ++ void (*drawFunc)(DrawablePtr,GCPtr,int,int,int,unsigned short *) = NULL; ++ switch (textType) ++ { ++ case TT_POLY8: ++ drawFunc = (void (*)())pGC->ops->PolyText8; ++ break; ++ case TT_IMAGE8: ++ drawFunc = pGC->ops->ImageText8; ++ break; ++ case TT_POLY16: ++ drawFunc = (void (*)())pGC->ops->PolyText16; ++ break; ++ case TT_IMAGE16: ++ drawFunc = pGC->ops->ImageText16; ++ break; ++ } ++ (*drawFunc) (pDraw, pGC, x, y, (int) count, chars); + } -+ (*drawFunc) (pDraw, pGC, x, y, (int) count, chars); +#else /* don't AVOID_GLYPHBLT */ + /* + * On the other hand, if the device does use GlyphBlt ultimately to do text, we + * don't want to slow it down by invoking the text functions and having them call + * GetGlyphs all over again, so we go directly to the GlyphBlt functions here. + */ -+ drawFunc = imageblt ? pGC->ops->ImageGlyphBlt : pGC->ops->PolyGlyphBlt; -+ (*drawFunc) (pDraw, pGC, x, y, n, charinfo, FONTGLYPHS(pGC->font)); ++ { ++ void (*drawFunc)(DrawablePtr,GCPtr,int,int,unsigned int, CharInfoPtr*, pointer); ++ drawFunc = imageblt ? pGC->ops->ImageGlyphBlt : pGC->ops->PolyGlyphBlt; ++ (*drawFunc) (pDraw, pGC, x, y, n, charinfo, FONTGLYPHS(pGC->font)); ++ } +#endif /* AVOID_GLYPHBLT */ + } -+ xfree(charinfo); ++ free(charinfo); + return x + w; +} + @@ -17164,12 +17095,12 @@ Index: xorg-server-1.6.3.901/Makefile.am +} + +static void -+rfbSpriteImageText8(pDrawable, pGC, x, y, count, chars) -+ DrawablePtr pDrawable; -+ GCPtr pGC; -+ int x, y; -+ int count; -+ char *chars; ++rfbSpriteImageText8(DrawablePtr pDrawable, ++ GCPtr pGC, ++ int x, ++ int y, ++ int count, ++ char *chars) +{ + VNCSCREENPTR(pDrawable->pScreen); + @@ -17187,12 +17118,12 @@ Index: xorg-server-1.6.3.901/Makefile.am +} + +static void -+rfbSpriteImageText16(pDrawable, pGC, x, y, count, chars) -+ DrawablePtr pDrawable; -+ GCPtr pGC; -+ int x, y; -+ int count; -+ unsigned short *chars; ++rfbSpriteImageText16(DrawablePtr pDrawable, ++ GCPtr pGC, ++ int x, ++ int y, ++ int count, ++ unsigned short *chars) +{ + VNCSCREENPTR(pDrawable->pScreen); + @@ -17212,13 +17143,13 @@ Index: xorg-server-1.6.3.901/Makefile.am +} + +static void -+rfbSpriteImageGlyphBlt(pDrawable, pGC, x, y, nglyph, ppci, pglyphBase) -+ DrawablePtr pDrawable; -+ GCPtr pGC; -+ int x, y; -+ unsigned int nglyph; -+ CharInfoPtr *ppci; /* array of character info */ -+ pointer pglyphBase; /* start of array of glyphs */ ++rfbSpriteImageGlyphBlt(DrawablePtr pDrawable, ++ GCPtr pGC, ++ int x, ++ int y, ++ unsigned int nglyph, ++ CharInfoPtr *ppci, /* array of character info */ ++ pointer pglyphBase) /* start of array of glyphs */ +{ + VNCSCREENPTR(pDrawable->pScreen); + @@ -17237,13 +17168,13 @@ Index: xorg-server-1.6.3.901/Makefile.am +} + +static void -+rfbSpritePolyGlyphBlt(pDrawable, pGC, x, y, nglyph, ppci, pglyphBase) -+ DrawablePtr pDrawable; -+ GCPtr pGC; -+ int x, y; -+ unsigned int nglyph; -+ CharInfoPtr *ppci; /* array of character info */ -+ pointer pglyphBase; /* start of array of glyphs */ ++rfbSpritePolyGlyphBlt(DrawablePtr pDrawable, ++ GCPtr pGC, ++ int x, ++ int y, ++ unsigned int nglyph, ++ CharInfoPtr *ppci, /* array of character info */ ++ pointer pglyphBase) /* start of array of glyphs */ +{ + VNCSCREENPTR(pDrawable->pScreen); + @@ -17262,11 +17193,13 @@ Index: xorg-server-1.6.3.901/Makefile.am +} + +static void -+rfbSpritePushPixels(pGC, pBitMap, pDrawable, w, h, x, y) -+ GCPtr pGC; -+ PixmapPtr pBitMap; -+ DrawablePtr pDrawable; -+ int w, h, x, y; ++rfbSpritePushPixels(GCPtr pGC, ++ PixmapPtr pBitMap, ++ DrawablePtr pDrawable, ++ int w, ++ int h, ++ int x, ++ int y) +{ + VNCSCREENPTR(pDrawable->pScreen); + GC_SETUP(pDrawable, pGC); @@ -17304,7 +17237,7 @@ Index: xorg-server-1.6.3.901/Makefile.am +#define SPRITE_PAD 8 + +static Bool -+rfbSpriteRealizeCursor (ScreenPtr pScreen, CursorPtr pCursor) ++rfbSpriteRealizeCursor (DeviceIntPtr pDev, ScreenPtr pScreen, CursorPtr pCursor) +{ + rfbSpriteScreenPtr pScreenPriv; + @@ -17316,7 +17249,7 @@ Index: xorg-server-1.6.3.901/Makefile.am +} + +static Bool -+rfbSpriteUnrealizeCursor (ScreenPtr pScreen, CursorPtr pCursor) ++rfbSpriteUnrealizeCursor (DeviceIntPtr pDev, ScreenPtr pScreen, CursorPtr pCursor) +{ + rfbSpriteScreenPtr pScreenPriv; + @@ -17326,7 +17259,7 @@ Index: xorg-server-1.6.3.901/Makefile.am +} + +static void -+rfbSpriteSetCursor (ScreenPtr pScreen, CursorPtr pCursor, int x, int y) ++rfbSpriteSetCursor (DeviceIntPtr pDev, ScreenPtr pScreen, CursorPtr pCursor, int x, int y) +{ + rfbSpriteScreenPtr pScreenPriv; + rfbClientPtr cl, nextCl; @@ -17441,14 +17374,26 @@ Index: xorg-server-1.6.3.901/Makefile.am + } +} + ++ ++static Bool ++rfbSpriteInitializeCursor (DeviceIntPtr pDev, ScreenPtr pScreen) ++{ ++ return TRUE; ++} ++ +static void -+rfbSpriteMoveCursor (ScreenPtr pScreen, int x, int y) ++rfbSpriteCleanupCursor (DeviceIntPtr pDev, ScreenPtr pScreen) ++{ ++} ++ ++static void ++rfbSpriteMoveCursor (DeviceIntPtr pDev, ScreenPtr pScreen, int x, int y) +{ + rfbSpriteScreenPtr pScreenPriv; + + pScreenPriv = (rfbSpriteScreenPtr)dixLookupPrivate(&pScreen->devPrivates, + rfbSpriteScreenKey); -+ rfbSpriteSetCursor (pScreen, pScreenPriv->pCursor, x, y); ++ rfbSpriteSetCursor (pDev, pScreen, pScreenPriv->pCursor, x, y); +} + +/* @@ -17456,8 +17401,7 @@ Index: xorg-server-1.6.3.901/Makefile.am + */ + +void -+rfbSpriteRemoveCursor (pScreen) -+ ScreenPtr pScreen; ++rfbSpriteRemoveCursor (ScreenPtr pScreen) +{ + rfbSpriteScreenPtr pScreenPriv; + VNCSCREENPTR(pScreen); @@ -17484,8 +17428,7 @@ Index: xorg-server-1.6.3.901/Makefile.am + + +void -+rfbSpriteRestoreCursor (pScreen) -+ ScreenPtr pScreen; ++rfbSpriteRestoreCursor (ScreenPtr pScreen) +{ + rfbSpriteScreenPtr pScreenPriv; + int x, y; @@ -17527,8 +17470,7 @@ Index: xorg-server-1.6.3.901/Makefile.am + */ + +static void -+rfbSpriteComputeSaved (pScreen) -+ ScreenPtr pScreen; ++rfbSpriteComputeSaved (ScreenPtr pScreen) +{ + rfbSpriteScreenPtr pScreenPriv; + int x, y, w, h; @@ -17556,9 +17498,7 @@ Index: xorg-server-1.6.3.901/Makefile.am + */ + +static Bool -+rfbDisplayCursor(pScreen, pCursor) -+ ScreenPtr pScreen; -+ CursorPtr pCursor; ++rfbDisplayCursor(DeviceIntPtr pDev, ScreenPtr pScreen, CursorPtr pCursor) +{ + rfbClientPtr cl; + rfbSpriteScreenPtr pPriv; @@ -17571,7 +17511,7 @@ Index: xorg-server-1.6.3.901/Makefile.am + + pPriv = (rfbSpriteScreenPtr)dixLookupPrivate(&pScreen->devPrivates, + rfbSpriteScreenKey); -+ status = (*pPriv->DisplayCursor)(pScreen, pCursor); ++ status = (*pPriv->DisplayCursor)(pDev, pScreen, pCursor); + + /* send new cursor shape to interested viewers */ + for (cl = rfbClientHead; cl ; cl = cl->next) { @@ -17589,8 +17529,7 @@ Index: xorg-server-1.6.3.901/Makefile.am + */ + +CursorPtr -+rfbSpriteGetCursorPtr (pScreen) -+ ScreenPtr pScreen; ++rfbSpriteGetCursorPtr (ScreenPtr pScreen) +{ + rfbSpriteScreenPtr pScreenPriv; + @@ -17605,9 +17544,7 @@ Index: xorg-server-1.6.3.901/Makefile.am + */ + +void -+rfbSpriteGetCursorPos (pScreen, px, py) -+ ScreenPtr pScreen; -+ int *px, *py; ++rfbSpriteGetCursorPos (ScreenPtr pScreen, int *px, int *py) +{ + rfbSpriteScreenPtr pScreenPriv; + @@ -17618,9 +17555,12 @@ Index: xorg-server-1.6.3.901/Makefile.am + *py = pScreenPriv->y; +} + ---- xorg-server-1.7.99/hw/vnc/sprite.h -+++ xorg-server-1.7.99/hw/vnc/sprite.h -@@ -0,0 +1,141 @@ +diff --git a/hw/vnc/sprite.h b/hw/vnc/sprite.h +new file mode 100644 +index 0000000..d913249 +--- /dev/null ++++ b/hw/vnc/sprite.h +@@ -0,0 +1,131 @@ +/* + * sprite.h + * @@ -17730,41 +17670,34 @@ Index: xorg-server-1.6.3.901/Makefile.am +} rfbSpriteCursorFuncRec, *rfbSpriteCursorFuncPtr; + +extern Bool rfbSpriteInitialize( -+#if NeedFunctionPrototypes + ScreenPtr /*pScreen*/, + rfbSpriteCursorFuncPtr /*cursorFuncs*/, + miPointerScreenFuncPtr /*screenFuncs*/ -+#endif +); + +extern void rfbSpriteRestoreCursor( -+#if NeedFunctionPrototypes + ScreenPtr /*pScreen*/ -+#endif +); + +extern void rfbSpriteRemoveCursor( -+#if NeedFunctionPrototypes + ScreenPtr /*pScreen*/ -+#endif +); + +extern CursorPtr rfbSpriteGetCursorPtr( -+#if NeedFunctionPrototypes + ScreenPtr /*pScreen*/ -+#endif +); + +extern void rfbSpriteGetCursorPos( -+#if NeedFunctionPrototypes + ScreenPtr /*pScreen*/, + int * /*px*/, + int * /*py*/ -+#endif +); ---- xorg-server-1.7.99/hw/vnc/spritest.h -+++ xorg-server-1.7.99/hw/vnc/spritest.h -@@ -0,0 +1,138 @@ +diff --git a/hw/vnc/spritest.h b/hw/vnc/spritest.h +new file mode 100644 +index 0000000..f983dd5 +--- /dev/null ++++ b/hw/vnc/spritest.h +@@ -0,0 +1,134 @@ +/* + * spritest.h + * @@ -17837,12 +17770,8 @@ Index: xorg-server-1.6.3.901/Makefile.am + ScreenBlockHandlerProcPtr BlockHandler; + InstallColormapProcPtr InstallColormap; + StoreColorsProcPtr StoreColors; -+ PaintWindowBackgroundProcPtr PaintWindowBackground; -+ PaintWindowBorderProcPtr PaintWindowBorder; + CopyWindowProcPtr CopyWindow; + ClearToBackgroundProcPtr ClearToBackground; -+ SaveDoomedAreasProcPtr SaveDoomedAreas; -+ RestoreAreasProcPtr RestoreAreas; + DisplayCursorProcPtr DisplayCursor; +#ifdef RENDER + CompositeProcPtr Composite; @@ -17903,8 +17832,11 @@ Index: xorg-server-1.6.3.901/Makefile.am + +#define LINE_OVERLAP(pCbox,x1,y1,x2,y2,lw2) \ + BOX_OVERLAP((pCbox), (x1)-(lw2), (y1)-(lw2), (x2)+(lw2), (y2)+(lw2)) ---- xorg-server-1.7.99/hw/vnc/stats.c -+++ xorg-server-1.7.99/hw/vnc/stats.c +diff --git a/hw/vnc/stats.c b/hw/vnc/stats.c +new file mode 100644 +index 0000000..83366ec +--- /dev/null ++++ b/hw/vnc/stats.c @@ -0,0 +1,117 @@ +/* + * stats.c @@ -18023,8 +17955,11 @@ Index: xorg-server-1.6.3.901/Makefile.am + cl->rfbLastRectBytesSent)); + } +} ---- xorg-server-1.7.99/hw/vnc/symlink-vnc.sh -+++ xorg-server-1.7.99/hw/vnc/symlink-vnc.sh +diff --git a/hw/vnc/symlink-vnc.sh b/hw/vnc/symlink-vnc.sh +new file mode 100644 +index 0000000..b4347a1 +--- /dev/null ++++ b/hw/vnc/symlink-vnc.sh @@ -0,0 +1,198 @@ +#!/bin/sh + @@ -18224,9 +18159,12 @@ Index: xorg-server-1.6.3.901/Makefile.am +} + +main $1 $2 ---- xorg-server-1.7.99/hw/vnc/tableinitcmtemplate.c -+++ xorg-server-1.7.99/hw/vnc/tableinitcmtemplate.c -@@ -0,0 +1,93 @@ +diff --git a/hw/vnc/tableinitcmtemplate.c b/hw/vnc/tableinitcmtemplate.c +new file mode 100644 +index 0000000..233c8a3 +--- /dev/null ++++ b/hw/vnc/tableinitcmtemplate.c +@@ -0,0 +1,95 @@ +/* + * tableinitcmtemplate.c - template for initialising lookup tables for + * translation from a colour map to true colour. @@ -18279,18 +18217,20 @@ Index: xorg-server-1.6.3.901/Makefile.am +rfbInitColourMapSingleTableOUT (ScreenPtr pScreen, char **table, rfbPixelFormat *in, + rfbPixelFormat *out) +{ -+ VNCSCREENPTR(pScreen); + int i, r, g, b; + OUT_T *t; + EntryPtr pent; + int nEntries = 1 << in->bitsPerPixel; ++#ifndef XFREE86VNC ++ VNCSCREENPTR(pScreen); ++#endif + + if (*table) free(*table); + *table = (char *)malloc(nEntries * sizeof(OUT_T)); + t = (OUT_T *)*table; + +#if XFREE86VNC -+ pent = (EntryPtr)&miInstalledMaps[pScreen->myNum]->red[0]; ++ pent = (EntryPtr)&GetInstalledmiColormap(pScreen)->red[0]; +#else + pent = (EntryPtr)&pVNC->rfbInstalledColormap->red[0]; +#endif @@ -18320,8 +18260,11 @@ Index: xorg-server-1.6.3.901/Makefile.am +#undef OUT_T +#undef SwapOUT +#undef rfbInitColourMapSingleTableOUT ---- xorg-server-1.7.99/hw/vnc/tableinittctemplate.c -+++ xorg-server-1.7.99/hw/vnc/tableinittctemplate.c +diff --git a/hw/vnc/tableinittctemplate.c b/hw/vnc/tableinittctemplate.c +new file mode 100644 +index 0000000..1af8a06 +--- /dev/null ++++ b/hw/vnc/tableinittctemplate.c @@ -0,0 +1,146 @@ +/* + * tableinittctemplate.c - template for initialising lookup tables for @@ -18469,8 +18412,11 @@ Index: xorg-server-1.6.3.901/Makefile.am +#undef rfbInitTrueColourSingleTableOUT +#undef rfbInitTrueColourRGBTablesOUT +#undef rfbInitOneRGBTableOUT ---- xorg-server-1.7.99/hw/vnc/tabletranstemplate.c -+++ xorg-server-1.7.99/hw/vnc/tabletranstemplate.c +diff --git a/hw/vnc/tabletranstemplate.c b/hw/vnc/tabletranstemplate.c +new file mode 100644 +index 0000000..87fce96 +--- /dev/null ++++ b/hw/vnc/tabletranstemplate.c @@ -0,0 +1,135 @@ +/* + * tabletranstemplate.c - template for translation using lookup tables. @@ -18541,7 +18487,7 @@ Index: xorg-server-1.6.3.901/Makefile.am + OUT_T *op = (OUT_T *)optr; + OUT_T *opLineEnd; + OUT_T *t = (OUT_T *)table; -+ DrawablePtr pDraw = (DrawablePtr)WindowTable[pScreen->myNum]; ++ DrawablePtr pDraw = (DrawablePtr)pScreen->root; + int truewidth = PixmapBytePad(width, in->bitsPerPixel); + unsigned char *iptr = malloc(truewidth * height * in->bitsPerPixel / 8); + int ipextra = truewidth - width; @@ -18581,7 +18527,7 @@ Index: xorg-server-1.6.3.901/Makefile.am + OUT_T *redTable = (OUT_T *)table; + OUT_T *greenTable = redTable + in->redMax + 1; + OUT_T *blueTable = greenTable + in->greenMax + 1; -+ DrawablePtr pDraw = (DrawablePtr)WindowTable[pScreen->myNum]; ++ DrawablePtr pDraw = (DrawablePtr)pScreen->root; + int truewidth = PixmapBytePad(width, in->bitsPerPixel); + unsigned char *iptr = malloc(truewidth * height * in->bitsPerPixel / 8); + int ipextra = truewidth - width; @@ -18607,9 +18553,12 @@ Index: xorg-server-1.6.3.901/Makefile.am +#undef OUT_T +#undef rfbTranslateWithSingleTableINtoOUT +#undef rfbTranslateWithRGBTablesINtoOUT ---- xorg-server-1.7.99/hw/vnc/tight.c -+++ xorg-server-1.7.99/hw/vnc/tight.c -@@ -0,0 +1,1827 @@ +diff --git a/hw/vnc/tight.c b/hw/vnc/tight.c +new file mode 100644 +index 0000000..5c54736 +--- /dev/null ++++ b/hw/vnc/tight.c +@@ -0,0 +1,1774 @@ +/* + * tight.c + * @@ -18794,9 +18743,8 @@ Index: xorg-server-1.6.3.901/Makefile.am + */ + +int -+rfbNumCodedRectsTight(cl, x, y, w, h) -+ rfbClientPtr cl; -+ int x, y, w, h; ++rfbNumCodedRectsTight(rfbClientPtr cl, ++ int x, int y, int w, int h) +{ + int maxRectSize, maxRectWidth; + int subrectMaxWidth, subrectMaxHeight; @@ -18820,9 +18768,8 @@ Index: xorg-server-1.6.3.901/Makefile.am +} + +Bool -+rfbSendRectEncodingTight(cl, x, y, w, h) -+ rfbClientPtr cl; -+ int x, y, w, h; ++rfbSendRectEncodingTight(rfbClientPtr cl, ++ int x, int y, int w, int h) +{ + VNCSCREENPTR(cl->pScreen); + int nMaxRows; @@ -18845,9 +18792,9 @@ Index: xorg-server-1.6.3.901/Makefile.am + if (tightBeforeBufSize < 4) { + tightBeforeBufSize = 4; + if (tightBeforeBuf == NULL) -+ tightBeforeBuf = (unsigned char *)xalloc(tightBeforeBufSize); ++ tightBeforeBuf = (unsigned char *)malloc(tightBeforeBufSize); + else -+ tightBeforeBuf = (unsigned char *)xrealloc(tightBeforeBuf, ++ tightBeforeBuf = (unsigned char *)realloc(tightBeforeBuf, + tightBeforeBufSize); + } + @@ -18953,11 +18900,10 @@ Index: xorg-server-1.6.3.901/Makefile.am +} + +static void -+FindBestSolidArea(pScreen, x, y, w, h, colorValue, w_ptr, h_ptr) -+ ScreenPtr pScreen; -+ int x, y, w, h; -+ CARD32 colorValue; -+ int *w_ptr, *h_ptr; ++FindBestSolidArea(ScreenPtr pScreen, ++ int x, int y, int w, int h, ++ CARD32 colorValue, ++ int *w_ptr, int *h_ptr) +{ + int dx, dy, dw, dh; + int w_prev; @@ -18995,11 +18941,9 @@ Index: xorg-server-1.6.3.901/Makefile.am +} + +static void -+ExtendSolidArea(pScreen, x, y, w, h, colorValue, x_ptr, y_ptr, w_ptr, h_ptr) -+ ScreenPtr pScreen; -+ int x, y, w, h; -+ CARD32 colorValue; -+ int *x_ptr, *y_ptr, *w_ptr, *h_ptr; ++ExtendSolidArea(ScreenPtr pScreen, int x, int y, int w, int h, ++ CARD32 colorValue, ++ int *x_ptr, int *y_ptr, int *w_ptr, int *h_ptr) +{ + int cx, cy; + @@ -19040,11 +18984,8 @@ Index: xorg-server-1.6.3.901/Makefile.am + */ + +static Bool -+CheckSolidTile(pScreen, x, y, w, h, colorPtr, needSameColor) -+ ScreenPtr pScreen; -+ int x, y, w, h; -+ CARD32 *colorPtr; -+ Bool needSameColor; ++CheckSolidTile(ScreenPtr pScreen, int x, int y, int w, int h, CARD32 *colorPtr, ++ Bool needSameColor) +{ + VNCSCREENPTR(pScreen); + switch(pVNC->rfbServerFormat.bitsPerPixel) { @@ -19060,11 +19001,8 @@ Index: xorg-server-1.6.3.901/Makefile.am +#define DEFINE_CHECK_SOLID_FUNCTION(bpp) \ + \ +static Bool \ -+CheckSolidTile##bpp(pScreen, x, y, w, h, colorPtr, needSameColor) \ -+ ScreenPtr pScreen; \ -+ int x, y; \ -+ CARD32 *colorPtr; \ -+ Bool needSameColor; \ ++ CheckSolidTile##bpp(ScreenPtr pScreen, int x, int y, int w, int h, \ ++ CARD32 *colorPtr, Bool needSameColor) \ +{ \ + VNCSCREENPTR(pScreen); \ + CARD##bpp *fbptr; \ @@ -19095,9 +19033,7 @@ Index: xorg-server-1.6.3.901/Makefile.am +DEFINE_CHECK_SOLID_FUNCTION(32) + +static Bool -+SendRectSimple(cl, x, y, w, h) -+ rfbClientPtr cl; -+ int x, y, w, h; ++SendRectSimple(rfbClientPtr cl, int x, int y, int w, int h) +{ + int maxBeforeSize, maxAfterSize; + int maxRectSize, maxRectWidth; @@ -19114,18 +19050,18 @@ Index: xorg-server-1.6.3.901/Makefile.am + if (tightBeforeBufSize < maxBeforeSize) { + tightBeforeBufSize = maxBeforeSize; + if (tightBeforeBuf == NULL) -+ tightBeforeBuf = (unsigned char *)xalloc(tightBeforeBufSize); ++ tightBeforeBuf = (unsigned char *)malloc(tightBeforeBufSize); + else -+ tightBeforeBuf = (unsigned char *)xrealloc(tightBeforeBuf, ++ tightBeforeBuf = (unsigned char *)realloc(tightBeforeBuf, + tightBeforeBufSize); + } + + if (tightAfterBufSize < maxAfterSize) { + tightAfterBufSize = maxAfterSize; + if (tightAfterBuf == NULL) -+ tightAfterBuf = (unsigned char *)xalloc(tightAfterBufSize); ++ tightAfterBuf = (unsigned char *)malloc(tightAfterBufSize); + else -+ tightAfterBuf = (unsigned char *)xrealloc(tightAfterBuf, ++ tightAfterBuf = (unsigned char *)realloc(tightAfterBuf, + tightAfterBufSize); + } + @@ -19150,9 +19086,7 @@ Index: xorg-server-1.6.3.901/Makefile.am +} + +static Bool -+SendSubrect(cl, x, y, w, h) -+ rfbClientPtr cl; -+ int x, y, w, h; ++SendSubrect(rfbClientPtr cl, int x, int y, int w, int h) +{ + VNCSCREENPTR(cl->pScreen); + Bool success = FALSE; @@ -19223,9 +19157,7 @@ Index: xorg-server-1.6.3.901/Makefile.am +} + +static Bool -+SendTightHeader(cl, x, y, w, h) -+ rfbClientPtr cl; -+ int x, y, w, h; ++SendTightHeader(rfbClientPtr cl, int x, int y, int w, int h) +{ + VNCSCREENPTR(cl->pScreen); + rfbFramebufferUpdateRectHeader rect; @@ -19256,8 +19188,7 @@ Index: xorg-server-1.6.3.901/Makefile.am + */ + +static Bool -+SendSolidRect(cl) -+ rfbClientPtr cl; ++SendSolidRect(rfbClientPtr cl) +{ + VNCSCREENPTR(cl->pScreen); + int len; @@ -19283,9 +19214,7 @@ Index: xorg-server-1.6.3.901/Makefile.am +} + +static Bool -+SendMonoRect(cl, w, h) -+ rfbClientPtr cl; -+ int w, h; ++SendMonoRect(rfbClientPtr cl, int w, int h) +{ + VNCSCREENPTR(cl->pScreen); + int streamId = 1; @@ -19349,9 +19278,7 @@ Index: xorg-server-1.6.3.901/Makefile.am +} + +static Bool -+SendIndexedRect(cl, w, h) -+ rfbClientPtr cl; -+ int w, h; ++SendIndexedRect(rfbClientPtr cl, int w, int h) +{ + VNCSCREENPTR(cl->pScreen); + int streamId = 2; @@ -19412,9 +19339,7 @@ Index: xorg-server-1.6.3.901/Makefile.am +} + +static Bool -+SendFullColorRect(cl, w, h) -+ rfbClientPtr cl; -+ int w, h; ++SendFullColorRect(rfbClientPtr cl, int w, int h) +{ + VNCSCREENPTR(cl->pScreen); + int streamId = 0; @@ -19440,9 +19365,7 @@ Index: xorg-server-1.6.3.901/Makefile.am +} + +static Bool -+SendGradientRect(cl, w, h) -+ rfbClientPtr cl; -+ int w, h; ++SendGradientRect(rfbClientPtr cl, int w, int h) +{ + VNCSCREENPTR(cl->pScreen); + int streamId = 3; @@ -19457,7 +19380,7 @@ Index: xorg-server-1.6.3.901/Makefile.am + } + + if (prevRowBuf == NULL) -+ prevRowBuf = (int *)xalloc(2048 * 3 * sizeof(int)); ++ prevRowBuf = (int *)malloc(2048 * 3 * sizeof(int)); + + pVNC->updateBuf[pVNC->ublen++] = (streamId | rfbTightExplicitFilter) << 4; + pVNC->updateBuf[pVNC->ublen++] = rfbTightFilterGradient; @@ -19484,9 +19407,7 @@ Index: xorg-server-1.6.3.901/Makefile.am + * \param dataLen - amount of data in tightBeforeBuf to compress, in bytes + */ +static Bool -+CompressData(cl, streamId, dataLen, zlibLevel, zlibStrategy) -+ rfbClientPtr cl; -+ int streamId, dataLen, zlibLevel, zlibStrategy; ++CompressData(rfbClientPtr cl, int streamId, int dataLen, int zlibLevel, int zlibStrategy) +{ + VNCSCREENPTR(cl->pScreen); + z_streamp pz; @@ -19539,9 +19460,7 @@ Index: xorg-server-1.6.3.901/Makefile.am + return SendCompressedData(cl, tightAfterBufSize - pz->avail_out); +} + -+static Bool SendCompressedData(cl, compressedLen) -+ rfbClientPtr cl; -+ int compressedLen; ++static Bool SendCompressedData(rfbClientPtr cl, int compressedLen) +{ + VNCSCREENPTR(cl->pScreen); + int i, portionLen; @@ -19580,8 +19499,7 @@ Index: xorg-server-1.6.3.901/Makefile.am + */ + +static void -+FillPalette8(count) -+ int count; ++FillPalette8(int count) +{ + CARD8 *data = (CARD8 *)tightBeforeBuf; + CARD8 c0, c1; @@ -19625,8 +19543,8 @@ Index: xorg-server-1.6.3.901/Makefile.am +#define DEFINE_FILL_PALETTE_FUNCTION(bpp) \ + \ +static void \ -+FillPalette##bpp(count) \ -+ int count; \ ++FillPalette##bpp(int count) \ ++ \ +{ \ + CARD##bpp *data = (CARD##bpp *)tightBeforeBuf; \ + CARD##bpp c0, c1, ci = 0; \ @@ -19774,11 +19692,9 @@ Index: xorg-server-1.6.3.901/Makefile.am + * Color components assumed to be byte-aligned. + */ + -+static void Pack24(pScreen, buf, fmt, count) -+ ScreenPtr pScreen; -+ unsigned char *buf; -+ rfbPixelFormat *fmt; -+ int count; ++static void Pack24(ScreenPtr pScreen, unsigned char *buf, ++ rfbPixelFormat *fmt, ++ int count) +{ + VNCSCREENPTR(pScreen); + CARD32 *buf32; @@ -19813,9 +19729,7 @@ Index: xorg-server-1.6.3.901/Makefile.am +#define DEFINE_IDX_ENCODE_FUNCTION(bpp) \ + \ +static void \ -+EncodeIndexedRect##bpp(buf, count) \ -+ CARD8 *buf; \ -+ int count; \ ++EncodeIndexedRect##bpp(CARD8 *buf, int count) \ +{ \ + COLOR_LIST *pnode; \ + CARD##bpp *src; \ @@ -19850,9 +19764,7 @@ Index: xorg-server-1.6.3.901/Makefile.am +#define DEFINE_MONO_ENCODE_FUNCTION(bpp) \ + \ +static void \ -+EncodeMonoRect##bpp(buf, w, h) \ -+ CARD8 *buf; \ -+ int w, h; \ ++EncodeMonoRect##bpp(CARD8 *buf, int w, int h) \ +{ \ + CARD##bpp *ptr; \ + CARD##bpp bg; \ @@ -19912,11 +19824,7 @@ Index: xorg-server-1.6.3.901/Makefile.am + */ + +static void -+FilterGradient24(pScreen, buf, fmt, w, h) -+ ScreenPtr pScreen; -+ unsigned char *buf; -+ rfbPixelFormat *fmt; -+ int w, h; ++FilterGradient24(ScreenPtr pScreen, unsigned char *buf, rfbPixelFormat *fmt, int w, int h) +{ + VNCSCREENPTR(pScreen); + CARD32 *buf32; @@ -19975,11 +19883,8 @@ Index: xorg-server-1.6.3.901/Makefile.am +#define DEFINE_GRADIENT_FILTER_FUNCTION(bpp) \ + \ +static void \ -+FilterGradient##bpp(pScreen, buf, fmt, w, h) \ -+ ScreenPtr pScreen; \ -+ CARD##bpp *buf; \ -+ rfbPixelFormat *fmt; \ -+ int w, h; \ ++FilterGradient##bpp(ScreenPtr pScreen, CARD##bpp *buf, \ ++rfbPixelFormat *fmt, int w, int h) \ +{ \ + VNCSCREENPTR(pScreen); \ + CARD##bpp pix, diff; \ @@ -20053,10 +19958,7 @@ Index: xorg-server-1.6.3.901/Makefile.am +#define DETECT_MIN_HEIGHT 8 + +static int -+DetectSmoothImage (cl, fmt, w, h) -+ rfbClientPtr cl; -+ rfbPixelFormat *fmt; -+ int w, h; ++DetectSmoothImage (rfbClientPtr cl, rfbPixelFormat *fmt, int w, int h) +{ + VNCSCREENPTR(cl->pScreen); + unsigned long avgError; @@ -20097,10 +19999,7 @@ Index: xorg-server-1.6.3.901/Makefile.am +} + +static unsigned long -+DetectSmoothImage24 (cl, fmt, w, h) -+ rfbClientPtr cl; -+ rfbPixelFormat *fmt; -+ int w, h; ++DetectSmoothImage24 (rfbClientPtr cl, rfbPixelFormat *fmt, int w, int h) +{ + int off; + int x, y, d, dx, c; @@ -20159,10 +20058,7 @@ Index: xorg-server-1.6.3.901/Makefile.am +#define DEFINE_DETECT_FUNCTION(bpp) \ + \ +static unsigned long \ -+DetectSmoothImage##bpp (cl, fmt, w, h) \ -+ rfbClientPtr cl; \ -+ rfbPixelFormat *fmt; \ -+ int w, h; \ ++DetectSmoothImage##bpp (rfbClientPtr cl, rfbPixelFormat *fmt, int w, int h) \ +{ \ + VNCSCREENPTR(cl->pScreen); \ + Bool endianMismatch; \ @@ -20271,7 +20167,7 @@ Index: xorg-server-1.6.3.901/Makefile.am + if (pVNC->rfbServerFormat.bitsPerPixel == 8) + return SendFullColorRect(cl, w, h); + -+ srcBuf = (CARD8 *)xalloc(w * 3); ++ srcBuf = (CARD8 *)malloc(w * 3); + if (srcBuf == NULL) { + return SendFullColorRect(cl, w, h); + } @@ -20303,7 +20199,7 @@ Index: xorg-server-1.6.3.901/Makefile.am + jpeg_finish_compress(&cinfo); + + jpeg_destroy_compress(&cinfo); -+ xfree((char *)srcBuf); ++ free((char *)srcBuf); + + if (jpegError) + return SendFullColorRect(cl, w, h); @@ -20437,9 +20333,12 @@ Index: xorg-server-1.6.3.901/Makefile.am + cinfo->dest = &jpegDstManager; +} + ---- xorg-server-1.7.99/hw/vnc/translate.c -+++ xorg-server-1.7.99/hw/vnc/translate.c -@@ -0,0 +1,502 @@ +diff --git a/hw/vnc/translate.c b/hw/vnc/translate.c +new file mode 100644 +index 0000000..5cc57a3 +--- /dev/null ++++ b/hw/vnc/translate.c +@@ -0,0 +1,496 @@ +/* + * translate.c - translate between different pixel formats + * @@ -20609,7 +20508,7 @@ Index: xorg-server-1.6.3.901/Makefile.am + int width, int height, int x, int y) +{ + VNCSCREENPTR(pScreen); -+ DrawablePtr pDraw = (DrawablePtr)WindowTable[pScreen->myNum]; ++ DrawablePtr pDraw = (DrawablePtr)pScreen->root; + int truewidth = PixmapBytePad(width, in->bitsPerPixel) / 4; + + if ((x + truewidth > pVNC->width) || truewidth != width) { @@ -20635,8 +20534,7 @@ Index: xorg-server-1.6.3.901/Makefile.am + */ + +Bool -+rfbSetTranslateFunction(cl) -+ rfbClientPtr cl; ++rfbSetTranslateFunction(rfbClientPtr cl) +{ + VNCSCREENPTR(cl->pScreen); + rfbLog("Pixel format for client %s:\n",cl->host); @@ -20669,7 +20567,7 @@ Index: xorg-server-1.6.3.901/Makefile.am + if (!pVNC->rfbServerFormat.trueColour && + (pVNC->rfbServerFormat.bitsPerPixel != 8) && +#if XFREE86VNC -+ (miInstalledMaps[cl->pScreen->myNum]->class == PseudoColor)) { ++ (GetInstalledmiColormap(cl->pScreen)->class == PseudoColor)) { +#else + (pVNC->rfbInstalledColormap->class == PseudoColor)) { +#endif @@ -20683,7 +20581,7 @@ Index: xorg-server-1.6.3.901/Makefile.am + if (!cl->format.trueColour && + (cl->format.bitsPerPixel != 8) && +#if XFREE86VNC -+ (miInstalledMaps[cl->pScreen->myNum]->class == PseudoColor)) { ++ (GetInstalledmiColormap(cl->pScreen)->class == PseudoColor)) { +#else + (pVNC->rfbInstalledColormap->class == PseudoColor) ) { +#endif @@ -20707,7 +20605,7 @@ Index: xorg-server-1.6.3.901/Makefile.am + /* colour map -> colour map */ + +#if XFREE86VNC -+ if (miInstalledMaps[cl->pScreen->myNum]->class == DirectColor) { ++ if (GetInstalledmiColormap(cl->pScreen)->class == DirectColor) { +#else + if (pVNC->rfbInstalledColormap->class == DirectColor) { +#endif @@ -20865,17 +20763,15 @@ Index: xorg-server-1.6.3.901/Makefile.am + */ + +Bool -+rfbSetClientColourMap(cl, firstColour, nColours) -+ rfbClientPtr cl; -+ int firstColour; -+ int nColours; ++ rfbSetClientColourMap(rfbClientPtr cl, ++ int firstColour, int nColours) +{ + VNCSCREENPTR(cl->pScreen); + BoxRec box; + + if (nColours == 0) { +#if XFREE86VNC -+ nColours = miInstalledMaps[cl->pScreen->myNum]->pVisual->ColormapEntries; ++ nColours = GetInstalledmiColormap(cl->pScreen)->pVisual->ColormapEntries; +#else + nColours = pVNC->rfbInstalledColormap->pVisual->ColormapEntries; +#endif @@ -20909,9 +20805,7 @@ Index: xorg-server-1.6.3.901/Makefile.am + */ + +void -+rfbSetClientColourMaps(firstColour, nColours) -+ int firstColour; -+ int nColours; ++ rfbSetClientColourMaps(int firstColour, int nColours) +{ + rfbClientPtr cl, nextCl; + @@ -20923,8 +20817,7 @@ Index: xorg-server-1.6.3.901/Makefile.am + + +static void -+PrintPixelFormat(pf) -+ rfbPixelFormat *pf; ++PrintPixelFormat(rfbPixelFormat *pf) +{ + if (pf->bitsPerPixel == 1) { + rfbLog(" 1 bpp, %s sig bit in each byte is leftmost on the screen.\n", @@ -20942,8 +20835,11 @@ Index: xorg-server-1.6.3.901/Makefile.am + } + } +} ---- xorg-server-1.7.99/hw/vnc/vncauth.c -+++ xorg-server-1.7.99/hw/vnc/vncauth.c +diff --git a/hw/vnc/vncauth.c b/hw/vnc/vncauth.c +new file mode 100644 +index 0000000..a70cfa5 +--- /dev/null ++++ b/hw/vnc/vncauth.c @@ -0,0 +1,252 @@ +/* + * Copyright (C) 1999 AT&T Laboratories Cambridge. All Rights Reserved. @@ -21197,8 +21093,11 @@ Index: xorg-server-1.6.3.901/Makefile.am + des(bytes+i, bytes+i); + } +} ---- xorg-server-1.7.99/hw/vnc/vncauth.h -+++ xorg-server-1.7.99/hw/vnc/vncauth.h +diff --git a/hw/vnc/vncauth.h b/hw/vnc/vncauth.h +new file mode 100644 +index 0000000..adc280b +--- /dev/null ++++ b/hw/vnc/vncauth.h @@ -0,0 +1,33 @@ +/* + * Copyright (C) 1999 AT&T Laboratories Cambridge. All Rights Reserved. @@ -21233,9 +21132,12 @@ Index: xorg-server-1.6.3.901/Makefile.am +extern int vncEncryptAndStorePasswd2(char *passwd, char *passwdViewOnly, char *fname); +extern int vncDecryptPasswdFromFile2(char *fname, char *passwdFullControl, char *passwdViewOnly); + ---- xorg-server-1.7.99/hw/vnc/vncext.c -+++ xorg-server-1.7.99/hw/vnc/vncext.c -@@ -0,0 +1,800 @@ +diff --git a/hw/vnc/vncext.c b/hw/vnc/vncext.c +new file mode 100644 +index 0000000..ea913b7 +--- /dev/null ++++ b/hw/vnc/vncext.c +@@ -0,0 +1,807 @@ +/* + * Copyright (C) 2002 Alan Hourihane. All Rights Reserved. + * @@ -21274,8 +21176,10 @@ Index: xorg-server-1.6.3.901/Makefile.am +#include +#include + -+DevPrivateKey vncCreateScreenResourcesKey = &vncCreateScreenResourcesKey; -+DevPrivateKey rfbGCKey = &rfbGCKey; ++static DevPrivateKeyRec vncCreateScreenResourcesKeyRec; ++#define vncCreateScreenResourcesKey (&vncCreateScreenResourcesKeyRec) ++DevPrivateKeyRec rfbGCKeyRec; ++#define rfbGCKey (&rfbGCKeyRec) + +int VncSelectNotify(ClientPtr client, BOOL onoff); +void VncExtensionInit(void); @@ -21329,7 +21233,7 @@ Index: xorg-server-1.6.3.901/Makefile.am + prev->next = p->next; + else + ClientsList = p->next; -+ xfree(p); ++ free(p); + return; + } + prev = p; @@ -21373,13 +21277,13 @@ Index: xorg-server-1.6.3.901/Makefile.am + } + + /* allocate new client record */ -+ rec = (VncClientRecPtr) xalloc(sizeof(VncClientRec)); ++ rec = (VncClientRecPtr) malloc(sizeof(VncClientRec)); + if (rec) { + rec->client = client; + rec->fakeID = FakeClientID(client->index); -+ rec->res = CreateNewResourceType(VncDestroyClientResourceCallback); ++ rec->res = CreateNewResourceType(VncDestroyClientResourceCallback,"DestroyClientResourceCallback"); + if (!AddResource(rec->fakeID, rec->res, rec)) { -+ xfree(rec); ++ free(rec); + } + + /* insert at head of list */ @@ -21752,7 +21656,7 @@ Index: xorg-server-1.6.3.901/Makefile.am + else + conn.ipaddress = (CARD32)peer.sin_addr.s_addr; + -+ (void) TryClientEvents(pn->client, (xEventPtr)&conn, 1, NoEventMask, ++ (void) TryClientEvents(pn->client, NULL, (xEventPtr)&conn, 1, NoEventMask, + NoEventMask, NullGrab); + } + pn = pn->next; @@ -21795,7 +21699,7 @@ Index: xorg-server-1.6.3.901/Makefile.am + else + conn.ipaddress = (CARD32)peer.sin_addr.s_addr; + -+ (void) TryClientEvents(pn->client, (xEventPtr)&conn, 1, NoEventMask, ++ (void) TryClientEvents(pn->client, NULL, (xEventPtr)&conn, 1, NoEventMask, + NoEventMask, NullGrab); + } + pn = pn->next; @@ -21824,7 +21728,7 @@ Index: xorg-server-1.6.3.901/Makefile.am + conn.type = VncEventBase + XVncDisconnected; + conn.sequenceNumber = pn->client->sequence; + conn.connected = sock; -+ (void) TryClientEvents(pn->client, (xEventPtr)&conn, 1, NoEventMask, ++ (void) TryClientEvents(pn->client, NULL, (xEventPtr)&conn, 1, NoEventMask, + NoEventMask, NullGrab); + } + pn = pn->next; @@ -21898,7 +21802,7 @@ Index: xorg-server-1.6.3.901/Makefile.am + newRec->next = head; + newRec->client = client; + if (!AddResource(faked, VncNotifyList, newRec)) { -+ xfree(newRec); ++ free(newRec); + return BadAlloc; + } +#endif @@ -21926,7 +21830,7 @@ Index: xorg-server-1.6.3.901/Makefile.am + + VncResourceGeneration = serverGeneration; + -+ if (!(VncNotifyList = CreateNewResourceType(VncDestroyNotifyList))) { ++ if (!(VncNotifyList = CreateNewResourceType(VncDestroyNotifyList,"DestroyNotifyList"))) { + ErrorF("CreateResourceTypes: failed to allocate vnc notify list resource.\n"); + return FALSE; + } @@ -21993,14 +21897,19 @@ Index: xorg-server-1.6.3.901/Makefile.am +VncExtensionInit(void) +{ + ExtensionEntry *extEntry; -+ ++#if XFREE86VNC ++ int i; ++#endif + if (vncExtGeneration != serverGeneration) { -+ unsigned int i; + + vncExtGeneration = serverGeneration; + ++ // doesn't seem to be valid any more - mhopf 21.12.2010 + // no allocation needed for screen privates -+ if (!dixRequestPrivate(rfbGCKey, sizeof(rfbGCRec))) ++ if (!dixRegisterPrivateKey(vncCreateScreenResourcesKey, PRIVATE_SCREEN, 0)) ++ return; ++ ++ if (!dixRegisterPrivateKey(rfbGCKey, PRIVATE_GC, sizeof(rfbGCRec))) + return; + +#if XFREE86VNC @@ -22036,9 +21945,12 @@ Index: xorg-server-1.6.3.901/Makefile.am + (EventSwapPtr)SwapVncChromiumConnectedEvent; +#endif +} /* VncExtensionInit */ ---- xorg-server-1.7.99/hw/vnc/xistubs.c -+++ xorg-server-1.7.99/hw/vnc/xistubs.c -@@ -0,0 +1,323 @@ +diff --git a/hw/vnc/xistubs.c b/hw/vnc/xistubs.c +new file mode 100644 +index 0000000..cffba99 +--- /dev/null ++++ b/hw/vnc/xistubs.c +@@ -0,0 +1,312 @@ +/* $Xorg: stubs.c,v 1.4 2001/02/09 02:04:35 xorgcvs Exp $ */ + +/************************************************************ @@ -22109,6 +22021,7 @@ Index: xorg-server-1.6.3.901/Makefile.am +#include +#include "inputstr.h" +#include "XIstubs.h" ++#include "../dmxvnc.h" + +/*********************************************************************** + * @@ -22135,9 +22048,8 @@ Index: xorg-server-1.6.3.901/Makefile.am + */ + +int -+ChangeKeyboardDevice (old_dev, new_dev) -+ DeviceIntPtr old_dev; -+ DeviceIntPtr new_dev; ++ChangeKeyboardDevice (DeviceIntPtr old_dev, ++ DeviceIntPtr new_dev) + { + /*********************************************************************** + DeleteFocusClassDeviceStruct(old_dev); * defined in xchgptr.c * @@ -22177,17 +22089,11 @@ Index: xorg-server-1.6.3.901/Makefile.am + */ + +int -+#if NeedFunctionPrototypes +ChangePointerDevice ( + DeviceIntPtr old_dev, + DeviceIntPtr new_dev, + unsigned char x, + unsigned char y) -+#else -+ChangePointerDevice (old_dev, new_dev, x, y) -+ DeviceIntPtr old_dev, new_dev; -+ unsigned char x, y; -+#endif + { + /*********************************************************************** + InitFocusClassDeviceStruct(old_dev); * allow focusing old ptr* @@ -22201,7 +22107,7 @@ Index: xorg-server-1.6.3.901/Makefile.am + *************************************************************************/ + return BadMatch; + } -+ ++#if 0 +/*********************************************************************** + * + * Caller: ProcXCloseDevice @@ -22215,13 +22121,12 @@ Index: xorg-server-1.6.3.901/Makefile.am + * + */ + -+void -+CloseInputDevice (d, client) -+ DeviceIntPtr d; -+ ClientPtr client; ++static void ++CloseInputDevice (DeviceIntPtr d, ++ ClientPtr client) + { + } -+ ++#endif +/*********************************************************************** + * + * Caller: ProcXListInputDevices @@ -22247,9 +22152,9 @@ Index: xorg-server-1.6.3.901/Makefile.am + * the default. + * + */ -+ -+void -+AddOtherInputDevices () ++#if 0 ++static void ++AddOtherInputDevices (void) + { + /********************************************************************** + for each uninitialized device, do something like: @@ -22265,7 +22170,7 @@ Index: xorg-server-1.6.3.901/Makefile.am + ************************************************************************/ + + } -+ ++#endif +/*********************************************************************** + * + * Caller: ProcXOpenDevice @@ -22287,15 +22192,14 @@ Index: xorg-server-1.6.3.901/Makefile.am + * are opened during X server initialization and kept open). + * + */ -+ -+void -+OpenInputDevice (dev, client, status) -+ DeviceIntPtr dev; -+ ClientPtr client; -+ int *status; ++#if 0 ++static void ++OpenInputDevice (DeviceIntPtr dev, ++ ClientPtr client, ++ int *status) + { + } -+ ++#endif +/**************************************************************************** + * + * Caller: ProcXSetDeviceMode @@ -22309,10 +22213,9 @@ Index: xorg-server-1.6.3.901/Makefile.am + */ + +int -+SetDeviceMode (client, dev, mode) -+ register ClientPtr client; -+ DeviceIntPtr dev; -+ int mode; ++SetDeviceMode (register ClientPtr client, ++ DeviceIntPtr dev, ++ int mode) + { + return BadMatch; + } @@ -22330,12 +22233,11 @@ Index: xorg-server-1.6.3.901/Makefile.am + */ + +int -+SetDeviceValuators (client, dev, valuators, first_valuator, num_valuators) -+ register ClientPtr client; -+ DeviceIntPtr dev; -+ int *valuators; -+ int first_valuator; -+ int num_valuators; ++SetDeviceValuators (register ClientPtr client, ++ DeviceIntPtr dev, ++ int *valuators, ++ int first_valuator, ++ int num_valuators) + { + return BadMatch; + } @@ -22349,10 +22251,9 @@ Index: xorg-server-1.6.3.901/Makefile.am + */ + +int -+ChangeDeviceControl (client, dev, control) -+ register ClientPtr client; -+ DeviceIntPtr dev; -+ xDeviceCtl *control; ++ChangeDeviceControl (register ClientPtr client, ++ DeviceIntPtr dev, ++ xDeviceCtl *control) + { + switch (control->control) + { @@ -22362,9 +22263,12 @@ Index: xorg-server-1.6.3.901/Makefile.am + return (BadMatch); + } + } ---- xorg-server-1.7.99/hw/vnc/zlib.c -+++ xorg-server-1.7.99/hw/vnc/zlib.c -@@ -0,0 +1,310 @@ +diff --git a/hw/vnc/zlib.c b/hw/vnc/zlib.c +new file mode 100644 +index 0000000..c749ec6 +--- /dev/null ++++ b/hw/vnc/zlib.c +@@ -0,0 +1,308 @@ +/* + * zlib.c + * @@ -22426,10 +22330,9 @@ Index: xorg-server-1.6.3.901/Makefile.am + * rectangle encoding. + */ + -+Bool -+rfbSendOneRectEncodingZlib(cl, x, y, w, h) -+ rfbClientPtr cl; -+ int x, y, w, h; ++static Bool ++rfbSendOneRectEncodingZlib(rfbClientPtr cl, ++ int x, int y, int w, int h) +{ + VNCSCREENPTR(cl->pScreen); + rfbFramebufferUpdateRectHeader rect; @@ -22446,9 +22349,9 @@ Index: xorg-server-1.6.3.901/Makefile.am + if (zlibBeforeBufSize < maxRawSize) { + zlibBeforeBufSize = maxRawSize; + if (zlibBeforeBuf == NULL) -+ zlibBeforeBuf = (unsigned char *)xalloc(zlibBeforeBufSize); ++ zlibBeforeBuf = (unsigned char *)malloc(zlibBeforeBufSize); + else -+ zlibBeforeBuf = (unsigned char *)xrealloc(zlibBeforeBuf, zlibBeforeBufSize); ++ zlibBeforeBuf = (unsigned char *)realloc(zlibBeforeBuf, zlibBeforeBufSize); + } + + /* zlib compression is not useful for very small data sets. @@ -22486,9 +22389,9 @@ Index: xorg-server-1.6.3.901/Makefile.am + if (zlibAfterBufSize < maxCompSize) { + zlibAfterBufSize = maxCompSize; + if (zlibAfterBuf == NULL) -+ zlibAfterBuf = (unsigned char *)xalloc(zlibAfterBufSize); ++ zlibAfterBuf = (unsigned char *)malloc(zlibAfterBufSize); + else -+ zlibAfterBuf = (unsigned char *)xrealloc(zlibAfterBuf, zlibAfterBufSize); ++ zlibAfterBuf = (unsigned char *)realloc(zlibAfterBuf, zlibAfterBufSize); + } + + /* @@ -22603,9 +22506,8 @@ Index: xorg-server-1.6.3.901/Makefile.am + */ + +Bool -+rfbSendRectEncodingZlib(cl, x, y, w, h) -+ rfbClientPtr cl; -+ int x, y, w, h; ++rfbSendRectEncodingZlib(rfbClientPtr cl, ++ int x, int y, int w, int h) +{ + VNCSCREENPTR(cl->pScreen); + int maxLines; @@ -22675,38 +22577,27 @@ Index: xorg-server-1.6.3.901/Makefile.am +} + + ---- xorg-server-1.7.99/hw/xfree86/Makefile.am -+++ xorg-server-1.7.99/hw/xfree86/Makefile.am -@@ -4,6 +4,10 @@ - DRI_SUBDIR = dri - endif +diff --git a/hw/xfree86/Makefile.am b/hw/xfree86/Makefile.am +index 93995c6..171c889 100644 +--- a/hw/xfree86/Makefile.am ++++ b/hw/xfree86/Makefile.am +@@ -39,6 +39,11 @@ DIST_SUBDIRS = common ddc i2c x86emu int10 fbdevhw os-support \ + loader dixmods dri dri2 exa modes \ + utils doc +if VNC -+VNC_SUBDIR = vnc ++SUBDIRS += vnc ++DIST_SUBDIRS += vnc +endif + - if DRI2 - DRI2_SUBDIR = dri2 - endif -@@ -32,13 +36,13 @@ - - SUBDIRS = common ddc i2c x86emu $(INT10_SUBDIR) fbdevhw os-support parser \ - ramdac shadowfb $(VBE_SUBDIR) $(VGAHW_SUBDIR) $(XAA_SUBDIR) \ -- xf8_16bpp loader dixmods exa modes \ -+ xf8_16bpp loader dixmods exa modes $(VNC_SUBDIR) \ - $(DRI_SUBDIR) $(DRI2_SUBDIR) $(XF86UTILS_SUBDIR) $(DOC_SUBDIR) - - DIST_SUBDIRS = common ddc i2c x86emu int10 fbdevhw os-support \ - parser ramdac shadowfb vbe vgahw xaa \ - xf8_16bpp loader dixmods dri dri2 exa modes \ -- utils doc -+ utils doc vnc - bin_PROGRAMS = Xorg Xorg_SOURCES = xorg.c ---- xorg-server-1.7.99/hw/xfree86/dixmods/Makefile.am -+++ xorg-server-1.7.99/hw/xfree86/dixmods/Makefile.am -@@ -10,6 +10,10 @@ + +diff --git a/hw/xfree86/dixmods/Makefile.am b/hw/xfree86/dixmods/Makefile.am +index 365f006..5ff2aa9 100644 +--- a/hw/xfree86/dixmods/Makefile.am ++++ b/hw/xfree86/dixmods/Makefile.am +@@ -10,6 +10,10 @@ if DBE DBEMOD = libdbe.la endif @@ -22717,7 +22608,7 @@ Index: xorg-server-1.6.3.901/Makefile.am if RECORD RECORDMOD = librecord.la endif -@@ -21,11 +25,13 @@ +@@ -21,11 +25,13 @@ module_LTLIBRARIES = libfb.la \ extsmoduledir = $(moduledir)/extensions extsmodule_LTLIBRARIES = $(RECORDMOD) \ $(DBEMOD) \ @@ -22731,7 +22622,7 @@ Index: xorg-server-1.6.3.901/Makefile.am -I$(top_srcdir)/hw/xfree86/loader \ -I$(top_srcdir)/miext/shadow \ -I$(top_srcdir)/glx -@@ -34,6 +40,10 @@ +@@ -34,6 +40,10 @@ libdbe_la_LDFLAGS = -avoid-version libdbe_la_LIBADD = $(top_builddir)/dbe/libdbe.la libdbe_la_SOURCES = dbemodule.c @@ -22742,8 +22633,11 @@ Index: xorg-server-1.6.3.901/Makefile.am libfb_la_LDFLAGS = -avoid-version libfb_la_LIBADD = $(top_builddir)/fb/libfb.la libfb_la_SOURCES = $(top_builddir)/fb/fbcmap_mi.c fbmodule.c ---- xorg-server-1.7.99/hw/xfree86/vnc/.gitignore -+++ xorg-server-1.7.99/hw/xfree86/vnc/.gitignore +diff --git a/hw/xfree86/vnc/.gitignore b/hw/xfree86/vnc/.gitignore +new file mode 100644 +index 0000000..d14621f +--- /dev/null ++++ b/hw/xfree86/vnc/.gitignore @@ -0,0 +1,36 @@ +auth.c +cmap.c @@ -22781,8 +22675,11 @@ Index: xorg-server-1.6.3.901/Makefile.am +vncext.c +xistubs.c +zlib.c ---- xorg-server-1.7.99/hw/xfree86/vnc/Makefile.am -+++ xorg-server-1.7.99/hw/xfree86/vnc/Makefile.am +diff --git a/hw/xfree86/vnc/Makefile.am b/hw/xfree86/vnc/Makefile.am +new file mode 100644 +index 0000000..6f5cd76 +--- /dev/null ++++ b/hw/xfree86/vnc/Makefile.am @@ -0,0 +1,51 @@ +AM_CFLAGS = $(DIX_CFLAGS) + @@ -22835,13 +22732,19 @@ Index: xorg-server-1.6.3.901/Makefile.am + zlib.c + +#sdk_HEADERS = vncint.h ---- xorg-server-1.7.99/hw/xfree86/vnc/README -+++ xorg-server-1.7.99/hw/xfree86/vnc/README +diff --git a/hw/xfree86/vnc/README b/hw/xfree86/vnc/README +new file mode 100644 +index 0000000..64aa888 +--- /dev/null ++++ b/hw/xfree86/vnc/README @@ -0,0 +1 @@ +This directory contains the sources for building the vnc.so server extension module. ---- xorg-server-1.7.99/hw/xfree86/vnc/vncInit.c -+++ xorg-server-1.7.99/hw/xfree86/vnc/vncInit.c -@@ -0,0 +1,618 @@ +diff --git a/hw/xfree86/vnc/vncInit.c b/hw/xfree86/vnc/vncInit.c +new file mode 100644 +index 0000000..4a124fb +--- /dev/null ++++ b/hw/xfree86/vnc/vncInit.c +@@ -0,0 +1,626 @@ +/* + * Copyright (C) 2002 Alan Hourihane. All Rights Reserved. + * @@ -22878,39 +22781,47 @@ Index: xorg-server-1.6.3.901/Makefile.am + +#include "xf86.h" +#include "xf86_OSproc.h" -+#include "xf86Resources.h" -+#include "xf86Version.h" ++#include "xorgVersion.h" + -+int vncScreenPrivateIndex = -1; +int inetdSock = -1; +Atom VNC_LAST_CLIENT_ID = 0; +Atom VNC_CONNECT = 0; +char *desktopName = "x11"; +char rfbThisHost[256]; + -+DevPrivateKey VNCScreenKey = &VNCScreenKey; ++struct _DevPrivateKeyRec VNCScreenKeyRec; ++DevPrivateKey VNCScreenKey = &VNCScreenKeyRec; + +extern void VncExtensionInit(void); + ++extern void vncInitMouse(void); ++extern void vncInitKeyb(void); +Bool VNCInit(ScreenPtr pScreen, unsigned char *FBStart); + +#ifndef XFree86LOADER +static unsigned long VNCGeneration = 0; +#endif ++#if 0 +static const OptionInfoRec *VNCAvailableOptions(void *unused); ++#endif +static void rfbWakeupHandler (int i, pointer blockData, unsigned long err, pointer pReadmask); + -+static Bool vncCursorRealizeCursor(ScreenPtr, CursorPtr); -+static Bool vncCursorUnrealizeCursor(ScreenPtr, CursorPtr); -+static void vncCursorSetCursor(ScreenPtr, CursorPtr, int, int); -+static void vncCursorMoveCursor(ScreenPtr, int, int); -+static Bool vncDisplayCursor(ScreenPtr, CursorPtr); ++static Bool vncCursorRealizeCursor(DeviceIntPtr, ScreenPtr, CursorPtr); ++static Bool vncCursorUnrealizeCursor(DeviceIntPtr, ScreenPtr, CursorPtr); ++static void vncCursorSetCursor(DeviceIntPtr, ScreenPtr, CursorPtr, int, int); ++static void vncCursorMoveCursor(DeviceIntPtr, ScreenPtr, int, int); ++static Bool vncDisplayCursor(DeviceIntPtr, ScreenPtr, CursorPtr); ++static Bool vncDeviceCursorInitialize(DeviceIntPtr pDev, ScreenPtr pScr); ++static void vncDeviceCursorCleanup(DeviceIntPtr pDev, ScreenPtr pScr); + +static miPointerSpriteFuncRec vncCursorSpriteFuncs = { + vncCursorRealizeCursor, + vncCursorUnrealizeCursor, + vncCursorSetCursor, -+ vncCursorMoveCursor ++ vncCursorMoveCursor, ++ vncDeviceCursorInitialize, ++ vncDeviceCursorCleanup ++ +}; + +/* @@ -22951,12 +22862,13 @@ Index: xorg-server-1.6.3.901/Makefile.am +}; + +/*ARGSUSED*/ ++#if 0 +static const OptionInfoRec * +VNCAvailableOptions(void *unused) +{ + return (VNCOptions); +} -+ ++#endif +/* + * rfbLog prints a time-stamped message to the log file (stderr). + */ @@ -22969,7 +22881,7 @@ Index: xorg-server-1.6.3.901/Makefile.am + + time(&clock); + strftime(buf, 255, "%d/%m/%Y %H:%M:%S ", localtime(&clock)); -+ xf86DrvMsgVerb(-1, X_INFO, 1, buf); ++ xf86DrvMsgVerb(-1, X_INFO, 1, "%s\n", buf); + + va_start(ap, format); + xf86VDrvMsgVerb(-1, X_NONE, 1, format, ap); @@ -23009,9 +22921,10 @@ Index: xorg-server-1.6.3.901/Makefile.am + } +#endif + -+ if (!(pScreenPriv = xalloc(sizeof(vncScreenRec)))) ++ if (!(pScreenPriv = malloc(sizeof(vncScreenRec)))) ++ return FALSE; ++ if (!dixRegisterPrivateKey(VNCScreenKey, PRIVATE_SCREEN, 0)) + return FALSE; -+ + dixSetPrivate(&pScreen->devPrivates, VNCScreenKey, pScreenPriv); + + options = xnfalloc(sizeof(VNCOptions)); @@ -23022,7 +22935,7 @@ Index: xorg-server-1.6.3.901/Makefile.am + xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "VNC enabled\n"); + } else { + xf86DrvMsg(pScrn->scrnIndex, X_INFO, "VNC disabled\n"); -+ xfree(options); ++ free(options); + return FALSE; + } + @@ -23100,7 +23013,7 @@ Index: xorg-server-1.6.3.901/Makefile.am + xf86DrvMsg(pScrn->scrnIndex, X_INFO, "VNC interface option malformed, not using.\n"); + } + -+ xfree(options); ++ free(options); + + if (!VNC_LAST_CLIENT_ID) + VNC_LAST_CLIENT_ID = MakeAtom("VNC_LAST_CLIENT_ID", @@ -23129,11 +23042,8 @@ Index: xorg-server-1.6.3.901/Makefile.am + + pScreenPriv->CloseScreen = pScreen->CloseScreen; + pScreenPriv->CreateGC = pScreen->CreateGC; -+ pScreenPriv->PaintWindowBackground = pScreen->PaintWindowBackground; -+ pScreenPriv->PaintWindowBorder = pScreen->PaintWindowBorder; + pScreenPriv->CopyWindow = pScreen->CopyWindow; + pScreenPriv->ClearToBackground = pScreen->ClearToBackground; -+ pScreenPriv->RestoreAreas = pScreen->RestoreAreas; + pScreenPriv->WakeupHandler = pScreen->WakeupHandler; + pScreenPriv->EnableDisableFBAccess = pScrn->EnableDisableFBAccess; + pScreenPriv->InstallColormap = pScreen->InstallColormap; @@ -23156,11 +23066,8 @@ Index: xorg-server-1.6.3.901/Makefile.am +#endif + pScreen->CloseScreen = rfbCloseScreen; + pScreen->CreateGC = rfbCreateGC; -+ pScreen->PaintWindowBackground = rfbPaintWindowBackground; -+ pScreen->PaintWindowBorder = rfbPaintWindowBorder; + pScreen->CopyWindow = rfbCopyWindow; + pScreen->ClearToBackground = rfbClearToBackground; -+ pScreen->RestoreAreas = rfbRestoreAreas; + pScreen->WakeupHandler = rfbWakeupHandler; + pScrn->EnableDisableFBAccess = rfbEnableDisableFBAccess; + pScreen->InstallColormap = rfbInstallColormap; @@ -23215,16 +23122,20 @@ Index: xorg-server-1.6.3.901/Makefile.am + pScreenPriv->spriteFuncs = PointPriv->spriteFuncs; + PointPriv->spriteFuncs = &vncCursorSpriteFuncs; + -+ xf86CursorPriv = dixLookupPrivate(&(pScreen)->devPrivates, xf86CursorScreenKey); -+ -+ if (xf86CursorPriv) { -+ pScreenPriv->UseHWCursor = xf86CursorPriv->CursorInfoPtr->UseHWCursor; -+ xf86CursorPriv->CursorInfoPtr->UseHWCursor = vncUseHWCursor; ++ if (dixPrivateKeyRegistered(xf86CursorScreenKey)) { ++ xf86CursorPriv = dixLookupPrivate(&(pScreen)->devPrivates, xf86CursorScreenKey); ++ ++ if (xf86CursorPriv) { ++ pScreenPriv->UseHWCursor = xf86CursorPriv->CursorInfoPtr->UseHWCursor; ++ xf86CursorPriv->CursorInfoPtr->UseHWCursor = vncUseHWCursor; +#ifdef ARGB_CURSOR -+ pScreenPriv->UseHWCursorARGB = xf86CursorPriv->CursorInfoPtr->UseHWCursorARGB; -+ xf86CursorPriv->CursorInfoPtr->UseHWCursorARGB = vncUseHWCursorARGB; ++ pScreenPriv->UseHWCursorARGB = xf86CursorPriv->CursorInfoPtr->UseHWCursorARGB; ++ xf86CursorPriv->CursorInfoPtr->UseHWCursorARGB = vncUseHWCursorARGB; +#endif -+ pScreenPriv->SWCursor = &xf86CursorPriv->SWCursor; ++ pScreenPriv->SWCursor = &xf86CursorPriv->SWCursor; ++ } ++ } else { ++ pScreenPriv->UseHWCursor = NULL; + } + + return TRUE; @@ -23233,23 +23144,23 @@ Index: xorg-server-1.6.3.901/Makefile.am +/****** miPointerSpriteFunctions *******/ + +static Bool -+vncCursorRealizeCursor(ScreenPtr pScreen, CursorPtr pCurs) ++vncCursorRealizeCursor(DeviceIntPtr pDev, ScreenPtr pScreen, CursorPtr pCurs) +{ + vncScreenPtr pScreenPriv = VNCPTR(pScreen); + -+ return (*pScreenPriv->spriteFuncs->RealizeCursor)(pScreen, pCurs); ++ return (*pScreenPriv->spriteFuncs->RealizeCursor)(pDev, pScreen, pCurs); +} + +static Bool -+vncCursorUnrealizeCursor(ScreenPtr pScreen, CursorPtr pCurs) ++vncCursorUnrealizeCursor(DeviceIntPtr pDev, ScreenPtr pScreen, CursorPtr pCurs) +{ + vncScreenPtr pScreenPriv = VNCPTR(pScreen); + -+ return (*pScreenPriv->spriteFuncs->UnrealizeCursor)(pScreen, pCurs); ++ return (*pScreenPriv->spriteFuncs->UnrealizeCursor)(pDev, pScreen, pCurs); +} + +static void -+vncCursorSetCursor(ScreenPtr pScreen, CursorPtr pCurs, int x, int y) ++vncCursorSetCursor(DeviceIntPtr pDev, ScreenPtr pScreen, CursorPtr pCurs, int x, int y) +{ + vncScreenPtr pScreenPriv = VNCPTR(pScreen); + @@ -23270,11 +23181,11 @@ Index: xorg-server-1.6.3.901/Makefile.am + pScreenPriv->cursorIsDrawn = TRUE; +#endif + -+ (*pScreenPriv->spriteFuncs->SetCursor)(pScreen, pCurs, x, y); ++ (*pScreenPriv->spriteFuncs->SetCursor)(pDev, pScreen, pCurs, x, y); +} + +static void -+vncCursorMoveCursor(ScreenPtr pScreen, int x, int y) ++vncCursorMoveCursor(DeviceIntPtr pDev, ScreenPtr pScreen, int x, int y) +{ + vncScreenPtr pScreenPriv = VNCPTR(pScreen); + rfbClientPtr cl; @@ -23284,13 +23195,11 @@ Index: xorg-server-1.6.3.901/Makefile.am + cl->cursorWasMoved = TRUE; + } + -+ (*pScreenPriv->spriteFuncs->MoveCursor)(pScreen, x, y); ++ (*pScreenPriv->spriteFuncs->MoveCursor)(pDev, pScreen, x, y); +} + +Bool -+vncUseHWCursor(pScreen, pCursor) -+ ScreenPtr pScreen; -+ CursorPtr pCursor; ++vncUseHWCursor(ScreenPtr pScreen, CursorPtr pCursor) +{ + vncScreenPtr pScreenPriv = VNCPTR(pScreen); + rfbClientPtr cl; @@ -23321,9 +23230,7 @@ Index: xorg-server-1.6.3.901/Makefile.am +#include "cursorstr.h" + +Bool -+vncUseHWCursorARGB(pScreen, pCursor) -+ ScreenPtr pScreen; -+ CursorPtr pCursor; ++vncUseHWCursorARGB(ScreenPtr pScreen, CursorPtr pCursor) +{ + vncScreenPtr pScreenPriv = VNCPTR(pScreen); + rfbClientPtr cl; @@ -23349,9 +23256,7 @@ Index: xorg-server-1.6.3.901/Makefile.am +#endif + +static Bool -+vncDisplayCursor(pScreen, pCursor) -+ ScreenPtr pScreen; -+ CursorPtr pCursor; ++vncDisplayCursor(DeviceIntPtr pDev, ScreenPtr pScreen, CursorPtr pCursor) +{ + vncScreenPtr pScreenPriv = VNCPTR(pScreen); + rfbClientPtr cl; @@ -23364,13 +23269,27 @@ Index: xorg-server-1.6.3.901/Makefile.am + cl->cursorWasChanged = TRUE; + } + -+ ret = (*pScreen->DisplayCursor)(pScreen, pCursor); ++ ret = (*pScreen->DisplayCursor)(pDev, pScreen, pCursor); + + pScreen->DisplayCursor = vncDisplayCursor; + + return ret; +} + ++static Bool vncDeviceCursorInitialize(DeviceIntPtr pDev, ScreenPtr pScr) ++{ ++ vncScreenPtr pScreenPriv = VNCPTR(pScr); ++ ++ return (*pScreenPriv->spriteFuncs->DeviceCursorInitialize)(pDev, pScr); ++} ++ ++static void vncDeviceCursorCleanup(DeviceIntPtr pDev, ScreenPtr pScr) ++{ ++ vncScreenPtr pScreenPriv = VNCPTR(pScr); ++ ++ (*pScreenPriv->spriteFuncs->DeviceCursorCleanup)(pDev, pScr); ++} ++ +static void +rfbWakeupHandler ( + int i, @@ -23414,7 +23333,7 @@ Index: xorg-server-1.6.3.901/Makefile.am + XORG_VERSION_CURRENT, + 1, 1, 0, + ABI_CLASS_EXTENSION, -+#if 0 ++#if 1 + ABI_EXTENSION_VERSION, +#else + /* Hack to allow module to work with more servers (vs. 0.3 above) */ @@ -23424,20 +23343,12 @@ Index: xorg-server-1.6.3.901/Makefile.am + {0,0,0,0} +}; + -+XF86ModuleData vncModuleData = { ++_X_EXPORT XF86ModuleData vncModuleData = { + &vncVersRec, /* vers */ + vncSetup, /* ModuleSetupProc */ + NULL /* ModuleTearDownProc */ +}; + -+ModuleInfoRec VNC = { -+ 1, /* moduleVersion */ -+ "VNC", /* moduleName */ -+ NULL, /* module pointer */ -+ 0, /* refCount */ -+ VNCAvailableOptions, /* function returning array of OptionsInfoRec */ -+}; -+ +ExtensionModule vncExtensionModule = { + VncExtensionInit, /* initFunc */ + "VNC", /* name */ @@ -23460,9 +23371,12 @@ Index: xorg-server-1.6.3.901/Makefile.am + return (pointer)TRUE; +} +#endif ---- xorg-server-1.7.99/hw/xfree86/vnc/vncint.h -+++ xorg-server-1.7.99/hw/xfree86/vnc/vncint.h -@@ -0,0 +1,151 @@ +diff --git a/hw/xfree86/vnc/vncint.h b/hw/xfree86/vnc/vncint.h +new file mode 100644 +index 0000000..18a3630 +--- /dev/null ++++ b/hw/xfree86/vnc/vncint.h +@@ -0,0 +1,148 @@ +/* + * Copyright (C) 2002 Alan Hourihane. All Rights Reserved. + * @@ -23577,11 +23491,8 @@ Index: xorg-server-1.6.3.901/Makefile.am + + CloseScreenProcPtr CloseScreen; + CreateGCProcPtr CreateGC; -+ PaintWindowBackgroundProcPtr PaintWindowBackground; -+ PaintWindowBorderProcPtr PaintWindowBorder; + CopyWindowProcPtr CopyWindow; + ClearToBackgroundProcPtr ClearToBackground; -+ RestoreAreasProcPtr RestoreAreas; + ScreenWakeupHandlerProcPtr WakeupHandler; + InstallColormapProcPtr InstallColormap; + UninstallColormapProcPtr UninstallColormap; @@ -23614,9 +23525,11 @@ Index: xorg-server-1.6.3.901/Makefile.am + +#endif /* _VNC_H_ */ + ---- xorg-server-1.7.99/mi/miinitext.c -+++ xorg-server-1.7.99/mi/miinitext.c -@@ -90,6 +90,18 @@ +diff --git a/mi/miinitext.c b/mi/miinitext.c +index 4499f37..26acd82 100644 +--- a/mi/miinitext.c ++++ b/mi/miinitext.c +@@ -89,6 +89,18 @@ SOFTWARE. #undef XF86VIDMODE #endif @@ -23635,14 +23548,17 @@ Index: xorg-server-1.6.3.901/Makefile.am #include "misc.h" #include "extension.h" #include "micmap.h" ---- xorg-server-1.7.99/xcliplist/Makefile.am -+++ xorg-server-1.7.99/xcliplist/Makefile.am -@@ -0,0 +1,18 @@ +diff --git a/xcliplist/Makefile.am b/xcliplist/Makefile.am +new file mode 100644 +index 0000000..334acb6 +--- /dev/null ++++ b/xcliplist/Makefile.am +@@ -0,0 +1,16 @@ +#noinst_LTLIBRARIES = libxcliplist.la +libxcliplist_la_LTLIBRARIES = libxcliplist.la + +#AM_CFLAGS = $(DIX_CFLAGS) @SERVER_DEFINES@ @LOADER_DEFINES@ -+AM_CFLAGS = $(DIX_CFLAGS) ++AM_CFLAGS = $(DIX_CFLAGS) $(XORG_CFLAGS) + +libxcliplist_la_LDFLAGS = -module -avoid-version +libxcliplist_ladir = $(moduledir)/extensions @@ -23651,13 +23567,14 @@ Index: xorg-server-1.6.3.901/Makefile.am + cliplist.c \ + cliplistmod.c + -+## cliplistmod.c -+ +if XORG +sdk_HEADERS = +endif ---- xorg-server-1.7.99/xcliplist/cliplist.c -+++ xorg-server-1.7.99/xcliplist/cliplist.c +diff --git a/xcliplist/cliplist.c b/xcliplist/cliplist.c +new file mode 100644 +index 0000000..290eb79 +--- /dev/null ++++ b/xcliplist/cliplist.c @@ -0,0 +1,128 @@ +/* + * Server-side code for the Xcliplist extension @@ -23787,9 +23704,15 @@ Index: xorg-server-1.6.3.901/Makefile.am + XClipListErrorBase = extEntry->errorBase; + } +} ---- xorg-server-1.7.99/xcliplist/cliplistmod.c -+++ xorg-server-1.7.99/xcliplist/cliplistmod.c -@@ -0,0 +1,46 @@ +diff --git a/xcliplist/cliplistmod.c b/xcliplist/cliplistmod.c +new file mode 100644 +index 0000000..b0dd4f7 +--- /dev/null ++++ b/xcliplist/cliplistmod.c +@@ -0,0 +1,49 @@ ++#ifdef HAVE_XORG_CONFIG_H ++#include ++#endif + +#include "../hw/xfree86/common/xf86Module.h" + @@ -23812,7 +23735,7 @@ Index: xorg-server-1.6.3.901/Makefile.am + MODULEVENDORSTRING, + MODINFOSTRING1, + MODINFOSTRING2, -+ XF86_VERSION_CURRENT, /* XXX fix? */ ++ XORG_VERSION_CURRENT, /* XXX fix? */ + 1, 13, 0, + ABI_CLASS_EXTENSION, +#if 0 @@ -23836,3 +23759,6 @@ Index: xorg-server-1.6.3.901/Makefile.am + return (pointer)1; +} + +-- +1.7.3.4 + diff --git a/N-VNC-Don-t-let-VNC-access-the-framebuffer-directly-an.patch b/N-VNC-Don-t-let-VNC-access-the-framebuffer-directly-an.patch new file mode 100644 index 0000000..7bebc89 --- /dev/null +++ b/N-VNC-Don-t-let-VNC-access-the-framebuffer-directly-an.patch @@ -0,0 +1,352 @@ +From: Michal Srb +Date: Tue, 6 Sep 2011 13:08:25 +0200 +Subject: [PATCH 4/6] VNC: Don't let VNC access the framebuffer directly any more. +Patch-Mainline: Currently no upstream project. +Git-commit: 3e0de1d95b3ffd3988016b2d3f40f577393ad046 +Signed-off: Egbert Eich +References: bnc #653915 + +It seems that accessing the framebuffer directly is not a good idea anymore. +This patch will let the tight encoding read the screen data using GetImage. It +may be little slower, but not dramatically - it already does few GetImage calls +on every repaint now. + +Signed-off-by: Egbert Eich +--- + hw/vnc/tight.c | 69 ++++++++++++++++++++++++++++++--------------- + hw/vnc/vncext.c | 19 ++---------- + hw/xfree86/vnc/vncInit.c | 11 ++----- + hw/xfree86/vnc/vncint.h | 2 - + 4 files changed, 53 insertions(+), 48 deletions(-) + +diff --git a/hw/vnc/tight.c b/hw/vnc/tight.c +index 5c54736..f27c73e 100644 +--- a/hw/vnc/tight.c ++++ b/hw/vnc/tight.c +@@ -109,15 +109,17 @@ static unsigned char *tightAfterBuf = NULL; + + static int *prevRowBuf = NULL; + ++static unsigned char* fakeFrameBuffer = NULL; ++ + + /* Prototypes for static functions. */ + +-static void FindBestSolidArea (ScreenPtr pScreen, int x, int y, int w, int h, ++static void FindBestSolidArea (rfbClientPtr cl, int x, int y, int w, int h, + CARD32 colorValue, int *w_ptr, int *h_ptr); +-static void ExtendSolidArea (ScreenPtr pScreen, int x, int y, int w, int h, ++static void ExtendSolidArea (rfbClientPtr cl, int x, int y, int w, int h, + CARD32 colorValue, + int *x_ptr, int *y_ptr, int *w_ptr, int *h_ptr); +-static Bool CheckSolidTile (ScreenPtr pScreen, int x, int y, int w, int h, ++static Bool CheckSolidTile (rfbClientPtr cl, int x, int y, int w, int h, + CARD32 *colorPtr, Bool needSameColor); + static Bool CheckSolidTile8 (ScreenPtr pScreen, int x, int y, int w, int h, + CARD32 *colorPtr, Bool needSameColor); +@@ -126,6 +128,7 @@ static Bool CheckSolidTile16 (ScreenPtr pScreen, int x, int y, int w, int h, + static Bool CheckSolidTile32 (ScreenPtr pScreen, int x, int y, int w, int h, + CARD32 *colorPtr, Bool needSameColor); + ++static Bool SendRectEncodingTight(rfbClientPtr cl, int x, int y, int w, int h); + static Bool SendRectSimple (rfbClientPtr cl, int x, int y, int w, int h); + static Bool SendSubrect (rfbClientPtr cl, int x, int y, int w, int h); + static Bool SendTightHeader (rfbClientPtr cl, int x, int y, int w, int h); +@@ -211,6 +214,25 @@ rfbSendRectEncodingTight(rfbClientPtr cl, + int x, int y, int w, int h) + { + VNCSCREENPTR(cl->pScreen); ++ ++ /* Copy the rectangle to the fake buffer for CheckSolidTile functions. */ ++ ++ if(!fakeFrameBuffer) fakeFrameBuffer = malloc(pVNC->width * pVNC->height * cl->format.bitsPerPixel / 8); ++ (*cl->translateFn)(cl->pScreen, cl->translateLookupTable, ++ &pVNC->rfbServerFormat, ++ &cl->format, fakeFrameBuffer + (y * pVNC->width * cl->format.bitsPerPixel / 8), ++ pVNC->paddedWidthInBytes, pVNC->width, h, 0, y); ++ ++ /* Call the inner part */ ++ ++ return SendRectEncodingTight(cl, x, y, w, h); ++} ++ ++static Bool ++SendRectEncodingTight(rfbClientPtr cl, ++ int x, int y, int w, int h) ++{ ++ VNCSCREENPTR(cl->pScreen); + int nMaxRows; + CARD32 colorValue; + int dx, dy, dw, dh; +@@ -247,7 +269,7 @@ rfbSendRectEncodingTight(rfbClientPtr cl, + nMaxWidth = (w > maxRectWidth) ? maxRectWidth : w; + nMaxRows = maxRectSize / nMaxWidth; + } +- ++ + /* Try to find large solid-color areas and send them separately. */ + + for (dy = y; dy < y + h; dy += MAX_SPLIT_TILE_SIZE) { +@@ -269,11 +291,11 @@ rfbSendRectEncodingTight(rfbClientPtr cl, + dw = (dx + MAX_SPLIT_TILE_SIZE <= x + w) ? + MAX_SPLIT_TILE_SIZE : (x + w - dx); + +- if (CheckSolidTile(cl->pScreen, dx, dy, dw, dh, &colorValue, FALSE)) { ++ if (CheckSolidTile(cl, dx, dy, dw, dh, &colorValue, FALSE)) { + + /* Get dimensions of solid-color area. */ + +- FindBestSolidArea(cl->pScreen, dx, dy, w - (dx - x), h - (dy - y), ++ FindBestSolidArea(cl, dx, dy, w - (dx - x), h - (dy - y), + colorValue, &w_best, &h_best); + + /* Make sure a solid rectangle is large enough +@@ -286,7 +308,7 @@ rfbSendRectEncodingTight(rfbClientPtr cl, + /* Try to extend solid rectangle to maximum size. */ + + x_best = dx; y_best = dy; +- ExtendSolidArea(cl->pScreen, x, y, w, h, colorValue, ++ ExtendSolidArea(cl, x, y, w, h, colorValue, + &x_best, &y_best, &w_best, &h_best); + + /* Send rectangles at top and left to solid-color area. */ +@@ -295,7 +317,7 @@ rfbSendRectEncodingTight(rfbClientPtr cl, + !SendRectSimple(cl, x, y, w, y_best-y) ) + return FALSE; + if ( x_best != x && +- !rfbSendRectEncodingTight(cl, x, y_best, ++ !SendRectEncodingTight(cl, x, y_best, + x_best-x, h_best) ) + return FALSE; + +@@ -316,11 +338,11 @@ rfbSendRectEncodingTight(rfbClientPtr cl, + /* Send remaining rectangles (at right and bottom). */ + + if ( x_best + w_best != x + w && +- !rfbSendRectEncodingTight(cl, x_best+w_best, y_best, ++ !SendRectEncodingTight(cl, x_best+w_best, y_best, + w-(x_best-x)-w_best, h_best) ) + return FALSE; + if ( y_best + h_best != y + h && +- !rfbSendRectEncodingTight(cl, x, y_best+h_best, ++ !SendRectEncodingTight(cl, x, y_best+h_best, + w, h-(y_best-y)-h_best) ) + return FALSE; + +@@ -339,7 +361,7 @@ rfbSendRectEncodingTight(rfbClientPtr cl, + } + + static void +-FindBestSolidArea(ScreenPtr pScreen, ++FindBestSolidArea(rfbClientPtr cl, + int x, int y, int w, int h, + CARD32 colorValue, + int *w_ptr, int *h_ptr) +@@ -357,13 +379,13 @@ FindBestSolidArea(ScreenPtr pScreen, + dw = (w_prev > MAX_SPLIT_TILE_SIZE) ? + MAX_SPLIT_TILE_SIZE : w_prev; + +- if (!CheckSolidTile(pScreen, x, dy, dw, dh, &colorValue, TRUE)) ++ if (!CheckSolidTile(cl, x, dy, dw, dh, &colorValue, TRUE)) + break; + + for (dx = x + dw; dx < x + w_prev;) { + dw = (dx + MAX_SPLIT_TILE_SIZE <= x + w_prev) ? + MAX_SPLIT_TILE_SIZE : (x + w_prev - dx); +- if (!CheckSolidTile(pScreen, dx, dy, dw, dh, &colorValue, TRUE)) ++ if (!CheckSolidTile(cl, dx, dy, dw, dh, &colorValue, TRUE)) + break; + dx += dw; + } +@@ -380,7 +402,7 @@ FindBestSolidArea(ScreenPtr pScreen, + } + + static void +-ExtendSolidArea(ScreenPtr pScreen, int x, int y, int w, int h, ++ExtendSolidArea(rfbClientPtr cl, int x, int y, int w, int h, + CARD32 colorValue, + int *x_ptr, int *y_ptr, int *w_ptr, int *h_ptr) + { +@@ -388,7 +410,7 @@ ExtendSolidArea(ScreenPtr pScreen, int x, int y, int w, int h, + + /* Try to extend the area upwards. */ + for ( cy = *y_ptr - 1; +- cy >= y && CheckSolidTile(pScreen, *x_ptr, cy, *w_ptr, 1, &colorValue, TRUE); ++ cy >= y && CheckSolidTile(cl, *x_ptr, cy, *w_ptr, 1, &colorValue, TRUE); + cy-- ); + *h_ptr += *y_ptr - (cy + 1); + *y_ptr = cy + 1; +@@ -396,13 +418,13 @@ ExtendSolidArea(ScreenPtr pScreen, int x, int y, int w, int h, + /* ... downwards. */ + for ( cy = *y_ptr + *h_ptr; + cy < y + h && +- CheckSolidTile(pScreen, *x_ptr, cy, *w_ptr, 1, &colorValue, TRUE); ++ CheckSolidTile(cl, *x_ptr, cy, *w_ptr, 1, &colorValue, TRUE); + cy++ ); + *h_ptr += cy - (*y_ptr + *h_ptr); + + /* ... to the left. */ + for ( cx = *x_ptr - 1; +- cx >= x && CheckSolidTile(pScreen, cx, *y_ptr, 1, *h_ptr, &colorValue, TRUE); ++ cx >= x && CheckSolidTile(cl, cx, *y_ptr, 1, *h_ptr, &colorValue, TRUE); + cx-- ); + *w_ptr += *x_ptr - (cx + 1); + *x_ptr = cx + 1; +@@ -410,7 +432,7 @@ ExtendSolidArea(ScreenPtr pScreen, int x, int y, int w, int h, + /* ... to the right. */ + for ( cx = *x_ptr + *w_ptr; + cx < x + w && +- CheckSolidTile(pScreen, cx, *y_ptr, 1, *h_ptr, &colorValue, TRUE); ++ CheckSolidTile(cl, cx, *y_ptr, 1, *h_ptr, &colorValue, TRUE); + cx++ ); + *w_ptr += cx - (*x_ptr + *w_ptr); + } +@@ -423,11 +445,12 @@ ExtendSolidArea(ScreenPtr pScreen, int x, int y, int w, int h, + */ + + static Bool +-CheckSolidTile(ScreenPtr pScreen, int x, int y, int w, int h, CARD32 *colorPtr, ++CheckSolidTile(rfbClientPtr cl, int x, int y, int w, int h, CARD32 *colorPtr, + Bool needSameColor) + { +- VNCSCREENPTR(pScreen); +- switch(pVNC->rfbServerFormat.bitsPerPixel) { ++ ScreenPtr pScreen = cl->pScreen; ++ ++ switch(cl->format.bitsPerPixel) { + case 32: + return CheckSolidTile32(pScreen, x, y, w, h, colorPtr, needSameColor); + case 16: +@@ -449,7 +472,7 @@ static Bool \ + int dx, dy; \ + \ + fbptr = (CARD##bpp *) \ +- &pVNC->pfbMemory[y * pVNC->paddedWidthInBytes + x * (bpp/8)]; \ ++ &fakeFrameBuffer[(y * pVNC->width + x) * (bpp/8)]; \ + \ + colorValue = *fbptr; \ + if (needSameColor && (CARD32)colorValue != *colorPtr) \ +@@ -460,7 +483,7 @@ static Bool \ + if (colorValue != fbptr[dx]) \ + return FALSE; \ + } \ +- fbptr = (CARD##bpp *)((CARD8 *)fbptr + pVNC->paddedWidthInBytes); \ ++ fbptr = (CARD##bpp *)((CARD8 *)fbptr + pVNC->width * (bpp/8)); \ + } \ + \ + *colorPtr = (CARD32)colorValue; \ +diff --git a/hw/vnc/vncext.c b/hw/vnc/vncext.c +index ea913b7..534f3f5 100644 +--- a/hw/vnc/vncext.c ++++ b/hw/vnc/vncext.c +@@ -702,15 +702,7 @@ CreateResourceTypes(void) + + static unsigned long vncExtGeneration = 0; + #if XFREE86VNC +-extern Bool VNCInit(ScreenPtr pScreen, unsigned char *FBStart); +- +-/* copied from miscrinit.c */ +-typedef struct +-{ +- pointer pbits; /* pointer to framebuffer */ +- int width; /* delta to add to a framebuffer addr to move one row down */ +-} miScreenInitParmsRec, *miScreenInitParmsPtr; +- ++extern Bool VNCInit(ScreenPtr pScreen); + + static Bool + vncCreateScreenResources(ScreenPtr pScreen) +@@ -719,9 +711,6 @@ vncCreateScreenResources(ScreenPtr pScreen) + CreateScreenResourcesProcPtr CreateScreenResources = + (CreateScreenResourcesProcPtr) + dixLookupPrivate(&pScreen->devPrivates, vncCreateScreenResourcesKey); +- miScreenInitParmsPtr pScrInitParms; +- +- pScrInitParms = (miScreenInitParmsPtr)pScreen->devPrivate; + + if ( pScreen->CreateScreenResources != vncCreateScreenResources ) { + /* Can't find hook we are hung on */ +@@ -732,9 +721,6 @@ vncCreateScreenResources(ScreenPtr pScreen) + (void *) pScreen->CreateScreenResources ); + } + +- /* Now do our stuff */ +- VNCInit(pScreen, pScrInitParms->pbits); +- + /* Unhook this function ... */ + pScreen->CreateScreenResources = CreateScreenResources; + dixSetPrivate(&pScreen->devPrivates, vncCreateScreenResourcesKey, NULL); +@@ -744,6 +730,9 @@ vncCreateScreenResources(ScreenPtr pScreen) + ret = (*pScreen->CreateScreenResources)(pScreen); + } + ++ /* Now do our stuff */ ++ VNCInit(pScreen); ++ + #ifdef DEBUG + ErrorF("vncCreateScreenResources() returns %d\n", ret); + #endif +diff --git a/hw/xfree86/vnc/vncInit.c b/hw/xfree86/vnc/vncInit.c +index 4a124fb..8b2fa5f 100644 +--- a/hw/xfree86/vnc/vncInit.c ++++ b/hw/xfree86/vnc/vncInit.c +@@ -49,7 +49,7 @@ extern void VncExtensionInit(void); + + extern void vncInitMouse(void); + extern void vncInitKeyb(void); +-Bool VNCInit(ScreenPtr pScreen, unsigned char *FBStart); ++Bool VNCInit(ScreenPtr pScreen); + + #ifndef XFree86LOADER + static unsigned long VNCGeneration = 0; +@@ -151,7 +151,7 @@ void rfbLogPerror(char *str) + * Called by vncCreateScreenResources() + */ + Bool +-VNCInit(ScreenPtr pScreen, unsigned char *FBStart) ++VNCInit(ScreenPtr pScreen) + { + ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum]; + VisualPtr visual; +@@ -164,9 +164,6 @@ VNCInit(ScreenPtr pScreen, unsigned char *FBStart) + PictureScreenPtr ps; + #endif + +- if (!FBStart) +- return FALSE; +- + #ifndef XFree86LOADER + if (VNCGeneration != serverGeneration) { + VncExtensionInit(); +@@ -287,9 +284,7 @@ VNCInit(ScreenPtr pScreen, unsigned char *FBStart) + pScreenPriv->depth = pScrn->depth; + pScreenPriv->paddedWidthInBytes = PixmapBytePad(pScrn->displayWidth, pScrn->depth); + pScreenPriv->bitsPerPixel = rfbBitsPerPixel(pScrn->depth); +- pScreenPriv->pfbMemory = FBStart; +- pScreenPriv->oldpfbMemory = FBStart; +- ++ + pScreenPriv->cursorIsDrawn = TRUE; + pScreenPriv->dontSendFramebufferUpdate = FALSE; + +diff --git a/hw/xfree86/vnc/vncint.h b/hw/xfree86/vnc/vncint.h +index 18a3630..9e4a36f 100644 +--- a/hw/xfree86/vnc/vncint.h ++++ b/hw/xfree86/vnc/vncint.h +@@ -44,13 +44,11 @@ typedef struct { + size_t buf_filled; + int maxFd; + fd_set allFds; +- unsigned char * oldpfbMemory; + Bool rfbAlwaysShared; + Bool rfbNeverShared; + Bool rfbDontDisconnect; + Bool rfbUserAccept; + Bool rfbViewOnly; +- unsigned char * pfbMemory; + int paddedWidthInBytes; + ColormapPtr rfbInstalledColormap; + ColormapPtr savedColormap; +-- +1.7.3.4 + diff --git a/xorg-server-xf4vnc-fix-keyboard-layout-handling.diff b/N-VNC-Enable-use-of-all-keyboard-layouts-independent-o.patch similarity index 90% rename from xorg-server-xf4vnc-fix-keyboard-layout-handling.diff rename to N-VNC-Enable-use-of-all-keyboard-layouts-independent-o.patch index a48ad53..9e0e8b8 100644 --- a/xorg-server-xf4vnc-fix-keyboard-layout-handling.diff +++ b/N-VNC-Enable-use-of-all-keyboard-layouts-independent-o.patch @@ -1,5 +1,10 @@ -bnc #660797,#605015,#400520 -Enable use of all keyboard layouts, independent of remotely set layout +From: Matthias Hopf +Date: Tue, 6 Sep 2011 08:35:57 +0200 +Subject: [PATCH 5/6] VNC: Enable use of all keyboard layouts, independent of remotely set layout +Patch-Mainline: Currently no upstream project. +Git-commit: 6885b927a6065e6379cfaa3ebbf6c51445a015d9 +Signed-off: Egbert Eich +References: bnc #400520, #605015, #660797 Changes: @@ -22,24 +27,39 @@ Changes: Previous broken version lead to e.g. Shift+PgUp not being recognized. - Add tons of debug output (disabled). -mhopf@suse.de +Signed-off-by: Egbert Eich +--- + hw/vnc/kbdptr.c | 289 +++++++++++++++++++++++++++++++++++++++++------------ + hw/vnc/keyboard.h | 1 + + 2 files changed, 228 insertions(+), 62 deletions(-) -Index: xorg-server-1.9.3/hw/vnc/kbdptr.c -=================================================================== ---- xorg-server-1.9.3.orig/hw/vnc/kbdptr.c -+++ xorg-server-1.9.3/hw/vnc/kbdptr.c -@@ -33,6 +33,8 @@ - #define NEED_EVENTS +diff --git a/hw/vnc/kbdptr.c b/hw/vnc/kbdptr.c +index f306022..b3b0e68 100644 +--- a/hw/vnc/kbdptr.c ++++ b/hw/vnc/kbdptr.c +@@ -34,6 +34,8 @@ #include "X11/Xproto.h" #include "inputstr.h" + #include "inpututils.h" +#include "xkbsrv.h" +#include "xkbstr.h" #define XK_CYRILLIC #include #include -@@ -46,19 +48,17 @@ +@@ -46,6 +48,7 @@ + #include "dmxinput.h" #endif ++#if 0 + #if !XFREE86VNC + + #define MIN_KEY_CODE 8 +@@ -196,21 +199,20 @@ static KeySym map[MAX_KEY_CODE * GLYPHS_PER_KEY] = { + #define N_PREDEFINED_KEYS (sizeof(map) / (sizeof(KeySym) * GLYPHS_PER_KEY)) + + #endif ++#endif + #define KEY_IS_PRESSED(keycode) \ - (kbdDevice->key->down[(keycode) >> 3] & (1 << ((keycode) & 7))) + (inputInfo.keyboard->key->down[(keycode) >> 3] & (1 << ((keycode) & 7))) @@ -60,7 +80,7 @@ Index: xorg-server-1.9.3/hw/vnc/kbdptr.c } -@@ -126,6 +126,29 @@ EnqueueKey(DeviceIntPtr kbdDev, int type +@@ -280,6 +282,29 @@ EnqueueKey(DeviceIntPtr kbdDev, int type, int detail) mieqEnqueue(kbdDev, (InternalEvent*)(events + i)->event); } @@ -90,7 +110,7 @@ Index: xorg-server-1.9.3/hw/vnc/kbdptr.c /* * Called when the rfbserver receives a rfbKeyEvent event from a client. * Put an X keyboard event into the event queue. -@@ -134,21 +157,35 @@ void +@@ -288,21 +313,35 @@ void KbdAddEvent(Bool down, KeySym keySym, rfbClientPtr cl) { const int type = down ? KeyPress : KeyRelease; @@ -128,13 +148,13 @@ Index: xorg-server-1.9.3/hw/vnc/kbdptr.c + group = xkbInfo->state.group; + level = (KEY_IS_PRESSED(ISO_LEVEL3_KEY_CODE) ? 2 : 0) | + (XkbStateFieldFromRec(&xkbInfo->state) & ShiftMask ? 1 : 0); -+#if 0 ++#ifdef DEBUG + ErrorF ("VNCkbd:\t%s Sym %04x\n", down ? "+":"-", (int)keySym); +#endif #ifdef CORBA if (cl) { -@@ -166,6 +203,12 @@ KbdAddEvent(Bool down, KeySym keySym, rf +@@ -320,6 +359,12 @@ KbdAddEvent(Bool down, KeySym keySym, rfbClientPtr cl) * * Alan. */ @@ -143,11 +163,11 @@ Index: xorg-server-1.9.3/hw/vnc/kbdptr.c + * keyboard layouts. Not being able to work with non-local xmodmaps + * is a nuisance at worst, and probably even preferred. + * 2011-04-15 mhopf@suse.de */ -+#if 0 ++#ifdef NOTANYMORE #if !XFREE86VNC /* First check if it's one of our predefined keys. If so then we can make some attempt at allowing an xmodmap inside a VNC desktop behave -@@ -192,107 +235,229 @@ KbdAddEvent(Bool down, KeySym keySym, rf +@@ -346,107 +391,227 @@ KbdAddEvent(Bool down, KeySym keySym, rfbClientPtr cl) } } #endif @@ -163,30 +183,7 @@ Index: xorg-server-1.9.3/hw/vnc/kbdptr.c - "less than 2 keysyms per keycode (KeySym 0x%x)\n", (int)keySym); - return; - } -+ for (keyCode = MIN_KEY_CODE; keyCode < MIN_KEY_CODE + NO_OF_KEYS; keyCode++) { -+ /* Check all keycodes, but only continue on those where -+ * backconversion results in keySym. -+ * 2011-05-20 mhopf@suse.de */ -+ int j; -+ -+#if 0 -+ ErrorF (" keyCode %3d map# %4d++ level %d of %d: keySyms", -+ keyCode, (i / keySyms->mapWidth) * keySyms->mapWidth, -+ i % keySyms->mapWidth, keySyms->mapWidth); -+ for (j = 0; j < keySyms->mapWidth; j++) -+ ErrorF (" %02x", (int)keySyms->map[(i / keySyms->mapWidth) * keySyms->mapWidth + j]); -+ ErrorF ("\n"); -+#endif -+#if 0 -+ ErrorF (" group %d of %d width %d: keySyms", -+ group, XkbKeyNumGroups(xkbInfo->desc, keyCode), -+ XkbKeyGroupWidth(xkbInfo->desc, keyCode, group)); -+ if (XkbKeyNumGroups(xkbInfo->desc, keyCode) > group) -+ for (j = 0; j < XkbKeyGroupWidth(xkbInfo->desc, keyCode, group); j++) -+ ErrorF (" %02x", (int) XkbKeySymEntry(xkbInfo->desc, keyCode, j, group)); -+ ErrorF ("\n"); -+#endif - +- - for (i = 0; i < NO_OF_KEYS * keySyms->mapWidth; i++) { - if (keySym == keySyms->map[i]) { - keyCode = MIN_KEY_CODE + i / keySyms->mapWidth; @@ -196,7 +193,28 @@ Index: xorg-server-1.9.3/hw/vnc/kbdptr.c - - /* this keycode has more than one symbol associated with - it, so shift state is important */ -- ++ for (keyCode = MIN_KEY_CODE; keyCode < MIN_KEY_CODE + NO_OF_KEYS; keyCode++) { ++ /* Check all keycodes, but only continue on those where ++ * backconversion results in keySym. ++ * 2011-05-20 mhopf@suse.de */ ++ ++#ifdef DEBUG ++ int j; ++ ErrorF (" keyCode %3d map# %4d++ level %d of %d: keySyms", ++ keyCode, (i / keySyms->mapWidth) * keySyms->mapWidth, ++ i % keySyms->mapWidth, keySyms->mapWidth); ++ for (j = 0; j < keySyms->mapWidth; j++) ++ ErrorF (" %02x", (int)keySyms->map[(i / keySyms->mapWidth) * keySyms->mapWidth + j]); ++ ErrorF ("\n"); ++ ErrorF (" group %d of %d width %d: keySyms", ++ group, XkbKeyNumGroups(xkbInfo->desc, keyCode), ++ XkbKeyGroupWidth(xkbInfo->desc, keyCode, group)); ++ if (XkbKeyNumGroups(xkbInfo->desc, keyCode) > group) ++ for (j = 0; j < XkbKeyGroupWidth(xkbInfo->desc, keyCode, group); j++) ++ ErrorF (" %02x", (int) XkbKeySymEntry(xkbInfo->desc, keyCode, j, group)); ++ ErrorF ("\n"); ++#endif + - if ((i % keySyms->mapWidth) == 0) - shiftMustBeReleased = TRUE; - else @@ -256,7 +274,7 @@ Index: xorg-server-1.9.3/hw/vnc/kbdptr.c + /* A keyCode is free if no groups are assigned at all */ + if (XkbKeyNumGroups(xkbInfo->desc, keyCode) == 0) + break; -+#if 0 ++#ifdef NOTANYMORE + /* We can use exact map positions for group 1+2, but only partially + * filling out xkb legacy maps may suddenly change the # of groups. + * Reason for that is unknown yet. Might be related to (fixed) NoSymbol issue. @@ -302,7 +320,7 @@ Index: xorg-server-1.9.3/hw/vnc/kbdptr.c + /* Adding keys is not using xkb mechanisms yet, but relying on support + * for changing keys in the legacy map. Should be changed, eventually. + * 2011-05-19 mhopf@suse.de */ -+#if 0 ++#ifdef NOTANYMORE + if (group < 2) { + /* Only set mapping for active group. Will only work with dual layouts. + * 2011-05-23 mhopf@suse.de */ @@ -347,7 +365,7 @@ Index: xorg-server-1.9.3/hw/vnc/kbdptr.c } - xkb = &kbdDevice->key->xkbInfo->state; -+#if 0 ++#ifdef DEBUG + ErrorF ("\t%s Sym %04x Code%3d\tState x%02x %s%s%s\tSh %s%s\tL3 %s%s\n", + down ? "+":"-", (int)keySym, keyCode, XkbStateFieldFromRec(&xkbInfo->state), + KEY_IS_PRESSED(SHIFT_L_KEY_CODE) ? "Sl":"", @@ -356,7 +374,7 @@ Index: xorg-server-1.9.3/hw/vnc/kbdptr.c + shiftMustBePressed ? "+":"", shiftMustBeReleased ? "-":"", + level3MustBePressed ? "+":"", level3MustBeReleased ? "-":""); +#endif -+#if 0 ++#ifdef NOTANYMORE + int back = _XkbKeycodeToKeysym (xkbInfo->desc, keyCode, group, + ((level3MustBePressed || (!level3MustBeReleased && (level & 2))) ? 2 : 0) | + ((shiftMustBePressed || (!shiftMustBeReleased && (level & 1))) ? 1 : 0)); @@ -422,7 +440,7 @@ Index: xorg-server-1.9.3/hw/vnc/kbdptr.c } } -@@ -343,15 +508,15 @@ KbdReleaseAllKeys(void) +@@ -497,15 +662,15 @@ KbdReleaseAllKeys(void) { int i, j; @@ -442,15 +460,15 @@ Index: xorg-server-1.9.3/hw/vnc/kbdptr.c } } } -Index: xorg-server-1.9.3/hw/vnc/keyboard.h -=================================================================== ---- xorg-server-1.9.3.orig/hw/vnc/keyboard.h -+++ xorg-server-1.9.3/hw/vnc/keyboard.h -@@ -32,6 +32,7 @@ +diff --git a/hw/vnc/keyboard.h b/hw/vnc/keyboard.h +index d223b6b..beb948a 100644 +--- a/hw/vnc/keyboard.h ++++ b/hw/vnc/keyboard.h +@@ -32,3 +32,4 @@ #define META_R_KEY_CODE (MIN_KEY_CODE + 108) #define ALT_L_KEY_CODE (MIN_KEY_CODE + 56) #define ALT_R_KEY_CODE (MIN_KEY_CODE + 105) -+#define ISO_LEVEL3_KEY_CODE ALT_R_KEY_CODE - - static KeySym map[MAX_KEY_CODE * GLYPHS_PER_KEY] = { - /* 0x00 */ NoSymbol, NoSymbol, NoSymbol, NoSymbol, ++#define ISO_LEVEL3_KEY_CODE ALT_R_KEY_CODE +-- +1.7.3.4 + diff --git a/N-VNC-Fix-crash-due-to-unset-input-device-names.patch b/N-VNC-Fix-crash-due-to-unset-input-device-names.patch new file mode 100644 index 0000000..7c527a1 --- /dev/null +++ b/N-VNC-Fix-crash-due-to-unset-input-device-names.patch @@ -0,0 +1,125 @@ +From: Egbert Eich +Date: Tue, 6 Sep 2011 14:58:28 +0200 +Subject: [PATCH 6/6] VNC: Fix crash due to unset input device names. +Patch-Mainline: Currently no upstream project. +Git-commit: b756a7efff37021ca503fe1e63084daae4082e9d +Signed-off: Egbert Eich +References: bnc #716074 + + Signed-off-by: Egbert Eich + +--- + hw/vnc/init.c | 2 +- + hw/vnc/rfb.h | 2 +- + hw/vnc/rfbkeyb.c | 7 +++++-- + hw/vnc/rfbmouse.c | 9 +++++++-- + 4 files changed, 14 insertions(+), 6 deletions(-) + +diff --git a/hw/vnc/init.c b/hw/vnc/init.c +index 0977fee..6f83aa8 100644 +--- a/hw/vnc/init.c ++++ b/hw/vnc/init.c +@@ -816,7 +816,7 @@ rfbMouseProc(DeviceIntPtr pDevice, int onoff) + switch (onoff) + { + case DEVICE_INIT: +- PtrDeviceInit(); ++ PtrDeviceInit(pDevice, "vncMouse"); + map[1] = 1; + map[2] = 2; + map[3] = 3; +diff --git a/hw/vnc/rfb.h b/hw/vnc/rfb.h +index 70b1a45..aa9abab 100644 +--- a/hw/vnc/rfb.h ++++ b/hw/vnc/rfb.h +@@ -578,7 +578,7 @@ extern void rfbGotXCutText(char *str, int len); + extern Bool compatibleKbd; + extern unsigned char ptrAcceleration; + +-extern void PtrDeviceInit(void); ++extern void PtrDeviceInit(DeviceIntPtr pDevice, char *name); + extern void PtrDeviceOn(DeviceIntPtr pDev); + extern void PtrDeviceOff(void); + extern void PtrDeviceControl(DeviceIntPtr dev, PtrCtrl *ctrl); +diff --git a/hw/vnc/rfbkeyb.c b/hw/vnc/rfbkeyb.c +index 4da29c2..6d97999 100644 +--- a/hw/vnc/rfbkeyb.c ++++ b/hw/vnc/rfbkeyb.c +@@ -36,6 +36,7 @@ + #endif + #include + #include /* Needed for InitValuator/Proximity stuff */ ++#include + #include + + #ifdef XFree86LOADER +@@ -49,7 +50,6 @@ + + + extern void rfbSendBell(void); +-extern DeviceIntPtr kbdDevice; + extern void vncInitKeyb(void); + + #include +@@ -212,11 +212,15 @@ static KeySym map[MAX_KEY_CODE * GLYPHS_PER_KEY] = { + }; + + #define N_PREDEFINED_KEYS (sizeof(map) / (sizeof(KeySym) * GLYPHS_PER_KEY)) ++#define RFB_KEYB "rfbKeyb" + + void + KbdDeviceInit(DeviceIntPtr pDevice, KeySymsPtr pKeySyms, CARD8 *pModMap) + { + int i; ++ Atom atom = MakeAtom(RFB_KEYB, strlen(RFB_KEYB), TRUE); ++ ++ AssignTypeAndName(pDevice, atom, RFB_KEYB); + + for (i = 0; i < MAP_LENGTH; i++) + pModMap[i] = NoSymbol; +@@ -359,7 +363,6 @@ xf86rfbKeybInit(struct _InputDriverRec *drv, + pInfo->control_proc = NULL; + pInfo->switch_mode = NULL; + pInfo->fd = -1; +- pInfo->dev = NULL; + + /* Collect the options, and process the common options. */ + xf86CollectInputOptions(pInfo, (const char**)drv->default_options); +diff --git a/hw/vnc/rfbmouse.c b/hw/vnc/rfbmouse.c +index 4657128..86e8f2f 100644 +--- a/hw/vnc/rfbmouse.c ++++ b/hw/vnc/rfbmouse.c +@@ -37,6 +37,7 @@ + #endif + #include + #include /* Needed for InitValuator/Proximity stuff */ ++#include + #include + + #ifdef XFree86LOADER +@@ -63,8 +64,12 @@ PtrDeviceOn(DeviceIntPtr pDev) + } + + void +-PtrDeviceInit(void) ++PtrDeviceInit(DeviceIntPtr pDevice, char *name) + { ++ Atom atom = MakeAtom(name, strlen(name), TRUE); ++ ++ AssignTypeAndName(pDevice, atom, name); ++ + } + + void +@@ -119,7 +124,7 @@ xf86rfbMouseControlProc(DeviceIntPtr dev, int onoff) + { + case DEVICE_INIT: + vncSetPointerDevice(dev); +- PtrDeviceInit(); ++ // PtrDeviceInit(dev, "rfbPointer"); + map[1] = 1; + map[2] = 2; + map[3] = 3; +-- +1.7.3.4 + diff --git a/xorg-server-xf4vnc-TranslateNone.diff b/N-VNC-Fix-crash-when-no-depth-translation-is-required.patch similarity index 52% rename from xorg-server-xf4vnc-TranslateNone.diff rename to N-VNC-Fix-crash-when-no-depth-translation-is-required.patch index c14752d..c269672 100644 --- a/xorg-server-xf4vnc-TranslateNone.diff +++ b/N-VNC-Fix-crash-when-no-depth-translation-is-required.patch @@ -1,11 +1,25 @@ -Index: xorg-server-1.6.3.901/hw/vnc/translate.c -================================================================================ ---- xorg-server-1.7.99/hw/vnc/translate.c -+++ xorg-server-1.7.99/hw/vnc/translate.c -@@ -168,17 +168,17 @@ +From: Michael Schroeder +Date: Tue, 6 Sep 2011 07:58:33 +0200 +Subject: [PATCH 3/6] VNC: Fix crash when no depth translation is required. +Patch-Mainline: Currently no upstream project. +Git-commit: 74d5e3115cd955b7ee1acc64c6b8b42198ed894b +Signed-off: Egbert Eich +References: bnc #389386 + + Signed-off-by: Egbert Eich + +--- + hw/vnc/translate.c | 11 ++++++----- + 1 files changed, 6 insertions(+), 5 deletions(-) + +diff --git a/hw/vnc/translate.c b/hw/vnc/translate.c +index 5cc57a3..78030ed 100644 +--- a/hw/vnc/translate.c ++++ b/hw/vnc/translate.c +@@ -168,17 +168,18 @@ rfbTranslateNone(ScreenPtr pScreen, char *table, rfbPixelFormat *in, rfbPixelFor { VNCSCREENPTR(pScreen); - DrawablePtr pDraw = (DrawablePtr)WindowTable[pScreen->myNum]; + DrawablePtr pDraw = (DrawablePtr)pScreen->root; - int truewidth = PixmapBytePad(width, in->bitsPerPixel) / 4; + int truewidth = PixmapBytePad(width, in->bitsPerPixel); @@ -17,6 +31,7 @@ Index: xorg-server-1.6.3.901/hw/vnc/translate.c - (*pScreen->GetImage)(pDraw, x, y, truewidth, height, ZPixmap, ~0, (char*)buf); + (*pScreen->GetImage)(pDraw, x, y, width, height, ZPixmap, ~0, (char*)buf); ++ while (height--) { memcpy(optr, buf, width * in->bitsPerPixel / 8); optr += width * in->bitsPerPixel / 8; @@ -25,3 +40,6 @@ Index: xorg-server-1.6.3.901/hw/vnc/translate.c } free(buffer); return; +-- +1.7.3.4 + diff --git a/N-VNC-Readd-timeout-when-vnc-viewer-connection-breaks.patch b/N-VNC-Readd-timeout-when-vnc-viewer-connection-breaks.patch new file mode 100644 index 0000000..ce2d2b1 --- /dev/null +++ b/N-VNC-Readd-timeout-when-vnc-viewer-connection-breaks.patch @@ -0,0 +1,74 @@ +From: Egbert Eich +Date: Tue, 6 Sep 2011 07:02:11 +0200 +Subject: [PATCH 2/6] VNC: Readd timeout when vnc viewer connection breaks. +Patch-Mainline: Currently no upstream project. +Git-commit: 759b49ed1c4ea03e45433c92c2fb8c44a60db34a +Signed-off: Egbert Eich +References: bnc #441935, bnc #403901 + +This prevents Xvnc busy loop forever waiting for a viewer that no longer +response due to network or other issues. + +Signed-off-by: Egbert Eich +--- + hw/vnc/sockets.c | 19 +++++-------------- + 1 files changed, 5 insertions(+), 14 deletions(-) + +diff --git a/hw/vnc/sockets.c b/hw/vnc/sockets.c +index 39eb88a..ae43ed0 100644 +--- a/hw/vnc/sockets.c ++++ b/hw/vnc/sockets.c +@@ -442,9 +442,7 @@ WriteExact(int sock, char *buf, int len) + int n; + fd_set fds; + struct timeval tv; +-#if 0 + int totalTimeWaited = 0; +-#endif + + while (len > 0) { + n = write(sock, buf, len); +@@ -464,7 +462,6 @@ WriteExact(int sock, char *buf, int len) + return n; + } + +-#if 0 + /* Retry every 5 seconds until we exceed rfbMaxClientWait. We + need to do this because select doesn't necessarily return + immediately when the other end has gone away */ +@@ -473,19 +470,14 @@ WriteExact(int sock, char *buf, int len) + FD_SET(sock, &fds); + tv.tv_sec = 5; + tv.tv_usec = 0; +-#else +- /* We're in the WakeupHandler now, so don't wait */ + +- FD_ZERO(&fds); +- FD_SET(sock, &fds); +- tv.tv_sec = 0; +- tv.tv_usec = 0; +-#endif + n = select(sock+1, NULL, &fds, NULL, &tv); +-#if 0 ++ + if (n < 0) { +- rfbLogPerror("WriteExact: select"); +- return n; ++ if (errno != EINTR) { ++ rfbLogPerror("WriteExact: select"); ++ return n; ++ } + } + if (n == 0) { + totalTimeWaited += 5000; +@@ -496,7 +488,6 @@ WriteExact(int sock, char *buf, int len) + } else { + totalTimeWaited = 0; + } +-#endif + } + } + return 1; +-- +1.7.3.4 + diff --git a/Replace-malloc-with-calloc-to-initialize-the-buffers.patch b/Replace-malloc-with-calloc-to-initialize-the-buffers.patch deleted file mode 100644 index a65201b..0000000 --- a/Replace-malloc-with-calloc-to-initialize-the-buffers.patch +++ /dev/null @@ -1,34 +0,0 @@ -From a73c28f0bdafb1c5cb8129179188a99c0ca052e2 Mon Sep 17 00:00:00 2001 -From: Justin Dou -Date: Thu, 10 Feb 2011 16:27:29 -0500 -Subject: [PATCH] Replace malloc with calloc to initialize the buffers[] as NULL in do_get_buffers function -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -The calling for allocate_or_reuse_buffer may fail due to some reason, e.g. out of memory. -If the buffers[] were not initialized to be NULL, the following err_out may try to access an illegal memory, which will cause X crash afterward. - -Reviewed-by: Kristian Høgsberg -Signed-off-by: Justin Dou -Signed-off-by: Keith Packard ---- - hw/xfree86/dri2/dri2.c | 2 +- - 1 files changed, 1 insertions(+), 1 deletions(-) - -diff --git a/hw/xfree86/dri2/dri2.c b/hw/xfree86/dri2/dri2.c -index 39996f9..9ca378f 100644 ---- a/hw/xfree86/dri2/dri2.c -+++ b/hw/xfree86/dri2/dri2.c -@@ -403,7 +403,7 @@ do_get_buffers(DrawablePtr pDraw, int *width, int *height, - && (pDraw->height == pPriv->height) - && (pPriv->serialNumber == DRI2DrawableSerial(pDraw)); - -- buffers = malloc((count + 1) * sizeof(buffers[0])); -+ buffers = calloc((count + 1), sizeof(buffers[0])); - - for (i = 0; i < count; i++) { - const unsigned attachment = *(attachments++); --- -1.7.4.1 - diff --git a/U_xserver_fix-pixmaps-lifetime-tracking.patch b/U_xserver_fix-pixmaps-lifetime-tracking.patch deleted file mode 100644 index 6e4a36c..0000000 --- a/U_xserver_fix-pixmaps-lifetime-tracking.patch +++ /dev/null @@ -1,83 +0,0 @@ -From 6a433b67ca15fd1ea58334e607f867554f227451 Mon Sep 17 00:00:00 2001 -From: Adam Jackson -Date: Mon, 28 Mar 2011 16:30:09 +0000 -Subject: glx: Fix lifetime tracking for pixmaps - -GLX pixmaps take a reference on the underlying pixmap; X and GLX pixmap -IDs can be destroyed in either order with no error. Only windows need -to be tracked under both XIDs. - -Fixes piglit/glx-pixmap-life. - -Reviewed-by: Michel Dänzer -Signed-off-by: Adam Jackson ---- -Index: xorg-server-1.9.3/glx/glxcmds.c -=================================================================== ---- xorg-server-1.9.3.orig/glx/glxcmds.c -+++ xorg-server-1.9.3/glx/glxcmds.c -@@ -1132,10 +1132,11 @@ DoCreateGLXDrawable(ClientPtr client, __ - return BadAlloc; - } - -- /* Add the glx drawable under the XID of the underlying X drawable -- * too. That way we'll get a callback in DrawableGone and can -- * clean up properly when the drawable is destroyed. */ -- if (drawableId != glxDrawableId && -+ /* -+ * Windows aren't refcounted, so track both the X and the GLX window -+ * so we get called regardless of destruction order. -+ */ -+ if (drawableId != glxDrawableId && type == GLX_DRAWABLE_WINDOW && - !AddResource(pDraw->id, __glXDrawableRes, pGlxDraw)) { - pGlxDraw->destroy (pGlxDraw); - return BadAlloc; -@@ -1166,6 +1167,8 @@ DoCreateGLXPixmap(ClientPtr client, __GL - err = DoCreateGLXDrawable(client, pGlxScreen, config, pDraw, drawableId, - glxDrawableId, GLX_DRAWABLE_PIXMAP); - -+ ((PixmapPtr)pDraw)->refcnt++; -+ - return err; - } - -Index: xorg-server-1.9.3/glx/glxext.c -=================================================================== ---- xorg-server-1.9.3.orig/glx/glxext.c -+++ xorg-server-1.9.3/glx/glxext.c -@@ -126,15 +126,15 @@ static Bool DrawableGone(__GLXdrawable * - { - __GLXcontext *c, *next; - -- /* If this drawable was created using glx 1.3 drawable -- * constructors, we added it as a glx drawable resource under both -- * its glx drawable ID and it X drawable ID. Remove the other -- * resource now so we don't a callback for freed memory. */ -- if (glxPriv->drawId != glxPriv->pDraw->id) { -- if (xid == glxPriv->drawId) -- FreeResourceByType(glxPriv->pDraw->id, __glXDrawableRes, TRUE); -- else -- FreeResourceByType(glxPriv->drawId, __glXDrawableRes, TRUE); -+ if (glxPriv->type == GLX_DRAWABLE_WINDOW) { -+ /* If this was created by glXCreateWindow, free the matching resource */ -+ if (glxPriv->drawId != glxPriv->pDraw->id) { -+ if (xid == glxPriv->drawId) -+ FreeResourceByType(glxPriv->pDraw->id, __glXDrawableRes, TRUE); -+ else -+ FreeResourceByType(glxPriv->drawId, __glXDrawableRes, TRUE); -+ } -+ /* otherwise this window was implicitly created by MakeCurrent */ - } - - for (c = glxAllContexts; c; c = next) { -@@ -170,6 +170,10 @@ static Bool DrawableGone(__GLXdrawable * - __glXFreeContext(c); - } - -+ /* drop our reference to any backing pixmap */ -+ if (glxPriv->type == GLX_DRAWABLE_PIXMAP) -+ glxPriv->pDraw->pScreen->DestroyPixmap((PixmapPtr)glxPriv->pDraw); -+ - glxPriv->destroy(glxPriv); - - return True; diff --git a/Xvnc-pthread.diff b/Xvnc-pthread.diff new file mode 100644 index 0000000..b76a6ef --- /dev/null +++ b/Xvnc-pthread.diff @@ -0,0 +1,20 @@ +--- xorg-server-1.10.4/hw/vnc/Makefile.am.orig 2011-09-06 15:25:27.000000000 +0000 ++++ xorg-server-1.10.4/hw/vnc/Makefile.am 2011-09-06 15:26:40.000000000 +0000 +@@ -37,6 +37,7 @@ + JPEG_LIBS = -ljpeg + CRYPT_LIBS = -lcrypt + Z_LIBS = -lz ++PTHREAD_LIBS = -lpthread + + AM_CFLAGS = $(DIX_CFLAGS) $(XVNC_CFLAGS) -I$(top_srcdir)/hw/dmx/vnc -DCHROMIUM=1 + +@@ -48,7 +49,8 @@ + $(CRYPT_LIBS) \ + $(XSERVER_SYS_LIBS) \ + $(VNCMODULES_LIBS) \ +- $(Z_LIBS) ++ $(Z_LIBS) \ ++ $(PTHREAD_LIBS) + + + relink: diff --git a/bug534768-prefer_local_symbols.patch b/bug534768-prefer_local_symbols.patch index 7a8a81c..b7e4e6c 100644 --- a/bug534768-prefer_local_symbols.patch +++ b/bug534768-prefer_local_symbols.patch @@ -1,25 +1,11 @@ Index: xorg-server-1.6.3.901/hw/xfree86/loader/dlloader.c ================================================================================ ---- xorg-server-1.7.99/hw/xfree86/loader/dlloader.c -+++ xorg-server-1.7.99/hw/xfree86/loader/dlloader.c -@@ -120,7 +120,7 @@ - } +--- xorg-server-1.7.99/hw/xfree86/loader/loader.c ++++ xorg-server-1.7.99/hw/xfree86/loader/loader.c +@@ -120,5 +120,5 @@ if (!global_scope) - global_scope = dlopen(NULL, DLOPEN_LAZY | DLOPEN_GLOBAL); + global_scope = dlopen(NULL, DLOPEN_LAZY | DLOPEN_GLOBAL | RTLD_DEEPBIND); if (global_scope) - return DLFindSymbolLocal(global_scope, name); -@@ -136,9 +136,9 @@ - int dlopen_flags; - - if (flags & LD_FLAG_GLOBAL) -- dlopen_flags = DLOPEN_LAZY | DLOPEN_GLOBAL; -+ dlopen_flags = DLOPEN_LAZY | DLOPEN_GLOBAL | RTLD_DEEPBIND; - else -- dlopen_flags = DLOPEN_LAZY; -+ dlopen_flags = DLOPEN_LAZY | RTLD_DEEPBIND; - dlfile = dlopen(modrec->name, dlopen_flags); - if (dlfile == NULL) { - ErrorF("dlopen: %s\n", dlerror()); diff --git a/commit-5c6a2f9.diff b/commit-5c6a2f9.diff deleted file mode 100644 index 10ebda8..0000000 --- a/commit-5c6a2f9.diff +++ /dev/null @@ -1,166 +0,0 @@ -commit 5c6a2f93ebc16a78093782b442306de23ae94e78 -Author: Chris Wilson -Date: Mon Sep 27 19:39:23 2010 +0100 - - xfree86: Kill pixmapPrivate with a vengeance (v2) - - ScrnInfo->pixmapPrivate only existed in order to catch invalid access to - the framebuffer by making the backing data NULL across the VT switch. - This was causing more confusion in the higher layers during mode setting - without any real benefit, so remove it. - - v2: Kill ShadowModifyPixmapHeader() as well. - - Signed-off-by: Chris Wilson - Cc: Julien Cristau - Cc: Andrew Guertin - Reviewed-by: Keith Packard - Signed-off-by: Keith Packard - -diff --git a/hw/xfree86/common/xf86Helper.c b/hw/xfree86/common/xf86Helper.c -index 90e0c67..97e5aec 100644 ---- a/hw/xfree86/common/xf86Helper.c -+++ b/hw/xfree86/common/xf86Helper.c -@@ -1180,10 +1180,6 @@ xf86EnableDisableFBAccess(int scrnIndex, Bool enable) - if (enable) - { - /* -- * Restore the screen pixmap devPrivate field -- */ -- pspix->devPrivate = pScrnInfo->pixmapPrivate; -- /* - * Restore all of the clip lists on the screen - */ - if (!xf86Resetting) -@@ -1196,13 +1192,6 @@ xf86EnableDisableFBAccess(int scrnIndex, Bool enable) - * Empty all of the clip lists on the screen - */ - xf86SetRootClip (pScreen, FALSE); -- /* -- * save the screen pixmap devPrivate field and -- * replace it with NULL so accidental references -- * to the frame buffer are caught -- */ -- pScrnInfo->pixmapPrivate = pspix->devPrivate; -- pspix->devPrivate.ptr = NULL; - } - } - -diff --git a/hw/xfree86/common/xf86str.h b/hw/xfree86/common/xf86str.h -index c9b261d..b979884 100644 ---- a/hw/xfree86/common/xf86str.h -+++ b/hw/xfree86/common/xf86str.h -@@ -765,7 +765,7 @@ typedef struct _ScrnInfoRec { - - /* Allow screens to be enabled/disabled individually */ - Bool vtSema; -- DevUnion pixmapPrivate; /* saved devPrivate from pixmap */ -+ DevUnion pixmapPrivate; /* XXX obsoleted; just for ABI compatibility */ - - /* hw cursor moves at SIGIO time */ - Bool silkenMouse; -diff --git a/hw/xfree86/modes/xf86RandR12.c b/hw/xfree86/modes/xf86RandR12.c -index 8a593a7..ba0862a 100644 ---- a/hw/xfree86/modes/xf86RandR12.c -+++ b/hw/xfree86/modes/xf86RandR12.c -@@ -511,7 +511,6 @@ xf86RandR12SetMode (ScreenPtr pScreen, - WindowPtr pRoot = pScreen->root; - DisplayModePtr currentMode = NULL; - Bool ret = TRUE; -- PixmapPtr pspix = NULL; - - if (pRoot) - (*scrp->EnableDisableFBAccess) (pScreen->myNum, FALSE); -@@ -560,14 +559,6 @@ xf86RandR12SetMode (ScreenPtr pScreen, - pScreen->mmHeight = oldmmHeight; - scrp->currentMode = currentMode; - } -- /* -- * Get the new Screen pixmap ptr as SwitchMode might have called -- * ModifyPixmapHeader and xf86EnableDisableFBAccess will put it back... -- * Unfortunately. -- */ -- pspix = (*pScreen->GetScreenPixmap) (pScreen); -- if (pspix->devPrivate.ptr) -- scrp->pixmapPrivate = pspix->devPrivate; - - /* - * Make sure the layout is correct -diff --git a/hw/xfree86/shadowfb/shadow.c b/hw/xfree86/shadowfb/shadow.c -index 0af53d1..5cc476a 100644 ---- a/hw/xfree86/shadowfb/shadow.c -+++ b/hw/xfree86/shadowfb/shadow.c -@@ -36,15 +36,6 @@ static void ShadowCopyWindow( - RegionPtr prgn - ); - static Bool ShadowCreateGC(GCPtr pGC); --static Bool ShadowModifyPixmapHeader( -- PixmapPtr pPixmap, -- int width, -- int height, -- int depth, -- int bitsPerPixel, -- int devKind, -- pointer pPixData --); - - static Bool ShadowEnterVT(int index, int flags); - static void ShadowLeaveVT(int index, int flags); -@@ -189,7 +180,6 @@ ShadowFBInit2 ( - pScreen->CloseScreen = ShadowCloseScreen; - pScreen->CopyWindow = ShadowCopyWindow; - pScreen->CreateGC = ShadowCreateGC; -- pScreen->ModifyPixmapHeader = ShadowModifyPixmapHeader; - - pScrn->EnterVT = ShadowEnterVT; - pScrn->LeaveVT = ShadowLeaveVT; -@@ -310,49 +300,6 @@ ShadowCopyWindow( - } - } - --static Bool --ShadowModifyPixmapHeader( -- PixmapPtr pPixmap, -- int width, -- int height, -- int depth, -- int bitsPerPixel, -- int devKind, -- pointer pPixData --) --{ -- ScreenPtr pScreen; -- ScrnInfoPtr pScrn; -- ShadowScreenPtr pPriv; -- Bool retval; -- PixmapPtr pScreenPix; -- -- if (!pPixmap) -- return FALSE; -- -- pScreen = pPixmap->drawable.pScreen; -- pScrn = xf86Screens[pScreen->myNum]; -- -- pScreenPix = (*pScreen->GetScreenPixmap)(pScreen); -- -- if (pPixmap == pScreenPix && !pScrn->vtSema) -- pScreenPix->devPrivate = pScrn->pixmapPrivate; -- -- pPriv = GET_SCREEN_PRIVATE(pScreen); -- -- pScreen->ModifyPixmapHeader = pPriv->ModifyPixmapHeader; -- retval = (*pScreen->ModifyPixmapHeader)(pPixmap, -- width, height, depth, bitsPerPixel, devKind, pPixData); -- pScreen->ModifyPixmapHeader = ShadowModifyPixmapHeader; -- -- if (pPixmap == pScreenPix && !pScrn->vtSema) -- { -- pScrn->pixmapPrivate = pScreenPix->devPrivate; -- pScreenPix->devPrivate.ptr = 0; -- } -- return retval; --} -- - static void - ShadowComposite( - CARD8 op, diff --git a/pad-size-of-system-memory-copy-for-1x1-pixmaps b/pad-size-of-system-memory-copy-for-1x1-pixmaps deleted file mode 100644 index 0dc60f4..0000000 --- a/pad-size-of-system-memory-copy-for-1x1-pixmaps +++ /dev/null @@ -1,29 +0,0 @@ -From: Michel Dänzer -Subject: Pad size of system memory copy for 1x1 pixmaps -References: bfo#32803 bnc#652523 - -Temporary description by: Jeff Mahoney - This patch fixes a crash that occured frequently with glibc malloc - perturbing enabled and was a bit more random otherwise. The issue - appears to be that the pExaPixmap for 1x1 pixmaps was allocating a single - byte. The patch uses paddedWidth, which I expect is 4 bytes instead. - -Acked-by: Jeff Mahoney ---- - - exa/exa_mixed.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/exa/exa_mixed.c b/exa/exa_mixed.c -index ef20eb5..606f1e1 100644 ---- a/exa/exa_mixed.c -+++ b/exa/exa_mixed.c -@@ -98,7 +98,7 @@ exaCreatePixmap_mixed(ScreenPtr pScreen, int w, int h, int depth, - pExaPixmap->use_gpu_copy = FALSE; - - if (w == 1 && h == 1) { -- pExaPixmap->sys_ptr = malloc((pPixmap->drawable.bitsPerPixel + 7) / 8); -+ pExaPixmap->sys_ptr = malloc(paddedWidth); - - /* Set up damage tracking */ - pExaPixmap->pDamage = DamageCreate(exaDamageReport_mixed, NULL, diff --git a/record-avoid-crash-when-calling-RecordFlushReplyBuff.patch b/record-avoid-crash-when-calling-RecordFlushReplyBuff.patch deleted file mode 100644 index e7e58f3..0000000 --- a/record-avoid-crash-when-calling-RecordFlushReplyBuff.patch +++ /dev/null @@ -1,70 +0,0 @@ -From 0801afbd7c2c644c672b37f8463f1a0cbadebd2e Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Erkki=20Sepp=C3=A4l=C3=A4?= -Date: Thu, 10 Feb 2011 15:35:14 +0200 -Subject: [PATCH] record: avoid crash when calling RecordFlushReplyBuffer recursively -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -RecordFlushReplyBuffer can call itself recursively through -WriteClient->CallCallbacks->_CallCallbacks->RecordFlushAllContexts -when the recording client's buffer cannot be completely emptied in one -WriteClient. When a such a recursion occurs, it will not be broken out -of which results in segmentation fault when the stack is exhausted. - -This patch adds a counter (a flag, really) that guards against this -situation, to break out of the recursion. - -One alternative to this change would be to change _CallCallbacks to -check the corresponding counter before the callback loop, but that -might affect existing behavior, which may be relied upon. - -Reviewed-by: Rami Ylimäki -Signed-off-by: Erkki Seppälä -Signed-off-by: Keith Packard ---- - record/record.c | 6 +++++- - 1 files changed, 5 insertions(+), 1 deletions(-) - -diff --git a/record/record.c b/record/record.c -index 6a93d7a..facaebb 100644 ---- a/record/record.c -+++ b/record/record.c -@@ -77,6 +77,7 @@ typedef struct { - char bufCategory; /* category of protocol in replyBuffer */ - int numBufBytes; /* number of bytes in replyBuffer */ - char replyBuffer[REPLY_BUF_SIZE]; /* buffered recorded protocol */ -+ int inFlush; /* are we inside RecordFlushReplyBuffer */ - } RecordContextRec, *RecordContextPtr; - - /* RecordMinorOpRec - to hold minor opcode selections for extension requests -@@ -245,8 +246,9 @@ RecordFlushReplyBuffer( - int len2 - ) - { -- if (!pContext->pRecordingClient || pContext->pRecordingClient->clientGone) -+ if (!pContext->pRecordingClient || pContext->pRecordingClient->clientGone || pContext->inFlush) - return; -+ ++pContext->inFlush; - if (pContext->numBufBytes) - WriteToClient(pContext->pRecordingClient, pContext->numBufBytes, - (char *)pContext->replyBuffer); -@@ -255,6 +257,7 @@ RecordFlushReplyBuffer( - WriteToClient(pContext->pRecordingClient, len1, (char *)data1); - if (len2) - WriteToClient(pContext->pRecordingClient, len2, (char *)data2); -+ --pContext->inFlush; - } /* RecordFlushReplyBuffer */ - - -@@ -1938,6 +1941,7 @@ ProcRecordCreateContext(ClientPtr client) - pContext->numBufBytes = 0; - pContext->pBufClient = NULL; - pContext->continuedReply = 0; -+ pContext->inFlush = 0; - - err = RecordRegisterClients(pContext, client, - (xRecordRegisterClientsReq *)stuff); --- -1.7.4.1 - diff --git a/u_xf4nvc_missing-libz.patch b/u_xf4nvc_missing-libz.patch deleted file mode 100644 index 9b10059..0000000 --- a/u_xf4nvc_missing-libz.patch +++ /dev/null @@ -1,18 +0,0 @@ -Author: Stefan Dirsch -Subject: Xvnc needs to add "-lz" itself -Signed-off-by: Stefan Dirsch - -Xvnc no longer can rely on the toolchain to add the required libs, -it uses directly. - ---- hw/vnc/Makefile.am.orig 2011-08-29 16:11:02.000000000 +0000 -+++ hw/vnc/Makefile.am 2011-08-29 16:11:16.000000000 +0000 -@@ -47,7 +47,7 @@ Xvnc_LDADD = \ - $(JPEG_LIBS) \ - $(CRYPT_LIBS) \ - $(XSERVER_SYS_LIBS) \ -- $(VNCMODULES_LIBS) -+ $(VNCMODULES_LIBS) -lz - - - relink: diff --git a/xorg-server-1.10.4.tar.bz2 b/xorg-server-1.10.4.tar.bz2 new file mode 100644 index 0000000..7cf0dce --- /dev/null +++ b/xorg-server-1.10.4.tar.bz2 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:fafc16b97b9a61b62dfaa74e8d336baa0cea752ce9ed8103c4d212baa8031ca5 +size 5386174 diff --git a/xorg-server-1.9.3.tar.bz2 b/xorg-server-1.9.3.tar.bz2 deleted file mode 100644 index 6c62396..0000000 --- a/xorg-server-1.9.3.tar.bz2 +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:864831f51e841ff37f2445d1c85b86b559c8860a435fb496aead4f256a2b141d -size 5287061 diff --git a/xorg-server-stop-cpu-eating.diff b/xorg-server-stop-cpu-eating.diff deleted file mode 100644 index 872893b..0000000 --- a/xorg-server-stop-cpu-eating.diff +++ /dev/null @@ -1,34 +0,0 @@ -From a6b9e8f1e5d5d0b3b0f121a6f677eeca7aab1950 Mon Sep 17 00:00:00 2001 -From: Adam Jackson -Date: Wed, 25 Aug 2010 15:06:38 +0000 -Subject: linux: Fix CPU usage bug in console fd flushing - -If the vt gets a vhangup from under us, then the tty will appear ready -in select(), but trying to tcflush() it will return -EIO, so we'll spin -around at 100% CPU for no reason. Notice this condition and unregister -the handler if it happens. - -Signed-off-by: Adam Jackson -Reviewed-by: Mikhail Gusarov -Reviewed-by: Julien Cristau -Signed-off-by: Peter Hutterer ---- -diff --git a/hw/xfree86/os-support/linux/lnx_init.c b/hw/xfree86/os-support/linux/lnx_init.c -index bf61ceb..7ee9046 100644 ---- a/hw/xfree86/os-support/linux/lnx_init.c -+++ b/hw/xfree86/os-support/linux/lnx_init.c -@@ -85,7 +85,11 @@ static void *console_handler; - static void - drain_console(int fd, void *closure) - { -- tcflush(fd, TCIOFLUSH); -+ errno = 0; -+ if (tcflush(fd, TCIOFLUSH) == -1 && errno == EIO) { -+ xf86RemoveGeneralHandler(console_handler); -+ console_handler = NULL; -+ } - } - - void --- -cgit v0.8.3-6-g21f6 diff --git a/xorg-server-xf4vnc-abi-version.diff b/xorg-server-xf4vnc-abi-version.diff deleted file mode 100644 index 246ee01..0000000 --- a/xorg-server-xf4vnc-abi-version.diff +++ /dev/null @@ -1,28 +0,0 @@ -Index: hw/xfree86/vnc/vncInit.c -================================================================================ ---- hw/xfree86/vnc/vncInit.c -+++ hw/xfree86/vnc/vncInit.c -@@ -573,8 +573,8 @@ - #if 0 - ABI_EXTENSION_VERSION, - #else -- /* Hack to allow module to work with more servers (vs. 0.3 above) */ -- SET_ABI_VERSION(0, 2), -+ /* Hack to allow module to work with more servers */ -+ SET_ABI_VERSION(1, 0), - #endif - MOD_CLASS_EXTENSION, - {0,0,0,0} ---- xcliplist/cliplistmod.c -+++ xcliplist/cliplistmod.c -@@ -26,8 +26,8 @@ - #if 0 - ABI_EXTENSION_VERSION, - #else -- /* Hack to allow module to work with more servers (vs. 0.3 above) */ -- SET_ABI_VERSION(0, 2), -+ /* Hack to allow module to work with more servers */ -+ SET_ABI_VERSION(1, 0), - #endif - MOD_CLASS_EXTENSION, - {0,0,0,0} diff --git a/xorg-server-xf4vnc-busyloop.diff b/xorg-server-xf4vnc-busyloop.diff deleted file mode 100644 index 484b3a4..0000000 --- a/xorg-server-xf4vnc-busyloop.diff +++ /dev/null @@ -1,31 +0,0 @@ -Index: xorg-server-1.6.3.901/hw/vnc/sockets.c -================================================================================ ---- xorg-server-1.7.99/hw/vnc/sockets.c -+++ xorg-server-1.7.99/hw/vnc/sockets.c -@@ -448,7 +448,7 @@ - int n; - fd_set fds; - struct timeval tv; --#if 0 -+#if 1 - int totalTimeWaited = 0; - #endif - -@@ -470,7 +470,7 @@ - return n; - } - --#if 0 -+#if 1 - /* Retry every 5 seconds until we exceed rfbMaxClientWait. We - need to do this because select doesn't necessarily return - immediately when the other end has gone away */ -@@ -488,7 +488,7 @@ - tv.tv_usec = 0; - #endif - n = select(sock+1, NULL, &fds, NULL, &tv); --#if 0 -+#if 1 - if (n < 0) { - rfbLogPerror("WriteExact: select"); - return n; diff --git a/xorg-server-xf4vnc-clientTimeout.diff b/xorg-server-xf4vnc-clientTimeout.diff deleted file mode 100644 index 9f41acb..0000000 --- a/xorg-server-xf4vnc-clientTimeout.diff +++ /dev/null @@ -1,17 +0,0 @@ -Index: xorg-server-1.6.3.901/hw/vnc/sockets.c -================================================================================ ---- xorg-server-1.7.99/hw/vnc/sockets.c -+++ xorg-server-1.7.99/hw/vnc/sockets.c -@@ -490,8 +490,10 @@ - n = select(sock+1, NULL, &fds, NULL, &tv); - #if 1 - if (n < 0) { -- rfbLogPerror("WriteExact: select"); -- return n; -+ if (errno != EINTR) { -+ rfbLogPerror("WriteExact: select"); -+ return n; -+ } - } - if (n == 0) { - totalTimeWaited += 5000; diff --git a/xorg-server-xf4vnc-cutpaste.diff b/xorg-server-xf4vnc-cutpaste.diff deleted file mode 100644 index 3b84ae3..0000000 --- a/xorg-server-xf4vnc-cutpaste.diff +++ /dev/null @@ -1,13 +0,0 @@ -Index: hw/vnc/cutpaste.c -================================================================================ ---- hw/vnc/cutpaste.c -+++ hw/vnc/cutpaste.c -@@ -58,7 +58,7 @@ - 8, PropModeReplace, len, - (pointer)str, TRUE); - -- if (dixLookupSelection(&pSel, XA_PRIMARY, serverClient, DixSetAttrAccess)) { -+ if (dixLookupSelection(&pSel, XA_PRIMARY, serverClient, DixSetAttrAccess) == Success) { - xEvent event; - - if (pSel->client) { diff --git a/xorg-server-xf4vnc-disable-dmxvnc.diff b/xorg-server-xf4vnc-disable-dmxvnc.diff deleted file mode 100644 index 92d6fe1..0000000 --- a/xorg-server-xf4vnc-disable-dmxvnc.diff +++ /dev/null @@ -1,44 +0,0 @@ -Index: hw/dmx/Makefile.am -================================================================================ ---- hw/dmx/Makefile.am -+++ hw/dmx/Makefile.am -@@ -1,6 +1,6 @@ - DIST_SUBDIRS = input vnc config glxProxy examples doc - --SUBDIRS = input vnc config examples -+SUBDIRS = input config examples - bin_PROGRAMS = Xdmx - - if XINERAMA ---- hw/dmx/dmx-config.h -+++ hw/dmx/dmx-config.h -@@ -72,7 +72,7 @@ - /* Enable the DMX extension */ - #define DMXEXT - --/* Enable VNC ability */ --#define DMXVNC 1 -+/* Disable VNC ability */ -+#undef DMXVNC - - #endif /* DMX_CONFIG_H */ ---- hw/dmx/input/Makefile.am -+++ hw/dmx/input/Makefile.am -@@ -61,7 +61,6 @@ - AM_CFLAGS = $(DIX_CFLAGS) \ - -I$(top_srcdir)/hw/dmx \ - -DHAVE_DMX_CONFIG_H \ -- -DDMXVNC=1 \ - $(GLX_DEFS) \ - @DMXMODULES_CFLAGS@ - ---- hw/dmx/vnc/Makefile.am -+++ hw/dmx/vnc/Makefile.am -@@ -37,7 +37,6 @@ - -I$(top_srcdir)/hw/xfree86/common \ - -DHAVE_DMX_CONFIG_H \ - $(DIX_CFLAGS) \ -- -DDMXVNC=1 \ - @DMXMODULES_CFLAGS@ - - ###EXTRA_DIST = dmxdetach.c diff --git a/xorg-server-xf4vnc-fix.diff b/xorg-server-xf4vnc-fix.diff deleted file mode 100644 index ce721cd..0000000 --- a/xorg-server-xf4vnc-fix.diff +++ /dev/null @@ -1,722 +0,0 @@ -Index: xorg-server-1.6.3.901/hw/vnc/cursor.c -================================================================================ ---- xorg-server-1.7.99/configure.ac -+++ xorg-server-1.7.99/configure.ac -@@ -1504,7 +1504,7 @@ - XVNC_CFLAGS="-DVNCSERVER -DHAVE_XVNC_CONFIG_H" - AC_SUBST([XVNC_CFLAGS]) - VNC_INCLUDES="$XEXT_INC $RENDER_INC $XTRAP_INC $RECORD_INC" -- XVNC_LIBS="$CONFIG_LIB $XSERVER_LIBS $FB_LIB $MI_LIB $FIXES_LIB $XEXT_LIB $DBE_LIB $XTRAP_LIB $RECORD_LIB $GLX_LIBS $RENDER_LIB $RANDR_LIB $DAMAGE_LIB $MIEXT_DAMAGE_LIB $MIEXT_SHADOW_LIB $XI_LIB $XKB_LIB $XKB_STUB_LIB $COMPOSITE_LIB $XPSTUBS_LIB $CWRAP_LIB $OS_LIB $LIBS" -+ XVNC_LIBS="$XEXT_LIB $MAIN_LIB $CONFIG_LIB $XSERVER_LIBS $FB_LIB $MI_LIB $DBE_LIB $XTRAP_LIB $RECORD_LIB $GLX_LIBS $RENDER_LIB $RANDR_LIB $DAMAGE_LIB $MIEXT_DAMAGE_LIB $MIEXT_SHADOW_LIB $XI_LIB $XKB_LIB $XKB_STUB_LIB $COMPOSITE_LIB $XPSTUBS_LIB $CWRAP_LIB $OS_LIB $FIXES_LIB $LIBS" - AC_SUBST([XVNC_LIBS]) - - if test "x$GLX" = xyes; then ---- xorg-server-1.7.99/hw/vnc/cursor.c -+++ xorg-server-1.7.99/hw/vnc/cursor.c -@@ -33,6 +33,7 @@ - #include "sprite.h" - #include "cursorstr.h" - #include "servermd.h" -+#include "inputstr.h" - - - /* Copied from Xvnc/lib/font/util/utilbitmap.c */ -@@ -262,7 +263,7 @@ - - #if XFREE86VNC - if (pScreen == pCursorScreen) -- miPointerPosition(&x, &y); -+ miPointerGetPosition(inputInfo.pointer, &x, &y); - #else - rfbSpriteGetCursorPos(pScreen, &x, &y); - #endif ---- xorg-server-1.7.99/hw/vnc/cutpaste.c -+++ xorg-server-1.7.99/hw/vnc/cutpaste.c -@@ -66,7 +66,7 @@ - event.u.selectionClear.time = GetTimeInMillis(); - event.u.selectionClear.window = pSel->window; - event.u.selectionClear.atom = pSel->selection; -- (void) TryClientEvents (pSel->client, &event, 1, -+ (void) TryClientEvents (pSel->client, NULL, &event, 1, - NoEventMask, NoEventMask /* CantBeFiltered */, - NullGrab); - } ---- xorg-server-1.7.99/hw/vnc/dispcur.c -+++ xorg-server-1.7.99/hw/vnc/dispcur.c -@@ -74,7 +74,10 @@ - - /* per-screen private data */ - --static DevPrivateKey rfbDCScreenKey = &rfbDCScreenKey; -+static int rfbDCScreenKeyStore; -+static DevPrivateKey rfbDCScreenKey = &rfbDCScreenKeyStore; -+static int rfbScreenKeyStore; -+static DevPrivateKey rfbScreenKey = &rfbScreenKeyStore; - - static Bool rfbDCCloseScreen(int index, ScreenPtr pScreen); - -@@ -205,7 +208,7 @@ - CursorPtr pCursor; - { - if (pCursor->bits->refcnt <= 1) -- dixSetPrivate(&pCursor->bits->devPrivates, pScreen, NULL); -+ dixSetPrivate(&pCursor->bits->devPrivates, rfbScreenKey, NULL); - return TRUE; - } - -@@ -303,7 +306,7 @@ - xfree ((pointer) pPriv); - return (rfbDCCursorPtr)NULL; - } -- dixSetPrivate(&pCursor->bits->devPrivates, pScreen, pPriv); -+ dixSetPrivate(&pCursor->bits->devPrivates, rfbScreenKey, pPriv); - return pPriv; - } - pPriv->pPicture = 0; -@@ -321,7 +324,7 @@ - xfree ((pointer) pPriv); - return (rfbDCCursorPtr)NULL; - } -- dixSetPrivate(&pCursor->bits->devPrivates, pScreen, pPriv); -+ dixSetPrivate(&pCursor->bits->devPrivates, rfbScreenKey, pPriv); - - /* create the two sets of bits, clipping as appropriate */ - -@@ -368,7 +371,7 @@ - rfbDCCursorPtr pPriv; - - pPriv = (rfbDCCursorPtr)dixLookupPrivate(&pCursor->bits->devPrivates, -- pScreen); -+ rfbScreenKey); - if (pPriv && (pCursor->bits->refcnt <= 1)) - { - if (pPriv->sourceBits) -@@ -380,7 +383,7 @@ - FreePicture (pPriv->pPicture, 0); - #endif - xfree ((pointer) pPriv); -- dixSetPrivate(&pCursor->bits->devPrivates, pScreen, NULL); -+ dixSetPrivate(&pCursor->bits->devPrivates, rfbScreenKey, NULL); - } - return TRUE; - } -@@ -439,7 +442,7 @@ - WindowPtr pWin; - - pPriv = (rfbDCCursorPtr)dixLookupPrivate(&pCursor->bits->devPrivates, -- pScreen); -+ rfbScreenKey); - if (!pPriv) - { - pPriv = rfbDCRealize(pScreen, pCursor); -@@ -690,7 +693,7 @@ - PixmapPtr pTemp; - - pPriv = (rfbDCCursorPtr)dixLookupPrivate(&pCursor->bits->devPrivates, -- pScreen); -+ rfbScreenKey); - if (!pPriv) - { - pPriv = rfbDCRealize(pScreen, pCursor); ---- xorg-server-1.7.99/hw/vnc/init.c -+++ xorg-server-1.7.99/hw/vnc/init.c -@@ -90,6 +90,7 @@ - #include "dix.h" - #include "micmap.h" - #include "rfb.h" -+#include "xserver-properties.h" - - #ifdef CORBA - #include -@@ -138,7 +139,7 @@ - - - static void --PointerWarpCursor(ScreenPtr pScreen, int x, int y) -+PointerWarpCursor(DeviceIntPtr pDev, ScreenPtr pScreen, int x, int y) - { - #if 0 - DeviceIntPtr pDev = NULL; -@@ -775,8 +776,8 @@ - char *argv[]; - { - DeviceIntPtr p, k; -- k = AddInputDevice(rfbKeybdProc, TRUE); -- p = AddInputDevice(rfbMouseProc, TRUE); -+ k = AddInputDevice(serverClient, rfbKeybdProc, TRUE); -+ p = AddInputDevice(serverClient, rfbMouseProc, TRUE); - RegisterKeyboardDevice(k); - RegisterPointerDevice(p); - -@@ -804,7 +805,7 @@ - case DEVICE_INIT: - vncSetKeyboardDevice(pDevice); - KbdDeviceInit(pDevice, &keySyms, modMap); -- InitKeyboardDeviceStruct(pDev, &keySyms, modMap, -+ InitKeyboardDeviceStruct(pDevice, NULL, - (BellProcPtr)rfbSendBell, - (KbdCtrlProcPtr)NoopDDA); - break; -@@ -831,6 +832,8 @@ - int onoff; - { - BYTE map[6]; -+ Atom btn_labels[5] = {0}; -+ Atom axes_labels[2] = {0}; - DevicePtr pDev = (DevicePtr)pDevice; - - switch (onoff) -@@ -842,10 +845,16 @@ - map[3] = 3; - map[4] = 4; - map[5] = 5; -- InitPointerDeviceStruct(pDev, map, 5, -- GetMotionHistory, -+ btn_labels[0] = XIGetKnownProperty(BTN_LABEL_PROP_BTN_LEFT); -+ btn_labels[1] = XIGetKnownProperty(BTN_LABEL_PROP_BTN_MIDDLE); -+ btn_labels[2] = XIGetKnownProperty(BTN_LABEL_PROP_BTN_RIGHT); -+ -+ axes_labels[0] = XIGetKnownProperty(AXIS_LABEL_PROP_REL_X); -+ axes_labels[1] = XIGetKnownProperty(AXIS_LABEL_PROP_REL_Y); -+ -+ InitPointerDeviceStruct(pDev, map, 5, btn_labels, - PtrDeviceControl, -- GetMaximumEventsNum(), 2 /* numAxes */); -+ GetMaximumEventsNum(), 2 /* numAxes */, axes_labels); - vncSetPointerDevice(pDevice); - break; - ---- xorg-server-1.7.99/hw/vnc/kbdptr.c -+++ xorg-server-1.7.99/hw/vnc/kbdptr.c -@@ -39,6 +39,7 @@ - #include "mi.h" - #include "mipointer.h" - #include "keyboard.h" -+#include "xkbsrv.h" - - #ifdef DMXVNC - #include "dmxinput.h" -@@ -69,15 +70,16 @@ - ptrDevice = ptr; - } - -- - #ifndef DMXVNC - static void - EnqueueMotion(DeviceIntPtr ptrDev, int x, int y) - { -- xEvent *events = (xEvent*) calloc(sizeof(xEvent), GetMaximumEventsNum()); - int detail = 0, valuators[2], nevents, i; -+ EventListPtr events; - valuators[0] = x; - valuators[1] = y; -+ GetEventList(&events); -+ - if (!ptrDev) { - ErrorF("VNC: In EnqueueMotion() ptrDev=NULL\n"); - return; -@@ -85,8 +87,7 @@ - nevents = GetPointerEvents(events, ptrDev, MotionNotify, detail, - POINTER_ABSOLUTE, 0, 2, valuators); - for (i = 0; i < nevents; i++) -- mieqEnqueue(ptrDev, events + i); -- free(events); -+ mieqEnqueue(ptrDev, (InternalEvent*)(events + i)->event); - } - #endif - -@@ -94,8 +95,10 @@ - static void - EnqueueButton(DeviceIntPtr ptrDev, int type, int detail) - { -- xEvent *events = (xEvent*) calloc(sizeof(xEvent), GetMaximumEventsNum()); - int nevents, i; -+ EventListPtr events; -+ GetEventList(&events); -+ - if (!ptrDev) { - ErrorF("VNC: In EnqueueButton() ptrDev=NULL\n"); - return; -@@ -103,27 +106,26 @@ - nevents = GetPointerEvents(events, ptrDev, type, detail, - POINTER_ABSOLUTE, 0, 0, NULL/*valuators*/); - for (i = 0; i < nevents; i++) -- mieqEnqueue(ptrDev, events + i); -- free(events); -+ mieqEnqueue(ptrDev, (InternalEvent*)(events + i)->event); - } - - - static void - EnqueueKey(DeviceIntPtr kbdDev, int type, int detail) - { -- xEvent *events = (xEvent*) calloc(sizeof(xEvent), GetMaximumEventsNum()); - int nevents, i; -+ EventListPtr events; -+ GetEventList(&events); -+ - if (!kbdDev) { - ErrorF("VNC: In EnqueueKey() kbdDev=NULL\n"); - return; - } - nevents = GetKeyboardEvents(events, kbdDev, type, detail); - for (i = 0; i < nevents; i++) -- mieqEnqueue(kbdDev, events + i); -- free(events); -+ mieqEnqueue(kbdDev, (InternalEvent*)(events + i)->event); - } - -- - /* - * Called when the rfbserver receives a rfbKeyEvent event from a client. - * Put an X keyboard event into the event queue. -@@ -133,6 +135,7 @@ - { - const int type = down ? KeyPress : KeyRelease; - KeySymsPtr keySyms; -+ XkbStateRec *xkb; - int i; - int keyCode = 0; - int freeIndex = -1; -@@ -145,7 +148,7 @@ - if (!kbdDevice) - return; - -- keySyms = &kbdDevice->key->curKeySyms; -+ keySyms = XkbGetCoreMap(kbdDevice); - - #ifdef CORBA - if (cl) { -@@ -256,18 +259,19 @@ - shiftMustBePressed = TRUE; - } - -- SendMappingNotify(MappingKeyboard, keyCode, 1, serverClient); -+ XkbApplyMappingChange(kbdDevice, keySyms, keyCode, 1, NULL, serverClient); - - ErrorF("KbdAddEvent: unknown KeySym 0x%x - allocating KeyCode %d\n", - (int)keySym, keyCode); - } - -+ xkb = &kbdDevice->key->xkbInfo->state; - if (down) { -- if (shiftMustBePressed && !(kbdDevice->key->state & ShiftMask)) { -+ if (shiftMustBePressed && !(XkbStateFieldFromRec(xkb) & ShiftMask)) { - fakeShiftPress = TRUE; - EnqueueKey(kbdDevice, KeyPress, SHIFT_L_KEY_CODE); - } -- if (shiftMustBeReleased && (kbdDevice->key->state & ShiftMask)) { -+ if (shiftMustBeReleased && (XkbStateFieldFromRec(xkb) & ShiftMask)) { - if (KEY_IS_PRESSED(SHIFT_L_KEY_CODE)) { - fakeShiftLRelease = TRUE; - EnqueueKey(kbdDevice, KeyRelease, SHIFT_L_KEY_CODE); ---- xorg-server-1.7.99/hw/vnc/rdp.c -+++ xorg-server-1.7.99/hw/vnc/rdp.c -@@ -27,6 +27,7 @@ - #include - #include - #include -+#include - #include "rfb.h" - - typedef struct rdpClientRec { ---- xorg-server-1.7.99/hw/vnc/rfbkeyb.c -+++ xorg-server-1.7.99/hw/vnc/rfbkeyb.c -@@ -147,7 +147,7 @@ - #ifdef XKB - if (noXkbExtension) { - #endif -- InitKeyboardDeviceStruct(pDev, &keySyms, modMap, -+ InitKeyboardDeviceStruct(device, NULL, - (BellProcPtr)rfbSendBell, - (KbdCtrlProcPtr)NoopDDA); - #ifdef XKB -@@ -388,7 +388,7 @@ - "xf4vnc Project, see http://xf4vnc.sf.net", - MODINFOSTRING1, - MODINFOSTRING2, -- XF86_VERSION_CURRENT, -+ XORG_VERSION_CURRENT, - 1, 0, 0, - ABI_CLASS_XINPUT, - ABI_XINPUT_VERSION, ---- xorg-server-1.7.99/hw/vnc/rfbmouse.c -+++ xorg-server-1.7.99/hw/vnc/rfbmouse.c -@@ -51,7 +51,7 @@ - #include - #endif - #include "rfb.h" -- -+#include "xserver-properties.h" - - unsigned char ptrAcceleration = 50; - -@@ -95,13 +95,18 @@ - { - BYTE map[6]; - DevicePtr pDev = (DevicePtr)device; -+ Atom btn_labels[5] = {0}; -+ Atom axes_labels[2] = {0}; -+ - void *func1; - int (*func2)(void); - -+#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) < 3 - if (LoaderSymbol("GetMotionHistory")) - func1 = LoaderSymbol("GetMotionHistory"); - else - func1 = LoaderSymbol("miPointerGetMotionEvents"); -+#endif - - if (LoaderSymbol("GetMotionHistorySize")) - func2 = LoaderSymbol("GetMotionHistorySize"); -@@ -119,10 +124,21 @@ - map[3] = 3; - map[4] = 4; - map[5] = 5; -- InitPointerDeviceStruct(pDev, map, 5, -+ btn_labels[0] = XIGetKnownProperty(BTN_LABEL_PROP_BTN_LEFT); -+ btn_labels[1] = XIGetKnownProperty(BTN_LABEL_PROP_BTN_MIDDLE); -+ btn_labels[2] = XIGetKnownProperty(BTN_LABEL_PROP_BTN_RIGHT); -+ btn_labels[3] = XIGetKnownProperty(BTN_LABEL_PROP_BTN_WHEEL_UP); -+ btn_labels[4] = XIGetKnownProperty(BTN_LABEL_PROP_BTN_WHEEL_DOWN); -+ -+ axes_labels[0] = XIGetKnownProperty(AXIS_LABEL_PROP_REL_X); -+ axes_labels[1] = XIGetKnownProperty(AXIS_LABEL_PROP_REL_Y); -+ -+ InitPointerDeviceStruct(pDev, map, 5, btn_labels, -+#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) < 3 - func1, -+#endif - PtrDeviceControl, -- (*func2)(), 2); -+ (*func2)(), 2, axes_labels); - break; - - case DEVICE_ON: -@@ -243,7 +259,7 @@ - "xf4vnc Project, see http://xf4vnc.sf.net", - MODINFOSTRING1, - MODINFOSTRING2, -- XF86_VERSION_CURRENT, -+ XORG_VERSION_CURRENT, - 1, 0, 0, - ABI_CLASS_XINPUT, - ABI_XINPUT_VERSION, ---- xorg-server-1.7.99/hw/vnc/rfbserver.c -+++ xorg-server-1.7.99/hw/vnc/rfbserver.c -@@ -53,6 +53,7 @@ - #include "propertyst.h" - #include - #include -+#include - - #ifdef CORBA - #include -@@ -1122,8 +1123,8 @@ - - { - int x, y; -- miPointerPosition(&x, &y); /*XXX deprecated*/ -- (*pVNC->spriteFuncs->SetCursor)(cl->pScreen, pVNC->pCurs, x, y); -+ miPointerGetPosition(inputInfo.pointer, &x, &y); -+ (*pVNC->spriteFuncs->SetCursor)(inputInfo.pointer, cl->pScreen, pVNC->pCurs, x, y); - } - #endif - ---- xorg-server-1.7.99/hw/vnc/sprite.c -+++ xorg-server-1.7.99/hw/vnc/sprite.c -@@ -112,7 +112,8 @@ - static RegionPtr rfbSpriteRestoreAreas(WindowPtr pWin, RegionPtr pRgnExposed); - static void rfbSpriteComputeSaved(ScreenPtr pScreen); - --static DevPrivateKey rfbSpriteScreenKey = &rfbSpriteScreenKey; -+static int rfbSpriteScreenKeyStore; -+static DevPrivateKey rfbSpriteScreenKey = &rfbSpriteScreenKeyStore; - - #define SCREEN_PROLOGUE(pScreen, field) ((pScreen)->field = \ - ((rfbSpriteScreenPtr)dixLookupPrivate(&(pScreen)->devPrivates, \ -@@ -144,7 +145,8 @@ - rfbSpriteCopyClip, - }; - --static DevPrivateKey rfbSpriteGCKey = &rfbSpriteGCKey; -+static int rfbSpriteGCKeyStore; -+static DevPrivateKey rfbSpriteGCKey = &rfbSpriteGCKeyStore; - - #define GC_FUNC_PROLOGUE(pGC) \ - rfbSpriteGCPtr pGCPriv = \ -@@ -289,23 +291,27 @@ - * pointer-sprite method table - */ - --static Bool rfbSpriteRealizeCursor (ScreenPtr pScreen, CursorPtr pCursor); --static Bool rfbSpriteUnrealizeCursor (ScreenPtr pScreen, CursorPtr pCursor); --static void rfbSpriteSetCursor (ScreenPtr pScreen, CursorPtr pCursor, int x, int y); --static void rfbSpriteMoveCursor (ScreenPtr pScreen, int x, int y); -+static Bool rfbSpriteRealizeCursor (DeviceIntPtr pDev, ScreenPtr pScreen, CursorPtr pCursor); -+static Bool rfbSpriteUnrealizeCursor (DeviceIntPtr pDev, ScreenPtr pScreen, CursorPtr pCursor); -+static void rfbSpriteSetCursor (DeviceIntPtr pDev, ScreenPtr pScreen, CursorPtr pCursor, int x, int y); -+static void rfbSpriteMoveCursor (DeviceIntPtr pDev, ScreenPtr pScreen, int x, int y); -+static Bool rfbSpriteInitializeCursor (DeviceIntPtr pDev, ScreenPtr pScreen); -+static void rfbSpriteCleanupCursor (DeviceIntPtr pDev, ScreenPtr pScreen); - - miPointerSpriteFuncRec rfbSpritePointerFuncs = { - rfbSpriteRealizeCursor, - rfbSpriteUnrealizeCursor, - rfbSpriteSetCursor, - rfbSpriteMoveCursor, -+ rfbSpriteInitializeCursor, -+ rfbSpriteCleanupCursor, - }; - - /* - * other misc functions - */ - --static Bool rfbDisplayCursor (ScreenPtr pScreen, CursorPtr pCursor); -+static Bool rfbDisplayCursor (DeviceIntPtr pDev, ScreenPtr pScreen, CursorPtr pCursor); - - - /* -@@ -1963,7 +1969,7 @@ - #define SPRITE_PAD 8 - - static Bool --rfbSpriteRealizeCursor (ScreenPtr pScreen, CursorPtr pCursor) -+rfbSpriteRealizeCursor (DeviceIntPtr pDev, ScreenPtr pScreen, CursorPtr pCursor) - { - rfbSpriteScreenPtr pScreenPriv; - -@@ -1975,7 +1981,7 @@ - } - - static Bool --rfbSpriteUnrealizeCursor (ScreenPtr pScreen, CursorPtr pCursor) -+rfbSpriteUnrealizeCursor (DeviceIntPtr pDev, ScreenPtr pScreen, CursorPtr pCursor) - { - rfbSpriteScreenPtr pScreenPriv; - -@@ -1985,7 +1991,7 @@ - } - - static void --rfbSpriteSetCursor (ScreenPtr pScreen, CursorPtr pCursor, int x, int y) -+rfbSpriteSetCursor (DeviceIntPtr pDev, ScreenPtr pScreen, CursorPtr pCursor, int x, int y) - { - rfbSpriteScreenPtr pScreenPriv; - rfbClientPtr cl, nextCl; -@@ -2101,13 +2107,24 @@ - } - - static void --rfbSpriteMoveCursor (ScreenPtr pScreen, int x, int y) -+rfbSpriteMoveCursor (DeviceIntPtr pDev, ScreenPtr pScreen, int x, int y) - { - rfbSpriteScreenPtr pScreenPriv; - - pScreenPriv = (rfbSpriteScreenPtr)dixLookupPrivate(&pScreen->devPrivates, - rfbSpriteScreenKey); -- rfbSpriteSetCursor (pScreen, pScreenPriv->pCursor, x, y); -+ rfbSpriteSetCursor (pDev, pScreen, pScreenPriv->pCursor, x, y); -+} -+ -+static Bool -+rfbSpriteInitializeCursor (DeviceIntPtr pDev, ScreenPtr pScreen) -+{ -+ return TRUE; -+} -+ -+static void -+rfbSpriteCleanupCursor (DeviceIntPtr pDev, ScreenPtr pScreen) -+{ - } - - /* -@@ -2215,9 +2232,7 @@ - */ - - static Bool --rfbDisplayCursor(pScreen, pCursor) -- ScreenPtr pScreen; -- CursorPtr pCursor; -+rfbDisplayCursor(DeviceIntPtr pDev, ScreenPtr pScreen, CursorPtr pCursor) - { - rfbClientPtr cl; - rfbSpriteScreenPtr pPriv; -@@ -2230,7 +2245,7 @@ - - pPriv = (rfbSpriteScreenPtr)dixLookupPrivate(&pScreen->devPrivates, - rfbSpriteScreenKey); -- status = (*pPriv->DisplayCursor)(pScreen, pCursor); -+ status = (*pPriv->DisplayCursor)(pDev, pScreen, pCursor); - - /* send new cursor shape to interested viewers */ - for (cl = rfbClientHead; cl ; cl = cl->next) { ---- xorg-server-1.7.99/hw/vnc/vncext.c -+++ xorg-server-1.7.99/hw/vnc/vncext.c -@@ -36,8 +36,9 @@ - #include - #include - --DevPrivateKey vncCreateScreenResourcesKey = &vncCreateScreenResourcesKey; --DevPrivateKey rfbGCKey = &rfbGCKey; -+static int vncCreateScreenResourcesKeyStore, rfbGCKeyStore; -+DevPrivateKey vncCreateScreenResourcesKey = &vncCreateScreenResourcesKeyStore; -+DevPrivateKey rfbGCKey = &rfbGCKeyStore; - - int VncSelectNotify(ClientPtr client, BOOL onoff); - void VncExtensionInit(void); -@@ -514,7 +515,7 @@ - else - conn.ipaddress = (CARD32)peer.sin_addr.s_addr; - -- (void) TryClientEvents(pn->client, (xEventPtr)&conn, 1, NoEventMask, -+ (void) TryClientEvents(pn->client, NULL, (xEventPtr)&conn, 1, NoEventMask, - NoEventMask, NullGrab); - } - pn = pn->next; -@@ -557,7 +558,7 @@ - else - conn.ipaddress = (CARD32)peer.sin_addr.s_addr; - -- (void) TryClientEvents(pn->client, (xEventPtr)&conn, 1, NoEventMask, -+ (void) TryClientEvents(pn->client, NULL, (xEventPtr)&conn, 1, NoEventMask, - NoEventMask, NullGrab); - } - pn = pn->next; -@@ -586,7 +587,7 @@ - conn.type = VncEventBase + XVncDisconnected; - conn.sequenceNumber = pn->client->sequence; - conn.connected = sock; -- (void) TryClientEvents(pn->client, (xEventPtr)&conn, 1, NoEventMask, -+ (void) TryClientEvents(pn->client, NULL, (xEventPtr)&conn, 1, NoEventMask, - NoEventMask, NullGrab); - } - pn = pn->next; ---- xorg-server-1.7.99/hw/xfree86/vnc/vncInit.c -+++ xorg-server-1.7.99/hw/xfree86/vnc/vncInit.c -@@ -34,8 +34,7 @@ - - #include "xf86.h" - #include "xf86_OSproc.h" --#include "xf86Resources.h" --#include "xf86Version.h" -+#include "xorgVersion.h" - - int vncScreenPrivateIndex = -1; - int inetdSock = -1; -@@ -48,6 +47,8 @@ - - extern void VncExtensionInit(void); - -+extern void vncInitMouse(void); -+extern void vncInitKeyb(void); - Bool VNCInit(ScreenPtr pScreen, unsigned char *FBStart); - - #ifndef XFree86LOADER -@@ -56,11 +57,11 @@ - static const OptionInfoRec *VNCAvailableOptions(void *unused); - static void rfbWakeupHandler (int i, pointer blockData, unsigned long err, pointer pReadmask); - --static Bool vncCursorRealizeCursor(ScreenPtr, CursorPtr); --static Bool vncCursorUnrealizeCursor(ScreenPtr, CursorPtr); --static void vncCursorSetCursor(ScreenPtr, CursorPtr, int, int); --static void vncCursorMoveCursor(ScreenPtr, int, int); --static Bool vncDisplayCursor(ScreenPtr, CursorPtr); -+static Bool vncCursorRealizeCursor(DeviceIntPtr, ScreenPtr, CursorPtr); -+static Bool vncCursorUnrealizeCursor(DeviceIntPtr, ScreenPtr, CursorPtr); -+static void vncCursorSetCursor(DeviceIntPtr, ScreenPtr, CursorPtr, int, int); -+static void vncCursorMoveCursor(DeviceIntPtr, ScreenPtr, int, int); -+static Bool vncDisplayCursor(DeviceIntPtr, ScreenPtr, CursorPtr); - - static miPointerSpriteFuncRec vncCursorSpriteFuncs = { - vncCursorRealizeCursor, -@@ -389,23 +390,23 @@ - /****** miPointerSpriteFunctions *******/ - - static Bool --vncCursorRealizeCursor(ScreenPtr pScreen, CursorPtr pCurs) -+vncCursorRealizeCursor(DeviceIntPtr pDev, ScreenPtr pScreen, CursorPtr pCurs) - { - vncScreenPtr pScreenPriv = VNCPTR(pScreen); - -- return (*pScreenPriv->spriteFuncs->RealizeCursor)(pScreen, pCurs); -+ return (*pScreenPriv->spriteFuncs->RealizeCursor)(pDev, pScreen, pCurs); - } - - static Bool --vncCursorUnrealizeCursor(ScreenPtr pScreen, CursorPtr pCurs) -+vncCursorUnrealizeCursor(DeviceIntPtr pDev, ScreenPtr pScreen, CursorPtr pCurs) - { - vncScreenPtr pScreenPriv = VNCPTR(pScreen); - -- return (*pScreenPriv->spriteFuncs->UnrealizeCursor)(pScreen, pCurs); -+ return (*pScreenPriv->spriteFuncs->UnrealizeCursor)(pDev, pScreen, pCurs); - } - - static void --vncCursorSetCursor(ScreenPtr pScreen, CursorPtr pCurs, int x, int y) -+vncCursorSetCursor(DeviceIntPtr pDev, ScreenPtr pScreen, CursorPtr pCurs, int x, int y) - { - vncScreenPtr pScreenPriv = VNCPTR(pScreen); - -@@ -426,11 +427,11 @@ - pScreenPriv->cursorIsDrawn = TRUE; - #endif - -- (*pScreenPriv->spriteFuncs->SetCursor)(pScreen, pCurs, x, y); -+ (*pScreenPriv->spriteFuncs->SetCursor)(pDev, pScreen, pCurs, x, y); - } - - static void --vncCursorMoveCursor(ScreenPtr pScreen, int x, int y) -+vncCursorMoveCursor(DeviceIntPtr pDev, ScreenPtr pScreen, int x, int y) - { - vncScreenPtr pScreenPriv = VNCPTR(pScreen); - rfbClientPtr cl; -@@ -440,7 +441,7 @@ - cl->cursorWasMoved = TRUE; - } - -- (*pScreenPriv->spriteFuncs->MoveCursor)(pScreen, x, y); -+ (*pScreenPriv->spriteFuncs->MoveCursor)(pDev, pScreen, x, y); - } - - Bool -@@ -505,9 +506,7 @@ - #endif - - static Bool --vncDisplayCursor(pScreen, pCursor) -- ScreenPtr pScreen; -- CursorPtr pCursor; -+vncDisplayCursor(DeviceIntPtr pDev, ScreenPtr pScreen, CursorPtr pCursor) - { - vncScreenPtr pScreenPriv = VNCPTR(pScreen); - rfbClientPtr cl; -@@ -520,7 +519,7 @@ - cl->cursorWasChanged = TRUE; - } - -- ret = (*pScreen->DisplayCursor)(pScreen, pCursor); -+ ret = (*pScreen->DisplayCursor)(pDev, pScreen, pCursor); - - pScreen->DisplayCursor = vncDisplayCursor; - -@@ -586,6 +585,7 @@ - NULL /* ModuleTearDownProc */ - }; - -+#if 0 - ModuleInfoRec VNC = { - 1, /* moduleVersion */ - "VNC", /* moduleName */ -@@ -593,6 +593,7 @@ - 0, /* refCount */ - VNCAvailableOptions, /* function returning array of OptionsInfoRec */ - }; -+#endif - - ExtensionModule vncExtensionModule = { - VncExtensionInit, /* initFunc */ diff --git a/xorg-server-xf4vnc-fixes_1_8.diff b/xorg-server-xf4vnc-fixes_1_8.diff deleted file mode 100644 index 6f837d0..0000000 --- a/xorg-server-xf4vnc-fixes_1_8.diff +++ /dev/null @@ -1,43 +0,0 @@ ---- hw/vnc/vncext.c -+++ hw/vnc/vncext.c -@@ -140,7 +140,7 @@ - if (rec) { - rec->client = client; - rec->fakeID = FakeClientID(client->index); -- rec->res = CreateNewResourceType(VncDestroyClientResourceCallback); -+ rec->res = CreateNewResourceType(VncDestroyClientResourceCallback,"DestroyClientResourceCallback"); - if (!AddResource(rec->fakeID, rec->res, rec)) { - xfree(rec); - } -@@ -689,7 +689,7 @@ - - VncResourceGeneration = serverGeneration; - -- if (!(VncNotifyList = CreateNewResourceType(VncDestroyNotifyList))) { -+ if (!(VncNotifyList = CreateNewResourceType(VncDestroyNotifyList,"DestroyNotifyList"))) { - ErrorF("CreateResourceTypes: failed to allocate vnc notify list resource.\n"); - return FALSE; - } ---- hw/vnc/init.c -+++ hw/vnc/init.c -@@ -984,6 +984,11 @@ - } - - void -+CloseInput() -+{ -+} -+ -+void - OsVendorInit() - { - } -@@ -1047,7 +1052,7 @@ - } - - int --NewInputDeviceRequest(InputOption *options, DeviceIntPtr *pdev) -+NewInputDeviceRequest(InputOption *options, InputAttributes *attrs, DeviceIntPtr *pdev) - { - return BadValue; - } diff --git a/xorg-server-xf4vnc-fixes_1_9.diff b/xorg-server-xf4vnc-fixes_1_9.diff deleted file mode 100644 index 3290f6a..0000000 --- a/xorg-server-xf4vnc-fixes_1_9.diff +++ /dev/null @@ -1,612 +0,0 @@ -Index: xorg-server-1.9.3/hw/vnc/rfb.h -=================================================================== ---- xorg-server-1.9.3.orig/hw/vnc/rfb.h -+++ xorg-server-1.9.3/hw/vnc/rfb.h -@@ -189,8 +189,8 @@ typedef struct - - CloseScreenProcPtr CloseScreen; - CreateGCProcPtr CreateGC; -- PaintWindowBackgroundProcPtr PaintWindowBackground; -- PaintWindowBorderProcPtr PaintWindowBorder; -+// PaintWindowBackgroundProcPtr PaintWindowBackground; -+// PaintWindowBorderProcPtr PaintWindowBorder; - CopyWindowProcPtr CopyWindow; - ClearToBackgroundProcPtr ClearToBackground; - RestoreAreasProcPtr RestoreAreas; -Index: xorg-server-1.9.3/hw/vnc/draw.c -=================================================================== ---- xorg-server-1.9.3.orig/hw/vnc/draw.c -+++ xorg-server-1.9.3/hw/vnc/draw.c -@@ -61,6 +61,10 @@ in this Software without prior written a - - int rfbDeferUpdateTime = 40; /* ms */ - -+extern DevPrivateKeyRec rfbGCKeyRec; -+#define rfbGCKey (&rfbGCKeyRec) -+ -+ - - /****************************************************************************/ - /* -@@ -217,8 +221,8 @@ rfbCloseScreen (int i, ScreenPtr pScreen - - pScreen->CloseScreen = pVNC->CloseScreen; - pScreen->CreateGC = pVNC->CreateGC; -- pScreen->PaintWindowBackground = pVNC->PaintWindowBackground; -- pScreen->PaintWindowBorder = pVNC->PaintWindowBorder; -+// pScreen->PaintWindowBackground = pVNC->PaintWindowBackground; -+// pScreen->PaintWindowBorder = pVNC->PaintWindowBorder; - pScreen->CopyWindow = pVNC->CopyWindow; - pScreen->ClearToBackground = pVNC->ClearToBackground; - pScreen->RestoreAreas = pVNC->RestoreAreas; -@@ -252,7 +256,7 @@ rfbEnableDisableFBAccess (int index, Boo - * control even when switched away. - */ - if (!enable) { -- WindowPtr pWin = WindowTable[index]; -+ WindowPtr pWin = pScrn->pScreen->root; - ScreenPtr pScreen = pWin->drawable.pScreen; - GCPtr pGC; - xRectangle rect; -@@ -268,7 +272,7 @@ rfbEnableDisableFBAccess (int index, Boo - CARD32 attributes[2]; - attributes[0] = pScreen->whitePixel; - attributes[1] = pScreen->blackPixel; -- (void)ChangeGC(pGC, GCForeground | GCBackground, attributes); -+ (void)ChangeGC(NullClient, pGC, GCForeground | GCBackground, attributes); - - ValidateGC((DrawablePtr)pWin, pGC); - -@@ -317,6 +321,7 @@ rfbCreateGC (GCPtr pGC) - return ret; - } - -+#if 0 - /* - * PaintWindowBackground - the region being modified is just the given region. - */ -@@ -356,6 +361,7 @@ rfbPaintWindowBorder (WindowPtr pWin, Re - - SCREEN_EPILOGUE(PaintWindowBorder,rfbPaintWindowBorder); - } -+#endif - - #ifdef CHROMIUM - Bool -Index: xorg-server-1.9.3/hw/vnc/init.c -=================================================================== ---- xorg-server-1.9.3.orig/hw/vnc/init.c -+++ xorg-server-1.9.3/hw/vnc/init.c -@@ -670,8 +670,8 @@ rfbScreenInit(index, pScreen, argc, argv - prfb->CloseScreen = pScreen->CloseScreen; - prfb->WakeupHandler = pScreen->WakeupHandler; - prfb->CreateGC = pScreen->CreateGC; -- prfb->PaintWindowBackground = pScreen->PaintWindowBackground; -- prfb->PaintWindowBorder = pScreen->PaintWindowBorder; -+// prfb->PaintWindowBackground = pScreen->PaintWindowBackground; -+// prfb->PaintWindowBorder = pScreen->PaintWindowBorder; - prfb->CopyWindow = pScreen->CopyWindow; - prfb->ClearToBackground = pScreen->ClearToBackground; - prfb->RestoreAreas = pScreen->RestoreAreas; -@@ -691,8 +691,8 @@ rfbScreenInit(index, pScreen, argc, argv - pScreen->CloseScreen = rfbCloseScreen; - pScreen->WakeupHandler = rfbWakeupHandler; - pScreen->CreateGC = rfbCreateGC; -- pScreen->PaintWindowBackground = rfbPaintWindowBackground; -- pScreen->PaintWindowBorder = rfbPaintWindowBorder; -+// pScreen->PaintWindowBackground = rfbPaintWindowBackground; -+// pScreen->PaintWindowBorder = rfbPaintWindowBorder; - pScreen->CopyWindow = rfbCopyWindow; - pScreen->ClearToBackground = rfbClearToBackground; - pScreen->RestoreAreas = rfbRestoreAreas; -Index: xorg-server-1.9.3/hw/vnc/sprite.c -=================================================================== ---- xorg-server-1.9.3.orig/hw/vnc/sprite.c -+++ xorg-server-1.9.3/hw/vnc/sprite.c -@@ -96,8 +96,10 @@ static void rfbSpriteInstallColormap - static void rfbSpriteStoreColors(ColormapPtr pMap, int ndef, - xColorItem *pdef); - -+#if 0 - static void rfbSpritePaintWindowBackground(WindowPtr pWin, - RegionPtr pRegion, int what); -+#endif - static void rfbSpritePaintWindowBorder(WindowPtr pWin, - RegionPtr pRegion, int what); - static void rfbSpriteCopyWindow(WindowPtr pWin, DDXPointRec ptOldOrg, -@@ -112,8 +114,9 @@ static void rfbSpriteSaveDoomedAreas - static RegionPtr rfbSpriteRestoreAreas(WindowPtr pWin, RegionPtr pRgnExposed); - static void rfbSpriteComputeSaved(ScreenPtr pScreen); - --static int rfbSpriteScreenKeyStore; --static DevPrivateKey rfbSpriteScreenKey = &rfbSpriteScreenKeyStore; -+static DevPrivateKeyRec rfbSpriteScreenKeyRec; -+#define rfbSpriteScreenKey (&rfbSpriteScreenKeyRec) -+ - - #define SCREEN_PROLOGUE(pScreen, field) ((pScreen)->field = \ - ((rfbSpriteScreenPtr)dixLookupPrivate(&(pScreen)->devPrivates, \ -@@ -145,8 +148,8 @@ static GCFuncs rfbSpriteGCFuncs = { - rfbSpriteCopyClip, - }; - --static int rfbSpriteGCKeyStore; --static DevPrivateKey rfbSpriteGCKey = &rfbSpriteGCKeyStore; -+static DevPrivateKeyRec rfbSpriteGCKeyRec; -+#define rfbSpriteGCKey (&rfbSpriteGCKeyRec) - - #define GC_FUNC_PROLOGUE(pGC) \ - rfbSpriteGCPtr pGCPriv = \ -@@ -329,7 +332,10 @@ rfbSpriteInitialize (pScreen, cursorFunc - rfbSpriteScreenPtr pPriv; - VisualPtr pVisual; - -- if (!dixRequestPrivate(rfbSpriteGCKey, sizeof(rfbSpriteGCRec))) -+ if (!dixRegisterPrivateKey(rfbSpriteScreenKey, PRIVATE_SCREEN, 0)) -+ return FALSE; -+ -+ if (!dixRegisterPrivateKey(rfbSpriteGCKey, PRIVATE_GC, sizeof(rfbSpriteGCRec))) - return FALSE; - - pPriv = (rfbSpriteScreenPtr) xalloc (sizeof (rfbSpriteScreenRec)); -@@ -357,8 +363,8 @@ rfbSpriteInitialize (pScreen, cursorFunc - pPriv->StoreColors = pScreen->StoreColors; - pPriv->DisplayCursor = pScreen->DisplayCursor; - -- pPriv->PaintWindowBackground = pScreen->PaintWindowBackground; -- pPriv->PaintWindowBorder = pScreen->PaintWindowBorder; -+// pPriv->PaintWindowBackground = pScreen->PaintWindowBackground; -+// pPriv->PaintWindowBorder = pScreen->PaintWindowBorder; - pPriv->CopyWindow = pScreen->CopyWindow; - pPriv->ClearToBackground = pScreen->ClearToBackground; - -@@ -393,8 +399,8 @@ rfbSpriteInitialize (pScreen, cursorFunc - pScreen->InstallColormap = rfbSpriteInstallColormap; - pScreen->StoreColors = rfbSpriteStoreColors; - -- pScreen->PaintWindowBackground = rfbSpritePaintWindowBackground; -- pScreen->PaintWindowBorder = rfbSpritePaintWindowBorder; -+// pScreen->PaintWindowBackground = rfbSpritePaintWindowBackground; -+// pScreen->PaintWindowBorder = rfbSpritePaintWindowBorder; - pScreen->CopyWindow = rfbSpriteCopyWindow; - pScreen->ClearToBackground = rfbSpriteClearToBackground; - -@@ -435,8 +441,8 @@ rfbSpriteCloseScreen (i, pScreen) - pScreen->InstallColormap = pScreenPriv->InstallColormap; - pScreen->StoreColors = pScreenPriv->StoreColors; - -- pScreen->PaintWindowBackground = pScreenPriv->PaintWindowBackground; -- pScreen->PaintWindowBorder = pScreenPriv->PaintWindowBorder; -+// pScreen->PaintWindowBackground = pScreenPriv->PaintWindowBackground; -+// pScreen->PaintWindowBorder = pScreenPriv->PaintWindowBorder; - pScreen->CopyWindow = pScreenPriv->CopyWindow; - pScreen->ClearToBackground = pScreenPriv->ClearToBackground; - -@@ -809,6 +815,7 @@ rfbSpriteRestoreAreas (pWin, prgnExposed - * Window wrappers - */ - -+#if 0 - static void - rfbSpritePaintWindowBackground (pWin, pRegion, what) - WindowPtr pWin; -@@ -866,6 +873,7 @@ rfbSpritePaintWindowBorder (pWin, pRegio - - SCREEN_EPILOGUE (pScreen, PaintWindowBorder, rfbSpritePaintWindowBorder); - } -+#endif - - static void - rfbSpriteCopyWindow (pWin, ptOldOrg, pRegion) -Index: xorg-server-1.9.3/hw/vnc/spritest.h -=================================================================== ---- xorg-server-1.9.3.orig/hw/vnc/spritest.h -+++ xorg-server-1.9.3/hw/vnc/spritest.h -@@ -70,8 +70,8 @@ typedef struct { - ScreenBlockHandlerProcPtr BlockHandler; - InstallColormapProcPtr InstallColormap; - StoreColorsProcPtr StoreColors; -- PaintWindowBackgroundProcPtr PaintWindowBackground; -- PaintWindowBorderProcPtr PaintWindowBorder; -+// PaintWindowBackgroundProcPtr PaintWindowBackground; -+// PaintWindowBorderProcPtr PaintWindowBorder; - CopyWindowProcPtr CopyWindow; - ClearToBackgroundProcPtr ClearToBackground; - SaveDoomedAreasProcPtr SaveDoomedAreas; -Index: xorg-server-1.9.3/hw/vnc/cutpaste.c -=================================================================== ---- xorg-server-1.9.3.orig/hw/vnc/cutpaste.c -+++ xorg-server-1.9.3/hw/vnc/cutpaste.c -@@ -54,7 +54,7 @@ rfbSetXCutText(char *str, int len) - Selection *pSel; - - inSetXCutText = TRUE; -- ChangeWindowProperty(WindowTable[0], XA_CUT_BUFFER0, XA_STRING, -+ ChangeWindowProperty(screenInfo.screens[0]->root, XA_CUT_BUFFER0, XA_STRING, - 8, PropModeReplace, len, - (pointer)str, TRUE); - -Index: xorg-server-1.9.3/hw/vnc/dispcur.c -=================================================================== ---- xorg-server-1.9.3.orig/hw/vnc/dispcur.c -+++ xorg-server-1.9.3/hw/vnc/dispcur.c -@@ -74,10 +74,10 @@ in this Software without prior written a - - /* per-screen private data */ - --static int rfbDCScreenKeyStore; --static DevPrivateKey rfbDCScreenKey = &rfbDCScreenKeyStore; --static int rfbScreenKeyStore; --static DevPrivateKey rfbScreenKey = &rfbScreenKeyStore; -+static DevPrivateKeyRec rfbDCScreenKeyRec; -+#define rfbDCScreenKey (&rfbDCScreenKeyRec) -+static DevPrivateKeyRec rfbScreenKeyRec; -+#define rfbScreenKey (&rfbScreenKeyRec) - - static Bool rfbDCCloseScreen(int index, ScreenPtr pScreen); - -@@ -137,6 +137,12 @@ rfbDCInitialize (ScreenPtr pScreen, miPo - { - rfbDCScreenPtr pScreenPriv; - -+ if (!dixRegisterPrivateKey(rfbDCScreenKey, PRIVATE_SCREEN, 0)) -+ return FALSE; -+ -+ if (!dixRegisterPrivateKey(rfbScreenKey, PRIVATE_CURSOR_BITS, 0)) -+ return FALSE; -+ - pScreenPriv = (rfbDCScreenPtr) xalloc (sizeof (rfbDCScreenRec)); - if (!pScreenPriv) - return FALSE; -@@ -340,7 +346,7 @@ rfbDCRealize (ScreenPtr pScreen, CursorP - 0, 0, pCursor->bits->width, pCursor->bits->height, - 0, XYPixmap, (char *)pCursor->bits->source); - gcvals[0] = GXand; -- ChangeGC (pGC, GCFunction, gcvals); -+ ChangeGCXIDs (NullClient, pGC, GCFunction, gcvals); - ValidateGC ((DrawablePtr)pPriv->sourceBits, pGC); - (*pGC->ops->PutImage) ((DrawablePtr)pPriv->sourceBits, pGC, 1, - 0, 0, pCursor->bits->width, pCursor->bits->height, -@@ -348,13 +354,13 @@ rfbDCRealize (ScreenPtr pScreen, CursorP - - /* mask bits -- pCursor->mask & ~pCursor->source */ - gcvals[0] = GXcopy; -- ChangeGC (pGC, GCFunction, gcvals); -+ ChangeGCXIDs (NullClient, pGC, GCFunction, gcvals); - ValidateGC ((DrawablePtr)pPriv->maskBits, pGC); - (*pGC->ops->PutImage) ((DrawablePtr)pPriv->maskBits, pGC, 1, - 0, 0, pCursor->bits->width, pCursor->bits->height, - 0, XYPixmap, (char *)pCursor->bits->mask); - gcvals[0] = GXandInverted; -- ChangeGC (pGC, GCFunction, gcvals); -+ ChangeGCXIDs (NullClient, pGC, GCFunction, gcvals); - ValidateGC ((DrawablePtr)pPriv->maskBits, pGC); - (*pGC->ops->PutImage) ((DrawablePtr)pPriv->maskBits, pGC, 1, - 0, 0, pCursor->bits->width, pCursor->bits->height, -@@ -396,7 +402,7 @@ rfbDCPutBits (DrawablePtr pDrawable, rfb - if (sourceGC->fgPixel != source) - { - gcvals[0] = source; -- DoChangeGC (sourceGC, GCForeground, gcvals, 0); -+ ChangeGCXIDs (NullClient, sourceGC, GCForeground, gcvals); - } - if (sourceGC->serialNumber != pDrawable->serialNumber) - ValidateGC (pDrawable, sourceGC); -@@ -404,7 +410,7 @@ rfbDCPutBits (DrawablePtr pDrawable, rfb - if (maskGC->fgPixel != mask) - { - gcvals[0] = mask; -- DoChangeGC (maskGC, GCForeground, gcvals, 0); -+ ChangeGCXIDs (NullClient, maskGC, GCForeground, gcvals); - } - if (maskGC->serialNumber != pDrawable->serialNumber) - ValidateGC (pDrawable, maskGC); -@@ -451,7 +457,7 @@ rfbDCPutUpCursor (pScreen, pCursor, x, y - } - pScreenPriv = (rfbDCScreenPtr)dixLookupPrivate(&pScreen->devPrivates, - rfbDCScreenKey); -- pWin = WindowTable[pScreen->myNum]; -+ pWin = pScreen->root; - #ifdef ARGB_CURSOR - if (pPriv->pPicture) - { -@@ -498,7 +504,7 @@ rfbDCSaveUnderCursor (pScreen, x, y, w, - pScreenPriv = (rfbDCScreenPtr)dixLookupPrivate(&pScreen->devPrivates, - rfbDCScreenKey); - pSave = pScreenPriv->pSave; -- pWin = WindowTable[pScreen->myNum]; -+ pWin = pScreen->root; - if (!pSave || pSave->drawable.width < w || pSave->drawable.height < h) - { - if (pSave) -@@ -531,7 +537,7 @@ rfbDCRestoreUnderCursor (pScreen, x, y, - pScreenPriv = (rfbDCScreenPtr)dixLookupPrivate(&pScreen->devPrivates, - rfbDCScreenKey); - pSave = pScreenPriv->pSave; -- pWin = WindowTable[pScreen->myNum]; -+ pWin = pScreen->root; - if (!pSave) - return FALSE; - if (!EnsureGC(pScreenPriv->pRestoreGC, pWin)) -@@ -558,7 +564,7 @@ rfbDCChangeSave (pScreen, x, y, w, h, dx - pScreenPriv = (rfbDCScreenPtr)dixLookupPrivate(&pScreen->devPrivates, - rfbDCScreenKey); - pSave = pScreenPriv->pSave; -- pWin = WindowTable[pScreen->myNum]; -+ pWin = pScreen->root; - /* - * restore the bits which are about to get trashed - */ -@@ -702,7 +708,7 @@ rfbDCMoveCursor (pScreen, pCursor, x, y, - } - pScreenPriv = (rfbDCScreenPtr)dixLookupPrivate(&pScreen->devPrivates, - rfbDCScreenKey); -- pWin = WindowTable[pScreen->myNum]; -+ pWin = pScreen->root; - pTemp = pScreenPriv->pTemp; - if (!pTemp || - pTemp->drawable.width != pScreenPriv->pSave->drawable.width || -Index: xorg-server-1.9.3/hw/vnc/kbdptr.c -=================================================================== ---- xorg-server-1.9.3.orig/hw/vnc/kbdptr.c -+++ xorg-server-1.9.3/hw/vnc/kbdptr.c -@@ -153,7 +153,7 @@ KbdAddEvent(Bool down, KeySym keySym, rf - #ifdef CORBA - if (cl) { - CARD32 clientId = cl->sock; -- ChangeWindowProperty(WindowTable[0], VNC_LAST_CLIENT_ID, XA_INTEGER, -+ ChangeWindowProperty(screenInfo.screens[0]->root, VNC_LAST_CLIENT_ID, XA_INTEGER, - 32, PropModeReplace, 1, (pointer)&clientId, TRUE); - } - #endif -@@ -310,7 +310,7 @@ PtrAddEvent(int buttonMask, int x, int y - #ifdef CORBA - if (cl) { - CARD32 clientId = cl->sock; -- ChangeWindowProperty(WindowTable[0], VNC_LAST_CLIENT_ID, XA_INTEGER, -+ ChangeWindowProperty(screenInfo.screens[0]->root, VNC_LAST_CLIENT_ID, XA_INTEGER, - 32, PropModeReplace, 1, (pointer)&clientId, TRUE); - } - #endif -Index: xorg-server-1.9.3/hw/vnc/rfbserver.c -=================================================================== ---- xorg-server-1.9.3.orig/hw/vnc/rfbserver.c -+++ xorg-server-1.9.3/hw/vnc/rfbserver.c -@@ -82,7 +82,7 @@ void - rfbRootPropertyChange(ScreenPtr pScreen) - { - PropertyPtr pProp; -- WindowPtr pWin = WindowTable[pScreen->myNum]; -+ WindowPtr pWin = pScreen->root; - - pProp = wUserProps (pWin); - -@@ -1068,7 +1068,7 @@ rfbProcessClientNormalMessage(cl) - GenerateVncChromiumConnectedEvent(cl->sock); - if (enc == rfbEncodingChromium) { - /* Generate exposures for all windows */ -- WindowPtr pWin = WindowTable[cl->pScreen->myNum]; -+ WindowPtr pWin = cl->pScreen->root; - rfbSetClip(pWin, 1); - } - else { -@@ -1866,13 +1866,13 @@ rfbSendSetColourMapEntries(cl, firstColo - - /* PseudoColor */ - #if XFREE86VNC -- if (miInstalledMaps[cl->pScreen->myNum]->class == PseudoColor) { -+ if (GetInstalledmiColormap(cl->pScreen)->class == PseudoColor) { - #else - if (pVNC->rfbInstalledColormap->class == PseudoColor) { - #endif - scme->firstColour = Swap16IfLE(firstColour); - #if XFREE86VNC -- pent = (EntryPtr)&miInstalledMaps[cl->pScreen->myNum]->red[firstColour]; -+ pent = (EntryPtr)&GetInstalledmiColormap(cl->pScreen)->red[firstColour]; - #else - pent = (EntryPtr)&pVNC->rfbInstalledColormap->red[firstColour]; - #endif -@@ -1894,12 +1894,12 @@ rfbSendSetColourMapEntries(cl, firstColo - - /* Break the DirectColor pixel into its r/g/b components */ - #if XFREE86VNC -- redPart = (firstColour & miInstalledMaps[cl->pScreen->myNum]->pVisual->redMask) -- >> miInstalledMaps[cl->pScreen->myNum]->pVisual->offsetRed; -- greenPart = (firstColour & miInstalledMaps[cl->pScreen->myNum]->pVisual->greenMask) -- >> miInstalledMaps[cl->pScreen->myNum]->pVisual->offsetGreen; -- bluePart = (firstColour & miInstalledMaps[cl->pScreen->myNum]->pVisual->blueMask) -- >> miInstalledMaps[cl->pScreen->myNum]->pVisual->offsetBlue; -+ redPart = (firstColour & GetInstalledmiColormap(cl->pScreen)->pVisual->redMask) -+ >> GetInstalledmiColormap(cl->pScreen)->pVisual->offsetRed; -+ greenPart = (firstColour & GetInstalledmiColormap(cl->pScreen)->pVisual->greenMask) -+ >> GetInstalledmiColormap(cl->pScreen)->pVisual->offsetGreen; -+ bluePart = (firstColour & GetInstalledmiColormap(cl->pScreen)->pVisual->blueMask) -+ >> GetInstalledmiColormap(cl->pScreen)->pVisual->offsetBlue; - #else - redPart = (firstColour & pVNC->rfbInstalledColormap->pVisual->redMask) - >> pVNC->rfbInstalledColormap->pVisual->offsetRed; -@@ -1918,9 +1918,9 @@ rfbSendSetColourMapEntries(cl, firstColo - scme->firstColour = Swap16IfLE((greenPart << 8) | bluePart); - - #if XFREE86VNC -- redEntry = (EntryPtr)&miInstalledMaps[cl->pScreen->myNum]->red[redPart]; -- greenEntry = (EntryPtr)&miInstalledMaps[cl->pScreen->myNum]->green[greenPart]; -- blueEntry = (EntryPtr)&miInstalledMaps[cl->pScreen->myNum]->blue[bluePart]; -+ redEntry = (EntryPtr)&GetInstalledmiColormap(cl->pScreen)->red[redPart]; -+ greenEntry = (EntryPtr)&GetInstalledmiColormap(cl->pScreen)->green[greenPart]; -+ blueEntry = (EntryPtr)&GetInstalledmiColormap(cl->pScreen)->blue[bluePart]; - #else - redEntry = (EntryPtr)&pVNC->rfbInstalledColormap->red[redPart]; - greenEntry = (EntryPtr)&pVNC->rfbInstalledColormap->green[greenPart]; -Index: xorg-server-1.9.3/hw/vnc/tabletranstemplate.c -=================================================================== ---- xorg-server-1.9.3.orig/hw/vnc/tabletranstemplate.c -+++ xorg-server-1.9.3/hw/vnc/tabletranstemplate.c -@@ -67,7 +67,7 @@ rfbTranslateWithSingleTableINtoOUT (Scre - OUT_T *op = (OUT_T *)optr; - OUT_T *opLineEnd; - OUT_T *t = (OUT_T *)table; -- DrawablePtr pDraw = (DrawablePtr)WindowTable[pScreen->myNum]; -+ DrawablePtr pDraw = (DrawablePtr)pScreen->root; - int truewidth = PixmapBytePad(width, in->bitsPerPixel); - unsigned char *iptr = malloc(truewidth * height * in->bitsPerPixel / 8); - int ipextra = truewidth - width; -@@ -107,7 +107,7 @@ rfbTranslateWithRGBTablesINtoOUT (Screen - OUT_T *redTable = (OUT_T *)table; - OUT_T *greenTable = redTable + in->redMax + 1; - OUT_T *blueTable = greenTable + in->greenMax + 1; -- DrawablePtr pDraw = (DrawablePtr)WindowTable[pScreen->myNum]; -+ DrawablePtr pDraw = (DrawablePtr)pScreen->root; - int truewidth = PixmapBytePad(width, in->bitsPerPixel); - unsigned char *iptr = malloc(truewidth * height * in->bitsPerPixel / 8); - int ipextra = truewidth - width; -Index: xorg-server-1.9.3/hw/vnc/translate.c -=================================================================== ---- xorg-server-1.9.3.orig/hw/vnc/translate.c -+++ xorg-server-1.9.3/hw/vnc/translate.c -@@ -167,7 +167,7 @@ rfbTranslateNone(ScreenPtr pScreen, char - int width, int height, int x, int y) - { - VNCSCREENPTR(pScreen); -- DrawablePtr pDraw = (DrawablePtr)WindowTable[pScreen->myNum]; -+ DrawablePtr pDraw = (DrawablePtr)pScreen->root; - int truewidth = PixmapBytePad(width, in->bitsPerPixel); - - if ((x + width > pVNC->width) || truewidth != width * in->bitsPerPixel / 8) { -@@ -227,7 +227,7 @@ rfbSetTranslateFunction(cl) - if (!pVNC->rfbServerFormat.trueColour && - (pVNC->rfbServerFormat.bitsPerPixel != 8) && - #if XFREE86VNC -- (miInstalledMaps[cl->pScreen->myNum]->class == PseudoColor)) { -+ (GetInstalledmiColormap(cl->pScreen)->class == PseudoColor)) { - #else - (pVNC->rfbInstalledColormap->class == PseudoColor)) { - #endif -@@ -241,7 +241,7 @@ rfbSetTranslateFunction(cl) - if (!cl->format.trueColour && - (cl->format.bitsPerPixel != 8) && - #if XFREE86VNC -- (miInstalledMaps[cl->pScreen->myNum]->class == PseudoColor)) { -+ (GetInstalledmiColormap(cl->pScreen)->class == PseudoColor)) { - #else - (pVNC->rfbInstalledColormap->class == PseudoColor) ) { - #endif -@@ -265,7 +265,7 @@ rfbSetTranslateFunction(cl) - /* colour map -> colour map */ - - #if XFREE86VNC -- if (miInstalledMaps[cl->pScreen->myNum]->class == DirectColor) { -+ if (GetInstalledmiColormap(cl->pScreen)->class == DirectColor) { - #else - if (pVNC->rfbInstalledColormap->class == DirectColor) { - #endif -@@ -433,7 +433,7 @@ rfbSetClientColourMap(cl, firstColour, n - - if (nColours == 0) { - #if XFREE86VNC -- nColours = miInstalledMaps[cl->pScreen->myNum]->pVisual->ColormapEntries; -+ nColours = GetInstalledmiColormap(cl->pScreen)->pVisual->ColormapEntries; - #else - nColours = pVNC->rfbInstalledColormap->pVisual->ColormapEntries; - #endif -Index: xorg-server-1.9.3/hw/dmx/vnc/vncint.h -=================================================================== ---- xorg-server-1.9.3.orig/hw/dmx/vnc/vncint.h -+++ xorg-server-1.9.3/hw/dmx/vnc/vncint.h -@@ -114,8 +114,8 @@ typedef struct { - - CloseScreenProcPtr CloseScreen; - CreateGCProcPtr CreateGC; -- PaintWindowBackgroundProcPtr PaintWindowBackground; -- PaintWindowBorderProcPtr PaintWindowBorder; -+// PaintWindowBackgroundProcPtr PaintWindowBackground; -+// PaintWindowBorderProcPtr PaintWindowBorder; - CopyWindowProcPtr CopyWindow; - ClearToBackgroundProcPtr ClearToBackground; - RestoreAreasProcPtr RestoreAreas; -Index: xorg-server-1.9.3/hw/xfree86/vnc/vncint.h -=================================================================== ---- xorg-server-1.9.3.orig/hw/xfree86/vnc/vncint.h -+++ xorg-server-1.9.3/hw/xfree86/vnc/vncint.h -@@ -112,8 +112,8 @@ typedef struct { - - CloseScreenProcPtr CloseScreen; - CreateGCProcPtr CreateGC; -- PaintWindowBackgroundProcPtr PaintWindowBackground; -- PaintWindowBorderProcPtr PaintWindowBorder; -+// PaintWindowBackgroundProcPtr PaintWindowBackground; -+// PaintWindowBorderProcPtr PaintWindowBorder; - CopyWindowProcPtr CopyWindow; - ClearToBackgroundProcPtr ClearToBackground; - RestoreAreasProcPtr RestoreAreas; -Index: xorg-server-1.9.3/hw/vnc/vncext.c -=================================================================== ---- xorg-server-1.9.3.orig/hw/vnc/vncext.c -+++ xorg-server-1.9.3/hw/vnc/vncext.c -@@ -36,9 +36,10 @@ - #include - #include - --static int vncCreateScreenResourcesKeyStore, rfbGCKeyStore; --DevPrivateKey vncCreateScreenResourcesKey = &vncCreateScreenResourcesKeyStore; --DevPrivateKey rfbGCKey = &rfbGCKeyStore; -+static DevPrivateKeyRec vncCreateScreenResourcesKeyRec; -+#define vncCreateScreenResourcesKey (&vncCreateScreenResourcesKeyRec) -+DevPrivateKeyRec rfbGCKeyRec; -+#define rfbGCKey (&rfbGCKeyRec) - - int VncSelectNotify(ClientPtr client, BOOL onoff); - void VncExtensionInit(void); -@@ -762,8 +763,12 @@ VncExtensionInit(void) - - vncExtGeneration = serverGeneration; - -+ // doesn't seem to be valid any more - mhopf 21.12.2010 - // no allocation needed for screen privates -- if (!dixRequestPrivate(rfbGCKey, sizeof(rfbGCRec))) -+ if (!dixRegisterPrivateKey(vncCreateScreenResourcesKey, PRIVATE_SCREEN, 0)) -+ return; -+ -+ if (!dixRegisterPrivateKey(rfbGCKey, PRIVATE_GC, sizeof(rfbGCRec))) - return; - - #if XFREE86VNC -Index: xorg-server-1.9.3/hw/vnc/tableinitcmtemplate.c -=================================================================== ---- xorg-server-1.9.3.orig/hw/vnc/tableinitcmtemplate.c -+++ xorg-server-1.9.3/hw/vnc/tableinitcmtemplate.c -@@ -61,7 +61,7 @@ rfbInitColourMapSingleTableOUT (ScreenPt - t = (OUT_T *)*table; - - #if XFREE86VNC -- pent = (EntryPtr)&miInstalledMaps[pScreen->myNum]->red[0]; -+ pent = (EntryPtr)&GetInstalledmiColormap(pScreen)->red[0]; - #else - pent = (EntryPtr)&pVNC->rfbInstalledColormap->red[0]; - #endif -Index: xorg-server-1.9.3/hw/xfree86/vnc/vncInit.c -=================================================================== ---- xorg-server-1.9.3.orig/hw/xfree86/vnc/vncInit.c -+++ xorg-server-1.9.3/hw/xfree86/vnc/vncInit.c -@@ -286,8 +286,8 @@ VNCInit(ScreenPtr pScreen, unsigned char - - pScreenPriv->CloseScreen = pScreen->CloseScreen; - pScreenPriv->CreateGC = pScreen->CreateGC; -- pScreenPriv->PaintWindowBackground = pScreen->PaintWindowBackground; -- pScreenPriv->PaintWindowBorder = pScreen->PaintWindowBorder; -+// pScreenPriv->PaintWindowBackground = pScreen->PaintWindowBackground; -+// pScreenPriv->PaintWindowBorder = pScreen->PaintWindowBorder; - pScreenPriv->CopyWindow = pScreen->CopyWindow; - pScreenPriv->ClearToBackground = pScreen->ClearToBackground; - pScreenPriv->RestoreAreas = pScreen->RestoreAreas; -@@ -313,8 +313,8 @@ VNCInit(ScreenPtr pScreen, unsigned char - #endif - pScreen->CloseScreen = rfbCloseScreen; - pScreen->CreateGC = rfbCreateGC; -- pScreen->PaintWindowBackground = rfbPaintWindowBackground; -- pScreen->PaintWindowBorder = rfbPaintWindowBorder; -+// pScreen->PaintWindowBackground = rfbPaintWindowBackground; -+// pScreen->PaintWindowBorder = rfbPaintWindowBorder; - pScreen->CopyWindow = rfbCopyWindow; - pScreen->ClearToBackground = rfbClearToBackground; - pScreen->RestoreAreas = rfbRestoreAreas; diff --git a/xorg-x11-server.changes b/xorg-x11-server.changes index 3f0e301..775c20b 100644 --- a/xorg-x11-server.changes +++ b/xorg-x11-server.changes @@ -1,3 +1,26 @@ +------------------------------------------------------------------- +Tue Sep 6 15:55:01 UTC 2011 - sndirsch@suse.com + +- update to xorg-server 1.10.4 +- VNC patches completely redone by Egbert Eich (N-VNC-*) +- Xvnc-pthread.diff: small buildfix required for factory +- removed obsolete patches + * EXA-mixed-ModifyPixmapHeader-pitch-fixes.-bug-33929.patch + * Replace-malloc-with-calloc-to-initialize-the-buffers.patch + * U_xserver_fix-pixmaps-lifetime-tracking.patch + * commit-5c6a2f9.diff + * pad-size-of-system-memory-copy-for-1x1-pixmaps + * record-avoid-crash-when-calling-RecordFlushReplyBuff.patch + * xorg-server-stop-cpu-eating.diff +- adjusted patches + * bug534768-prefer_local_symbols.patch + * zap_warning_xserver.diff +- disabled patches for now + * 0001-Xinput-Catch-missing-configlayout-when-deleting-dev.patch + * cache-xkbcomp-output-for-fast-start-up.patch + * xserver-bg-none-root.patch + * 0001-Prevent-XSync-Alarms-from-senslessly-calling-CheckTr.patch + ------------------------------------------------------------------- Tue Aug 30 13:53:46 UTC 2011 - sndirsch@suse.com diff --git a/xorg-x11-server.spec b/xorg-x11-server.spec index 8dc317b..b88a967 100644 --- a/xorg-x11-server.spec +++ b/xorg-x11-server.spec @@ -19,7 +19,7 @@ Name: xorg-x11-server -%define dirsuffix 1.9.3 +%define dirsuffix 1.10.4 %define vnc 1 BuildRequires: Mesa-devel bison flex fontconfig-devel freetype2-devel ghostscript-library libdrm-devel libopenssl-devel pkgconfig xorg-x11 xorg-x11-devel xorg-x11-fonts-devel xorg-x11-libICE-devel xorg-x11-libSM-devel xorg-x11-libX11-devel xorg-x11-libXau-devel xorg-x11-libXdmcp-devel xorg-x11-libXext-devel xorg-x11-libXfixes-devel xorg-x11-libXmu-devel xorg-x11-libXp-devel xorg-x11-libXpm-devel xorg-x11-libXprintUtil-devel xorg-x11-libXrender-devel xorg-x11-libXt-devel xorg-x11-libXv-devel xorg-x11-libfontenc-devel xorg-x11-libxkbfile-devel xorg-x11-proto-devel xorg-x11-xtrans-devel ### udev support (broken on openSUSE 11.2, see also bnc #589997) @@ -59,19 +59,13 @@ Patch6: pu_fixes.diff Patch13: u_OS-acpi-Reconnect-to-acpid-when-it-gets-restarted.patch Patch16: p_xnest-ignore-getimage-errors.diff %if %vnc -### Dan Nicholson -#http://people.freedesktop.org/~dbn/xorg-server-xf4vnc.patch -Patch39: xorg-server-xf4vnc.patch -Patch40: xorg-server-xf4vnc-disable-dmxvnc.diff -Patch42: xorg-server-xf4vnc-TranslateNone.diff -Patch43: xorg-server-xf4vnc-abi-version.diff -Patch44: xorg-server-xf4vnc-cutpaste.diff -Patch46: xorg-server-xf4vnc-busyloop.diff -Patch47: xorg-server-xf4vnc-clientTimeout.diff -Patch48: xorg-server-xf4vnc-fix.diff -Patch49: xorg-server-xf4vnc-fixes_1_8.diff -Patch50: xorg-server-xf4vnc-fixes_1_9.diff -Patch51: xorg-server-xf4vnc-fix-keyboard-layout-handling.diff +Patch17: N-VNC-Add-support-for-VNC.patch +Patch18: N-VNC-Readd-timeout-when-vnc-viewer-connection-breaks.patch +Patch19: N-VNC-Fix-crash-when-no-depth-translation-is-required.patch +Patch20: N-VNC-Don-t-let-VNC-access-the-framebuffer-directly-an.patch +Patch21: N-VNC-Enable-use-of-all-keyboard-layouts-independent-o.patch +Patch22: N-VNC-Fix-crash-due-to-unset-input-device-names.patch +Patch23: Xvnc-pthread.diff %endif Patch45: bug-197858_dpms.diff Patch77: fbdevhw.diff @@ -98,15 +92,7 @@ Patch210: pio_ia64.diff Patch211: 0001-Prevent-XSync-Alarms-from-senslessly-calling-CheckTr.patch Patch213: xorg-server-xdmcp.patch Patch220: Use-external-tool-for-creating-backtraces-on-crashes.patch -Patch221: commit-5c6a2f9.diff Patch222: sync-fix.patch -Patch224: pad-size-of-system-memory-copy-for-1x1-pixmaps -Patch225: xorg-server-stop-cpu-eating.diff -Patch226: record-avoid-crash-when-calling-RecordFlushReplyBuff.patch -Patch227: Replace-malloc-with-calloc-to-initialize-the-buffers.patch -Patch228: EXA-mixed-ModifyPixmapHeader-pitch-fixes.-bug-33929.patch -Patch229: u_xf4nvc_missing-libz.patch -Patch230: U_xserver_fix-pixmaps-lifetime-tracking.patch %description This package contains the X.Org Server. @@ -171,20 +157,13 @@ An X Window System server for Virtual Network Computing (VNC). %patch13 -p1 %patch16 -p2 %if %vnc -%patch39 -p1 -%patch40 -p0 -%patch42 -p1 -%patch43 -p0 -%patch44 -%patch46 -p1 -%patch47 -p1 -%patch48 -p1 -%patch49 -p0 -%patch50 -p1 -%patch51 -p1 -%patch229 -p0 -%patch230 -p1 -chmod 755 hw/vnc/symlink-vnc.sh +%patch17 -p1 +%patch18 -p1 +%patch19 -p1 +%patch20 -p1 +%patch21 -p1 +%patch22 -p1 +%patch23 -p1 %endif %patch45 -p0 pushd xorg-docs-* @@ -196,7 +175,8 @@ popd %patch106 -p1 %patch112 -p0 %patch123 -p0 -%patch125 -p1 +### disabled for now +#%patch125 -p1 %patch127 -p1 %patch128 pushd hw/xfree86/os-support/bus @@ -204,25 +184,22 @@ pushd hw/xfree86/os-support/bus popd %patch143 -p0 %patch145 -p0 -%patch162 -p1 -%patch163 -p1 +### disabled for now +#%patch162 -p1 +### disabled for now +#%patch163 -p1 %patch164 -p1 %patch200 -p1 %patch202 -p1 %patch203 -p1 %patch206 -p0 %patch210 -p1 -%patch211 -p1 +### disabled for now +#%patch211 -p1 %patch213 -p1 # Disable backtrace generation patch for now #%patch220 -p1 -%patch221 -p1 %patch222 -p1 -%patch224 -p1 -%patch225 -p1 -%patch226 -p1 -%patch227 -p1 -%patch228 -p1 %build pushd xorg-docs-* @@ -300,7 +277,6 @@ mkdir -p $RPM_BUILD_ROOT/usr/%{_lib}/xorg/modules/updates/{fonts,input,linux,dri install -m 644 $RPM_SOURCE_DIR/README.updates $RPM_BUILD_ROOT/usr/%{_lib}/xorg/modules/updates mkdir -p $RPM_BUILD_ROOT/etc/modprobe.d install -m 644 $RPM_SOURCE_DIR/modprobe.nvidia $RPM_BUILD_ROOT/etc/modprobe.d/50-nvidia.conf -gzip -c hw/dmx/Xdmx.man > $RPM_BUILD_ROOT/%{_mandir}/man1/Xdmx.1.gz %else rm -f $RPM_BUILD_ROOT/usr/share/aclocal/*.m4 %endif @@ -428,6 +404,7 @@ exit 0 /usr/include/xorg/ /usr/%{_lib}/*.a %ifnarch s390 s390x +%exclude /usr/%{_lib}/libxf86config.la /usr/%{_lib}/pkgconfig/*.pc /usr/share/aclocal/*.m4 %endif diff --git a/zap_warning_xserver.diff b/zap_warning_xserver.diff index 3093566..9b24c3f 100644 --- a/zap_warning_xserver.diff +++ b/zap_warning_xserver.diff @@ -80,8 +80,8 @@ Index: xorg-server-1.6.3.901/hw/xfree86/common/xf86Config.c Bool dontZoom; Bool notrapSignals; /* don't exit cleanly - die at fault */ Bool caughtSignal; ---- xorg-server-1.7.99/hw/xfree86/doc/man/Xorg.man.pre -+++ xorg-server-1.7.99/hw/xfree86/doc/man/Xorg.man.pre +--- xorg-server-1.7.99/hw/xfree86/doc/man/Xorg.man ++++ xorg-server-1.7.99/hw/xfree86/doc/man/Xorg.man @@ -438,7 +438,7 @@ .B Ctrl+Alt+Backspace Immediately kills the server -- no questions asked. It can be disabled by @@ -91,8 +91,8 @@ Index: xorg-server-1.6.3.901/hw/xfree86/common/xf86Config.c __xconfigfile__(__filemansuffix__) file option to a TRUE value. .PP .RS 8 ---- xorg-server-1.7.99/hw/xfree86/doc/man/xorg.conf.man.pre -+++ xorg-server-1.7.99/hw/xfree86/doc/man/xorg.conf.man.pre +--- xorg-server-1.7.99/hw/xfree86/doc/man/xorg.conf.man ++++ xorg-server-1.7.99/hw/xfree86/doc/man/xorg.conf.man @@ -507,6 +507,13 @@ When this option is enabled, the action has no effect. Default: off.