rpms/tightvnc/devel tightvnc-102434.patch, NONE, 1.1 tightvnc-bounds.patch, NONE, 1.1 tightvnc-clipboard.patch, NONE, 1.1 tightvnc-cookie.patch, NONE, 1.1 tightvnc-manminor.patch, NONE, 1.1 tightvnc-newfbsize.patch, NONE, 1.1 tightvnc-rh212985.patch, NONE, 1.1 tightvnc-viewer-reparent.patch, NONE, 1.1 tightvnc-xclients.patch, NONE, 1.1 tightvnc.spec, 1.1, 1.2

Adam Tkac atkac at fedoraproject.org
Thu Oct 23 11:36:22 UTC 2008


Author: atkac

Update of /cvs/pkgs/rpms/tightvnc/devel
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv28232

Modified Files:
	tightvnc.spec 
Added Files:
	tightvnc-102434.patch tightvnc-bounds.patch 
	tightvnc-clipboard.patch tightvnc-cookie.patch 
	tightvnc-manminor.patch tightvnc-newfbsize.patch 
	tightvnc-rh212985.patch tightvnc-viewer-reparent.patch 
	tightvnc-xclients.patch 
Log Message:
- ported all needed patches from vnc devel branch except IPv6 patch


tightvnc-102434.patch:

--- NEW FILE tightvnc-102434.patch ---
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 <string>
+#include <iostream>
 
 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

tightvnc-bounds.patch:

--- NEW FILE tightvnc-bounds.patch ---
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()

tightvnc-clipboard.patch:

--- NEW FILE tightvnc-clipboard.patch ---
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");
 

tightvnc-cookie.patch:

--- NEW FILE tightvnc-cookie.patch ---
--- 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'};

tightvnc-manminor.patch:

--- NEW FILE tightvnc-manminor.patch ---
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

tightvnc-newfbsize.patch:

--- NEW FILE tightvnc-newfbsize.patch ---
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)

tightvnc-rh212985.patch:

--- NEW FILE tightvnc-rh212985.patch ---
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 .= " >> " . &quotedString($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;
+}
 
 warn "\nNew '$desktopName' desktop is $host:$displayNumber\n\n";
 

tightvnc-viewer-reparent.patch:

--- NEW FILE tightvnc-viewer-reparent.patch ---
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<Atom,Time> selectionOwnTime;
   std::map<Atom,bool> 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);

tightvnc-xclients.patch:

--- NEW FILE tightvnc-xclients.patch ---
--- 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".


Index: tightvnc.spec
===================================================================
RCS file: /cvs/pkgs/rpms/tightvnc/devel/tightvnc.spec,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- tightvnc.spec	17 Oct 2008 12:12:57 -0000	1.1
+++ tightvnc.spec	23 Oct 2008 11:36:22 -0000	1.2
@@ -4,7 +4,7 @@
 
 Name:		tightvnc
 Version:	1.5.0
-Release:	0.7.%{releasetag}%{?dist}
+Release:	0.8.%{releasetag}%{?dist}
 Summary:	A TightVNC remote display system
 
 Group:		User Interface/Desktops
@@ -40,6 +40,16 @@
 Provides:	vnc = 4.1.2-36, vnc-libs = 4.1.2-36
 Obsoletes:	vnc < 4.1.2-36, vnc-libs < 4.1.2-36
 
+Patch0:		tightvnc-102434.patch
+Patch1:		tightvnc-bounds.patch
+Patch2:		tightvnc-xclients.patch
+Patch3:		tightvnc-clipboard.patch
+Patch4:		tightvnc-cookie.patch
+Patch5:		tightvnc-manminor.patch
+Patch6:		tightvnc-newfbsize.patch
+Patch7:		tightvnc-rh212985.patch
+Patch8:		tightvnc-viewer-reparent.patch
+
 %description
 Virtual Network Computing (VNC) is a remote display system which
 allows you to view a computing 'desktop' environment not only on the
@@ -85,12 +95,22 @@
 patch -p1 -b -fuzz=0 --suffix .vnc < ../xserver.patch
 popd
 
+%patch0 -p1 -b .102434
+%patch1 -p1 -b .bounds
+%patch2 -p1 -b .xclients
+%patch3 -p1 -b .clipboard
+%patch4 -p1 -b .cookie
+%patch5 -p1 -b .manminor
+%patch6 -p1 -b .newfbsize
+%patch7 -p1 -b .rh212985
+%patch8 -p1 -b .viewer-reparent
+
 # Use newer gettext
 sed -i 's/AM_GNU_GETTEXT_VERSION.*/AM_GNU_GETTEXT_VERSION([0.17])/' \
 	unix/configure.ac
 
 %build
-export CFLAGS="$RPM_OPT_FLAGS -O0"
+export CFLAGS="$RPM_OPT_FLAGS"
 export CXXFLAGS="$CFLAGS"
 
 pushd unix
@@ -216,6 +236,9 @@
 %{_libdir}/xorg/modules/extensions/libvnc.so
 
 %changelog
+* Thu Oct 23 2008 Adam Tkac <atkac redhat com> 1.5.0-0.8.20081015svn3022
+- ported all needed patches from vnc devel branch except IPv6 patch
+
 * Wed Oct 15 2008 Adam Tkac <atkac redhat com> 1.5.0-0.7.20081015svn3022
 - r3022 - xserver.patch change was incomplete
 




More information about the scm-commits mailing list