diff --git a/.cvsignore b/.cvsignore index e69de29..a1aa298 100644 --- a/.cvsignore +++ b/.cvsignore @@ -0,0 +1,7 @@ +tigervnc-0.0.90-20090303svn3631.tar.bz2 +vncserver.init +vncserver.sysconfig +vnc-16x16.png +vnc-24x24.png +vnc-48x48.png +vncviewer.desktop diff --git a/sources b/sources index e69de29..048881f 100644 --- a/sources +++ b/sources @@ -0,0 +1,7 @@ +8d262508edb0e18d9d114fc56955e2ed tigervnc-0.0.90-20090303svn3631.tar.bz2 +ededd32e8bc5364c4bf41552d0b56b96 vncserver.init +833229c4a91fd869ca8a4d1c5d189a15 vncserver.sysconfig +2f19f562d4ff6b8752c1686331ce44b7 vnc-16x16.png +273f51f58324f12e2cc96e2a1dcc5a6d vnc-24x24.png +f96d936a0fcc61cabee0e6cb65e0e38a vnc-48x48.png +2531d7bbc8369fb23e4cb1578521edc6 vncviewer.desktop diff --git a/tigervnc-102434.patch b/tigervnc-102434.patch new file mode 100644 index 0000000..cd1e660 --- /dev/null +++ b/tigervnc-102434.patch @@ -0,0 +1,65 @@ +diff -up tightvnc-1.5.0-20081015svn3022/unix/vncviewer/CConn.cxx.102434 tightvnc-1.5.0-20081015svn3022/unix/vncviewer/CConn.cxx +--- tightvnc-1.5.0-20081015svn3022/unix/vncviewer/CConn.cxx.102434 2008-10-10 17:48:22.000000000 +0200 ++++ tightvnc-1.5.0-20081015svn3022/unix/vncviewer/CConn.cxx 2008-10-22 18:35:46.000000000 +0200 +@@ -37,6 +37,8 @@ + #include "ServerDialog.h" + #include "PasswdDialog.h" + #include "parameters.h" ++#include ++#include + + using namespace rfb; + +@@ -209,6 +211,15 @@ void CConn::getUserPasswd(char** user, c + return; + } + ++ /* XXX Who wrote this code? Yes, it is really ugly */ ++ if (passwdInput) { ++ std::string s; ++ std::cin >> s; ++ *password = strdup(s.c_str()); ++ if(user) *user = 0; ++ return; ++ } ++ + const char* secType = secTypeName(getCurrentCSecurity()->getType()); + const char* titlePrefix = _("VNC authentication"); + unsigned int titleLen = strlen(titlePrefix) + strlen(secType) + 4; +diff -up tightvnc-1.5.0-20081015svn3022/unix/vncviewer/parameters.h.102434 tightvnc-1.5.0-20081015svn3022/unix/vncviewer/parameters.h +--- tightvnc-1.5.0-20081015svn3022/unix/vncviewer/parameters.h.102434 2006-05-18 13:08:21.000000000 +0200 ++++ tightvnc-1.5.0-20081015svn3022/unix/vncviewer/parameters.h 2008-10-22 18:08:47.000000000 +0200 +@@ -41,6 +41,7 @@ extern rfb::BoolParameter customCompress + extern rfb::IntParameter compressLevel; + extern rfb::BoolParameter noJpeg; + extern rfb::IntParameter qualityLevel; ++extern rfb::BoolParameter passwdInput; + + extern char aboutText[]; + extern char* programName; +diff -up tightvnc-1.5.0-20081015svn3022/unix/vncviewer/vncviewer.cxx.102434 tightvnc-1.5.0-20081015svn3022/unix/vncviewer/vncviewer.cxx +--- tightvnc-1.5.0-20081015svn3022/unix/vncviewer/vncviewer.cxx.102434 2008-09-28 07:08:48.000000000 +0200 ++++ tightvnc-1.5.0-20081015svn3022/unix/vncviewer/vncviewer.cxx 2008-10-22 18:04:00.000000000 +0200 +@@ -58,6 +58,7 @@ IntParameter wmDecorationHeight("WMDecor + "manager decoration around a window", 24); + StringParameter passwordFile("PasswordFile", + "Password file for VNC authentication", ""); ++BoolParameter passwdInput("passwdInput", "Gets password from stdin", false); + AliasParameter rfbauth("passwd", "Alias for PasswordFile", &passwordFile); + + BoolParameter useLocalCursor("UseLocalCursor", +diff -up tightvnc-1.5.0-20081015svn3022/unix/vncviewer/vncviewer.man.102434 tightvnc-1.5.0-20081015svn3022/unix/vncviewer/vncviewer.man +--- tightvnc-1.5.0-20081015svn3022/unix/vncviewer/vncviewer.man.102434 2006-06-02 06:43:52.000000000 +0200 ++++ tightvnc-1.5.0-20081015svn3022/unix/vncviewer/vncviewer.man 2008-10-22 18:04:00.000000000 +0200 +@@ -115,6 +115,11 @@ the server, you can specify it here to a + "~/.vnc/passwd". + + .TP ++.B \-passwdInput \fItrue, false\fP ++Force standard vnc dialog to getting password and reads password from stdin. ++Default is false(shows dialog window) ++ ++.TP + .B \-Shared + When you make a connection to a VNC server, all other existing connections are + normally closed. This option requests that they be left open, allowing you to diff --git a/tigervnc-bounds.patch b/tigervnc-bounds.patch new file mode 100644 index 0000000..6317337 --- /dev/null +++ b/tigervnc-bounds.patch @@ -0,0 +1,55 @@ +diff -up tightvnc-1.5.0-20081015svn3022/unix/xserver/hw/vnc/XserverDesktop.cc.bounds tightvnc-1.5.0-20081015svn3022/unix/xserver/hw/vnc/XserverDesktop.cc +--- tightvnc-1.5.0-20081015svn3022/unix/xserver/hw/vnc/XserverDesktop.cc.bounds 2008-10-15 15:23:24.000000000 +0200 ++++ tightvnc-1.5.0-20081015svn3022/unix/xserver/hw/vnc/XserverDesktop.cc 2008-10-23 12:46:31.000000000 +0200 +@@ -500,32 +500,36 @@ void XserverDesktop::add_changed(RegionP + { + if (ignoreHooks_) return; + if (grabbing) return; ++ ++ BoxRec screenbox; ++ RegionPtr newreg = REGION_CREATE(pScreen, 0, 0); ++ ++ screenbox.x1 = screenbox.y1 = 0; ++ screenbox.x2 = pScreen->width; ++ screenbox.y2 = pScreen->height; ++ ++ RegionPtr screenreg = REGION_CREATE(pScreen, &screenbox, 0); ++ REGION_INTERSECT(pScreen, newreg, reg, screenreg); ++ REGION_DESTROY (pScreen, screenreg); ++ + try { + rfb::Region rfbReg; +- rfbReg.setExtentsAndOrderedRects((ShortRect*)REGION_EXTENTS(pScreen, reg), +- REGION_NUM_RECTS(reg), +- (ShortRect*)REGION_RECTS(reg)); ++ rfbReg.setExtentsAndOrderedRects((ShortRect*)REGION_EXTENTS(pScreen, newreg), ++ REGION_NUM_RECTS(newreg), ++ (ShortRect*)REGION_RECTS(newreg)); + server->add_changed(rfbReg); + deferUpdate(); + } catch (rdr::Exception& e) { + vlog.error("XserverDesktop::add_changed: %s",e.str()); + } ++ REGION_DESTROY (pScreen, newreg); + } + + void XserverDesktop::add_copied(RegionPtr dst, int dx, int dy) + { +- if (ignoreHooks_) return; +- if (grabbing) return; +- try { +- rfb::Region rfbReg; +- rfbReg.setExtentsAndOrderedRects((ShortRect*)REGION_EXTENTS(pScreen, dst), +- REGION_NUM_RECTS(dst), +- (ShortRect*)REGION_RECTS(dst)); +- server->add_copied(rfbReg, rfb::Point(dx, dy)); +- deferUpdate(); +- } catch (rdr::Exception& e) { +- vlog.error("XserverDesktop::add_copied: %s",e.str()); +- } ++ add_changed (dst); ++ REGION_TRANSLATE (pScreen, dst, -dx, -dy); ++ add_changed (dst); + } + + void XserverDesktop::positionCursor() diff --git a/tigervnc-clipboard.patch b/tigervnc-clipboard.patch new file mode 100644 index 0000000..9865ec2 --- /dev/null +++ b/tigervnc-clipboard.patch @@ -0,0 +1,18 @@ +diff -up vnc-4_1_2-unixsrc/unix/vncserver.clipboard vnc-4_1_2-unixsrc/unix/vncserver +--- vnc-4_1_2-unixsrc/unix/vncserver.clipboard 2008-03-13 16:17:07.000000000 +0100 ++++ vnc-4_1_2-unixsrc/unix/vncserver 2008-03-13 16:18:14.000000000 +0100 +@@ -42,13 +42,13 @@ $xauthorityFile = "$ENV{XAUTHORITY}" || + + $defaultXStartup + = ("#!/bin/sh\n\n". ++ "vncconfig -iconic &\n". + "# Uncomment the following two lines for normal desktop:\n". + "# unset SESSION_MANAGER\n". + "# exec /etc/X11/xinit/xinitrc\n\n". + "[ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup\n". + "[ -r \$HOME/.Xresources ] && xrdb \$HOME/.Xresources\n". + "xsetroot -solid grey\n". +- "vncconfig -iconic &\n". + "xterm -geometry 80x24+10+10 -ls -title \"\$VNCDESKTOP Desktop\" &\n". + "twm &\n"); + diff --git a/tigervnc-cookie.patch b/tigervnc-cookie.patch new file mode 100644 index 0000000..d653f3a --- /dev/null +++ b/tigervnc-cookie.patch @@ -0,0 +1,27 @@ +--- vnc-4_1-unixsrc/unix/vncserver.cookie 2005-02-23 12:28:18.000000000 +0000 ++++ vnc-4_1-unixsrc/unix/vncserver 2005-03-03 22:04:28.000000000 +0000 +@@ -116,18 +116,12 @@ + $desktopLog = "$vncUserDir/$host:$displayNumber.log"; + unlink($desktopLog); + +-# Make an X server cookie - use as the seed the sum of the current time, our +-# PID and part of the encrypted form of the password. Ideally we'd use +-# /dev/urandom, but that's only available on Linux. +- +-srand(time+$$+unpack("L",`cat $vncUserDir/passwd`)); +-$cookie = ""; +-for (1..16) { +- $cookie .= sprintf("%02x", int(rand(256)) % 256); +-} +- +-system("xauth -f $xauthorityFile add $host:$displayNumber . $cookie"); +-system("xauth -f $xauthorityFile add $host/unix:$displayNumber . $cookie"); ++# Make an X server cookie - use mcookie ++$cookie = `/usr/bin/mcookie`; ++open (XAUTH, "|xauth -f $xauthorityFile source -"); ++print XAUTH "add $host:$displayNumber . $cookie\n"; ++print XAUTH "add $host/unix:$displayNumber . $cookie\n"; ++close XAUTH; + + if ($opt{'-name'}) { + $desktopName = $opt{'-name'}; diff --git a/tigervnc-manminor.patch b/tigervnc-manminor.patch new file mode 100644 index 0000000..eab6751 --- /dev/null +++ b/tigervnc-manminor.patch @@ -0,0 +1,14 @@ +diff -up tightvnc-1.5.0-20081015svn3022/unix/vncviewer/vncviewer.man.manminor tightvnc-1.5.0-20081015svn3022/unix/vncviewer/vncviewer.man +--- tightvnc-1.5.0-20081015svn3022/unix/vncviewer/vncviewer.man.manminor 2008-10-23 12:58:02.000000000 +0200 ++++ tightvnc-1.5.0-20081015svn3022/unix/vncviewer/vncviewer.man 2008-10-23 12:58:23.000000000 +0200 +@@ -8,6 +8,10 @@ vncviewer \- VNC viewer for X + .br + .B vncviewer + .RI [ options ] ++.RI [ host ][:: port ] ++.br ++.B vncviewer ++.RI [ options ] + .B \-listen + .RI [ port ] + .SH DESCRIPTION diff --git a/tigervnc-newfbsize.patch b/tigervnc-newfbsize.patch new file mode 100644 index 0000000..e63c341 --- /dev/null +++ b/tigervnc-newfbsize.patch @@ -0,0 +1,12 @@ +diff -up tightvnc-1.5.0-20081015svn3022/unix/vncviewer/CConn.cxx.newfbsize tightvnc-1.5.0-20081015svn3022/unix/vncviewer/CConn.cxx +--- tightvnc-1.5.0-20081015svn3022/unix/vncviewer/CConn.cxx.newfbsize 2008-10-23 13:00:59.000000000 +0200 ++++ tightvnc-1.5.0-20081015svn3022/unix/vncviewer/CConn.cxx 2008-10-23 13:01:11.000000000 +0200 +@@ -327,6 +327,8 @@ void CConn::beginRect(const Rect& r, uns + if (encoding != encodingCopyRect) { + lastServerEncoding = encoding; + } ++ if (encoding == pseudoEncodingDesktopSize) ++ setDesktopSize( r.width(), r.height() ); + } + + void CConn::endRect(const Rect& r, unsigned int encoding) diff --git a/tigervnc-rh212985.patch b/tigervnc-rh212985.patch new file mode 100644 index 0000000..3244f6c --- /dev/null +++ b/tigervnc-rh212985.patch @@ -0,0 +1,33 @@ +diff -up tightvnc-1.5.0-20081015svn3022/unix/vncserver.rh212985 tightvnc-1.5.0-20081015svn3022/unix/vncserver +--- tightvnc-1.5.0-20081015svn3022/unix/vncserver.rh212985 2008-10-23 13:03:57.000000000 +0200 ++++ tightvnc-1.5.0-20081015svn3022/unix/vncserver 2008-10-23 13:05:21.000000000 +0200 +@@ -161,11 +161,25 @@ $cmd .= " >> " . "edString($desktopL + # Run $cmd and record the process ID. + + $pidFile = "$vncUserDir/$host:$displayNumber.pid"; +-system("$cmd & echo \$! >$pidFile"); ++system( ++"rm -f $pidFile ++ $cmd & ++ PID_TEMP=\$! ++ PID_NUM=\$PID_TEMP ++ ++ # Give Xvnc a chance to start up ++ ++ sleep 3; ++ ++ if ps -p \$PID_NUM -o comm= | grep -q Xvnc; then ++ echo \$PID_NUM > $pidFile ++ fi" ++); + +-# Give Xvnc a chance to start up +- +-sleep(3); ++if (!(-e "$pidFile")) { ++ warn "Unable to start Xvnc, exiting\n"; ++ exit 2; ++} + + warn "\nNew '$desktopName' desktop is $host:$displayNumber\n\n"; + diff --git a/tigervnc-viewer-reparent.patch b/tigervnc-viewer-reparent.patch new file mode 100644 index 0000000..43950e6 --- /dev/null +++ b/tigervnc-viewer-reparent.patch @@ -0,0 +1,121 @@ +diff -up tightvnc-1.5.0-20081015svn3022/unix/tx/TXViewport.cxx.viewer-reparent tightvnc-1.5.0-20081015svn3022/unix/tx/TXViewport.cxx +--- tightvnc-1.5.0-20081015svn3022/unix/tx/TXViewport.cxx.viewer-reparent 2008-03-14 14:37:09.000000000 +0100 ++++ tightvnc-1.5.0-20081015svn3022/unix/tx/TXViewport.cxx 2008-10-23 13:11:39.000000000 +0200 +@@ -44,6 +44,21 @@ TXViewport::~TXViewport() + delete vScrollbar; + } + ++void TXViewport::reparent(long embed_window) ++{ ++ XReparentWindow(dpy, win(), (Window)embed_window, 0, 0); ++ XSelectInput(dpy, embed_window, child->eventMask); ++ if (!eventHandler) ++ this->setEventHandler(this); ++} ++ ++void TXViewport::handleEvent(TXWindow* w, XEvent* ev) ++{ ++ if (child && child->eventHandler) ++ ((TXEventHandler *)child->eventHandler)->handleEvent(child, ev); ++} ++ ++ + void TXViewport::setChild(TXWindow* child_) + { + child = child_; +diff -up tightvnc-1.5.0-20081015svn3022/unix/tx/TXViewport.h.viewer-reparent tightvnc-1.5.0-20081015svn3022/unix/tx/TXViewport.h +--- tightvnc-1.5.0-20081015svn3022/unix/tx/TXViewport.h.viewer-reparent 2008-03-14 14:37:09.000000000 +0100 ++++ tightvnc-1.5.0-20081015svn3022/unix/tx/TXViewport.h 2008-10-23 13:11:39.000000000 +0200 +@@ -32,8 +32,8 @@ + #include "TXWindow.h" + #include "TXScrollbar.h" + +-class TXViewport : public TXWindow, public TXScrollbarCallback, +- public rfb::Timer::Callback { ++class TXViewport : public TXWindow, public TXScrollbarCallback, ++ public TXEventHandler, public rfb::Timer::Callback { + public: + TXViewport(Display* dpy_, int width, int height, TXWindow* parent_=0); + virtual ~TXViewport(); +@@ -59,6 +59,12 @@ public: + // normally. + bool bumpScrollEvent(XMotionEvent* ev); + ++ // reparent the viewport into a new window ++ void reparent(long embed_window); ++ ++ // event handler ++ void handleEvent(TXWindow* w, XEvent* ev); ++ + private: + virtual void resizeNotify(); + virtual void scrollbarPos(int x, int y, TXScrollbar* sb); +diff -up tightvnc-1.5.0-20081015svn3022/unix/tx/TXWindow.h.viewer-reparent tightvnc-1.5.0-20081015svn3022/unix/tx/TXWindow.h +--- tightvnc-1.5.0-20081015svn3022/unix/tx/TXWindow.h.viewer-reparent 2006-05-18 13:08:21.000000000 +0200 ++++ tightvnc-1.5.0-20081015svn3022/unix/tx/TXWindow.h 2008-10-23 13:11:39.000000000 +0200 +@@ -183,6 +183,9 @@ public: + + Display* const dpy; + ++ TXEventHandler* eventHandler; ++ long eventMask; ++ + int xPad, yPad, bevel; + + private: +@@ -195,9 +198,7 @@ private: + TXWindow* parent; + Window win_; + int width_, height_; +- TXEventHandler* eventHandler; + TXDeleteWindowCallback* dwc; +- long eventMask; + XSizeHints sizeHints; + std::map selectionOwnTime; + std::map selectionOwner_; +diff -up tightvnc-1.5.0-20081015svn3022/unix/vncviewer/CConn.cxx.viewer-reparent tightvnc-1.5.0-20081015svn3022/unix/vncviewer/CConn.cxx +--- tightvnc-1.5.0-20081015svn3022/unix/vncviewer/CConn.cxx.viewer-reparent 2008-10-23 13:11:39.000000000 +0200 ++++ tightvnc-1.5.0-20081015svn3022/unix/vncviewer/CConn.cxx 2008-10-23 13:11:39.000000000 +0200 +@@ -647,10 +647,18 @@ void CConn::recreateViewport() + + void CConn::reconfigureViewport() + { ++ const char * par = embedParent.getValueStr(); + viewport->setMaxSize(cp.width, cp.height); + if (fullScreen) { + viewport->resize(DisplayWidth(dpy,DefaultScreen(dpy)), + DisplayHeight(dpy,DefaultScreen(dpy))); ++ } else if (strlen(par) != 0) { ++ XWindowAttributes win_attr; ++ Window w = strtol(par, (char **)NULL, 0); ++ ++ XGetWindowAttributes(dpy, w, &win_attr); ++ viewport->reparent(w); ++ viewport->resize(win_attr.width, win_attr.height); + } else { + int w = cp.width; + int h = cp.height; +diff -up tightvnc-1.5.0-20081015svn3022/unix/vncviewer/parameters.h.viewer-reparent tightvnc-1.5.0-20081015svn3022/unix/vncviewer/parameters.h +--- tightvnc-1.5.0-20081015svn3022/unix/vncviewer/parameters.h.viewer-reparent 2008-10-23 13:11:39.000000000 +0200 ++++ tightvnc-1.5.0-20081015svn3022/unix/vncviewer/parameters.h 2008-10-23 13:12:41.000000000 +0200 +@@ -42,6 +42,7 @@ extern rfb::IntParameter compressLevel; + extern rfb::BoolParameter noJpeg; + extern rfb::IntParameter qualityLevel; + extern rfb::BoolParameter passwdInput; ++extern rfb::StringParameter embedParent; + + extern char aboutText[]; + extern char* programName; +diff -up tightvnc-1.5.0-20081015svn3022/unix/vncviewer/vncviewer.cxx.viewer-reparent tightvnc-1.5.0-20081015svn3022/unix/vncviewer/vncviewer.cxx +--- tightvnc-1.5.0-20081015svn3022/unix/vncviewer/vncviewer.cxx.viewer-reparent 2008-10-23 13:11:39.000000000 +0200 ++++ tightvnc-1.5.0-20081015svn3022/unix/vncviewer/vncviewer.cxx 2008-10-23 13:12:59.000000000 +0200 +@@ -106,6 +106,9 @@ StringParameter displayname("display", " + + StringParameter via("via", "Gateway to tunnel via", ""); + ++/* Support for reparenting */ ++StringParameter embedParent("Parent", "X Window to use as a parent", ""); ++ + BoolParameter customCompressLevel("CustomCompressLevel", + "Use custom compression level. " + "Default if CompressLevel is specified.", false); diff --git a/tigervnc-xclients.patch b/tigervnc-xclients.patch new file mode 100644 index 0000000..eff6ca3 --- /dev/null +++ b/tigervnc-xclients.patch @@ -0,0 +1,13 @@ +--- vnc-4_1-unixsrc/unix/vncserver.xclients 2005-03-03 23:01:16.000000000 +0000 ++++ vnc-4_1-unixsrc/unix/vncserver 2005-03-03 23:02:26.000000000 +0000 +@@ -42,6 +42,10 @@ + + $defaultXStartup + = ("#!/bin/sh\n\n". ++ "# Uncomment the following two lines for normal desktop:\n". ++ "# unset SESSION_MANAGER\n". ++ "# exec /etc/X11/xinit/xinitrc\n\n". ++ "[ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup\n". + "[ -r \$HOME/.Xresources ] && xrdb \$HOME/.Xresources\n". + "xsetroot -solid grey\n". + "vncconfig -iconic &\n".