Author: baggins                      Date: Sun Oct 10 18:22:49 2010 GMT
Module: packages                      Tag: HEAD
---- Log message:
- fixes from fedora

---- Files affected:
packages/tigervnc:
   tigervnc-cookie.patch (NONE -> 1.1)  (NEW), tigervnc-ldnow.patch (NONE -> 
1.1)  (NEW), tigervnc-rh102434.patch (NONE -> 1.1)  (NEW), 
tigervnc-rh611677-generate_modkeymap-max_keys.patch (NONE -> 1.1)  (NEW), 
tigervnc-rh611677.patch (NONE -> 1.1)  (NEW), tigervnc-rh633931.patch (NONE -> 
1.1)  (NEW), tigervnc-viewer-reparent.patch (NONE -> 1.1)  (NEW)

---- Diffs:

================================================================
Index: packages/tigervnc/tigervnc-cookie.patch
diff -u /dev/null packages/tigervnc/tigervnc-cookie.patch:1.1
--- /dev/null   Sun Oct 10 20:22:50 2010
+++ packages/tigervnc/tigervnc-cookie.patch     Sun Oct 10 20:22:44 2010
@@ -0,0 +1,37 @@
+diff -up tigervnc-1.0.90-20091221svn3929/unix/vncserver.cookie 
tigervnc-1.0.90-20091221svn3929/unix/vncserver
+--- tigervnc-1.0.90-20091221svn3929/unix/vncserver.cookie      2009-11-12 
11:39:54.000000000 +0100
++++ tigervnc-1.0.90-20091221svn3929/unix/vncserver     2009-12-21 
16:15:01.907799091 +0100
+@@ -189,27 +189,12 @@ $vncPort = 5900 + $displayNumber;
+ $desktopLog = "$vncUserDir/$host:$displayNumber.log";
+ unlink($desktopLog);
+ 
+-# Make an X server cookie - use /dev/urandom on systems that have it,
+-# otherwise use perl's random number generator, seeded with the sum
+-# of the current time, our PID and part of the encrypted form of the password.
+-
+-my $cookie = "";
+-if (open(URANDOM, '<', '/dev/urandom')) {
+-  my $randata;
+-  if (sysread(URANDOM, $randata, 16) == 16) {
+-    $cookie = unpack 'h*', $randata;
+-  }
+-  close(URANDOM);
+-}
+-if ($cookie eq "") {
+-  srand(time+$$+unpack("L",`cat $vncUserDir/passwd`));
+-  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'};

================================================================
Index: packages/tigervnc/tigervnc-ldnow.patch
diff -u /dev/null packages/tigervnc/tigervnc-ldnow.patch:1.1
--- /dev/null   Sun Oct 10 20:22:50 2010
+++ packages/tigervnc/tigervnc-ldnow.patch      Sun Oct 10 20:22:44 2010
@@ -0,0 +1,12 @@
+diff -up tigervnc-1.0.90-20100721svn4113/unix/xserver/hw/vnc/Makefile.am.ldnow 
tigervnc-1.0.90-20100721svn4113/unix/xserver/hw/vnc/Makefile.am
+--- tigervnc-1.0.90-20100721svn4113/unix/xserver/hw/vnc/Makefile.am.ldnow      
2010-05-18 15:48:02.000000000 +0200
++++ tigervnc-1.0.90-20100721svn4113/unix/xserver/hw/vnc/Makefile.am    
2010-07-21 17:05:45.242942531 +0200
+@@ -50,7 +50,7 @@ libvnc_la_CPPFLAGS = $(XVNC_CPPFLAGS) -I
+       -I$(top_srcdir)/hw/xfree86/os-support/bus \
+       -I$(includedir)/pixman-1 -I$(includedir)
+ 
+-libvnc_la_LDFLAGS = -module -avoid-version
++libvnc_la_LDFLAGS = -module -avoid-version -Wl,-z,now
+ 
+ libvnc_la_LIBADD = libvnccommon.la $(COMMON_LIBS)
+ 

================================================================
Index: packages/tigervnc/tigervnc-rh102434.patch
diff -u /dev/null packages/tigervnc/tigervnc-rh102434.patch:1.1
--- /dev/null   Sun Oct 10 20:22:50 2010
+++ packages/tigervnc/tigervnc-rh102434.patch   Sun Oct 10 20:22:44 2010
@@ -0,0 +1,66 @@
+diff -up tigervnc-1.0.90-20100721svn4113/unix/vncviewer/CConn.cxx.102434 
tigervnc-1.0.90-20100721svn4113/unix/vncviewer/CConn.cxx
+--- tigervnc-1.0.90-20100721svn4113/unix/vncviewer/CConn.cxx.102434    
2010-07-20 17:07:44.000000000 +0200
++++ tigervnc-1.0.90-20100721svn4113/unix/vncviewer/CConn.cxx   2010-07-21 
17:02:09.900085594 +0200
+@@ -40,6 +40,8 @@
+ #include "ServerDialog.h"
+ #include "PasswdDialog.h"
+ #include "parameters.h"
++#include <string>
++#include <iostream>
+ 
+ using namespace rfb;
+ 
+@@ -214,6 +216,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(csecurity->getType());
+   const char* titlePrefix = _("VNC authentication");
+   unsigned int titleLen = strlen(titlePrefix) + strlen(secType) + 4;
+diff -up tigervnc-1.0.90-20100721svn4113/unix/vncviewer/parameters.h.102434 
tigervnc-1.0.90-20100721svn4113/unix/vncviewer/parameters.h
+--- tigervnc-1.0.90-20100721svn4113/unix/vncviewer/parameters.h.102434 
2009-03-23 17:49:47.000000000 +0100
++++ tigervnc-1.0.90-20100721svn4113/unix/vncviewer/parameters.h        
2010-07-21 16:55:44.414314911 +0200
+@@ -42,6 +42,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 tigervnc-1.0.90-20100721svn4113/unix/vncviewer/vncviewer.cxx.102434 
tigervnc-1.0.90-20100721svn4113/unix/vncviewer/vncviewer.cxx
+--- tigervnc-1.0.90-20100721svn4113/unix/vncviewer/vncviewer.cxx.102434        
2010-04-23 16:06:38.000000000 +0200
++++ tigervnc-1.0.90-20100721svn4113/unix/vncviewer/vncviewer.cxx       
2010-07-21 17:01:05.979161234 +0200
+@@ -59,7 +59,7 @@ IntParameter wmDecorationHeight("WMDecor
+ StringParameter passwordFile("PasswordFile",
+                              "Password file for VNC authentication", "");
+ AliasParameter passwd("passwd", "Alias for PasswordFile", &passwordFile);
+-
++BoolParameter passwdInput("passwdInput", "Gets password from stdin", false);
+ BoolParameter useLocalCursor("UseLocalCursor",
+                              "Render the mouse cursor locally", true);
+ BoolParameter dotWhenNoCursor("DotWhenNoCursor",
+diff -up tigervnc-1.0.90-20100721svn4113/unix/vncviewer/vncviewer.man.102434 
tigervnc-1.0.90-20100721svn4113/unix/vncviewer/vncviewer.man
+--- tigervnc-1.0.90-20100721svn4113/unix/vncviewer/vncviewer.man.102434        
2009-10-07 17:13:00.000000000 +0200
++++ tigervnc-1.0.90-20100721svn4113/unix/vncviewer/vncviewer.man       
2010-07-21 16:55:44.414314911 +0200
+@@ -119,6 +119,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

================================================================
Index: packages/tigervnc/tigervnc-rh611677-generate_modkeymap-max_keys.patch
diff -u /dev/null 
packages/tigervnc/tigervnc-rh611677-generate_modkeymap-max_keys.patch:1.1
--- /dev/null   Sun Oct 10 20:22:50 2010
+++ packages/tigervnc/tigervnc-rh611677-generate_modkeymap-max_keys.patch       
Sun Oct 10 20:22:44 2010
@@ -0,0 +1,60 @@
+From 3fae47581a47613f1117b8794ae37b75ace73f3e Mon Sep 17 00:00:00 2001
+From: Adam Tkac <[email protected]>
+Date: Tue, 24 Aug 2010 17:21:30 +0200
+Subject: [PATCH] Return Success from generate_modkeymap() when 
max_keys_per_mod is zero.
+
+max_keys_per_mod equal to zero is a valid situation so generate_modkeymap
+should not return BadAlloc in this case.
+
+Signed-off-by: Adam Tkac <[email protected]>
+---
+ dix/inpututils.c |   24 +++++++++++++-----------
+ 1 files changed, 13 insertions(+), 11 deletions(-)
+
+diff --git a/dix/inpututils.c b/dix/inpututils.c
+index 8ec80b5..6693c67 100644
+--- a/dix/inpututils.c
++++ b/dix/inpututils.c
+@@ -286,7 +286,7 @@ int generate_modkeymap(ClientPtr client, DeviceIntPtr dev,
+ {
+     CARD8 keys_per_mod[8];
+     int max_keys_per_mod;
+-    KeyCode *modkeymap;
++    KeyCode *modkeymap = NULL;
+     int i, j, ret;
+ 
+     ret = XaceHook(XACE_DEVICE_ACCESS, client, dev, DixGetAttrAccess);
+@@ -310,18 +310,20 @@ int generate_modkeymap(ClientPtr client, DeviceIntPtr 
dev,
+         }
+     }
+ 
+-    modkeymap = calloc(max_keys_per_mod * 8, sizeof(KeyCode));
+-    if (!modkeymap)
+-        return BadAlloc;
++    if (max_keys_per_mod != 0) {
++        modkeymap = calloc(max_keys_per_mod * 8, sizeof(KeyCode));
++        if (!modkeymap)
++            return BadAlloc;
+ 
+-    for (i = 0; i < 8; i++)
+-        keys_per_mod[i] = 0;
++        for (i = 0; i < 8; i++)
++            keys_per_mod[i] = 0;
+ 
+-    for (i = 8; i < MAP_LENGTH; i++) {
+-        for (j = 0; j < 8; j++) {
+-            if (dev->key->xkbInfo->desc->map->modmap[i] & (1 << j)) {
+-                modkeymap[(j * max_keys_per_mod) + keys_per_mod[j]] = i;
+-                keys_per_mod[j]++;
++        for (i = 8; i < MAP_LENGTH; i++) {
++            for (j = 0; j < 8; j++) {
++                if (dev->key->xkbInfo->desc->map->modmap[i] & (1 << j)) {
++                    modkeymap[(j * max_keys_per_mod) + keys_per_mod[j]] = i;
++                    keys_per_mod[j]++;
++                }
+             }
+         }
+     }
+-- 
+1.7.2.2
+

================================================================
Index: packages/tigervnc/tigervnc-rh611677.patch
diff -u /dev/null packages/tigervnc/tigervnc-rh611677.patch:1.1
--- /dev/null   Sun Oct 10 20:22:50 2010
+++ packages/tigervnc/tigervnc-rh611677.patch   Sun Oct 10 20:22:44 2010
@@ -0,0 +1,98 @@
+diff -up tigervnc-1.0.90-20100420svn4030/unix/xserver/hw/vnc/Input.cc.rh611677 
tigervnc-1.0.90-20100420svn4030/unix/xserver/hw/vnc/Input.cc
+--- tigervnc-1.0.90-20100420svn4030/unix/xserver/hw/vnc/Input.cc.rh611677      
2010-08-24 17:40:00.511860227 +0200
++++ tigervnc-1.0.90-20100420svn4030/unix/xserver/hw/vnc/Input.cc       
2010-08-24 17:49:23.169007409 +0200
+@@ -322,6 +322,11 @@ public:
+                       return;
+               }
+ 
++              if (maxKeysPerMod == 0) {
++                      vlog.debug("Keyboard has no modifiers");
++                      return;
++              }
++
+               keycode = modmap[modIndex * maxKeysPerMod];
+               xfree(modmap);
+ #else
+@@ -355,6 +360,11 @@ public:
+                       vlog.error("generate_modkeymap failed");
+                       return;
+               }
++
++              if (maxKeysPerMod == 0) {
++                      vlog.debug("Keyboard has no modifiers");
++                      return;
++              }
+ #else
+               maxKeysPerMod = keyc->maxKeysPerModifier;
+ #endif
+@@ -530,6 +540,9 @@ void InputDevice::keyEvent(rdr::U32 keys
+               return;
+       }
+ 
++      if (maxKeysPerMod == 0)
++              vlog.debug("Keyboard has no modifiers");
++
+       state = XkbStateFieldFromRec(&keyc->xkbInfo->state);
+ #else
+       keyc = keyboardDev->key;
+@@ -565,11 +578,13 @@ void InputDevice::keyEvent(rdr::U32 keys
+ ModeSwitchFound:
+ 
+       int col = 0;
+-      if ((state & (1 << ShiftMapIndex)) != 0)
+-              col |= 1;
+-      if (modeSwitchMapIndex != 0 &&
+-          ((state & (1 << modeSwitchMapIndex))) != 0)
+-              col |= 2;
++      if (maxKeysPerMod != 0) {
++              if ((state & (1 << ShiftMapIndex)) != 0)
++                      col |= 1;
++              if (modeSwitchMapIndex != 0 &&
++                  ((state & (1 << modeSwitchMapIndex))) != 0)
++                      col |= 2;
++      }
+ 
+       int kc = KeysymToKeycode(keymap, keysym, &col);
+ 
+@@ -581,7 +596,8 @@ ModeSwitchFound:
+        * We never get ISO_Left_Tab here because it's already been translated
+        * in VNCSConnectionST.
+        */
+-      if (keysym == XK_Tab && ((state & (1 << ShiftMapIndex))) != 0)
++      if (maxKeysPerMod != 0 && keysym == XK_Tab &&
++          ((state & (1 << ShiftMapIndex))) != 0)
+               col |= 1;
+ 
+       if (kc == 0) {
+@@ -662,18 +678,20 @@ ModeSwitchFound:
+               }
+       }
+ 
+-      ModifierState shift(keyboardDev, ShiftMapIndex);
+-      ModifierState modeSwitch(keyboardDev, modeSwitchMapIndex);
+-      if (down) {
+-              if (col & 1)
+-                      shift.press();
+-              else
+-                      shift.release();
+-              if (modeSwitchMapIndex) {
+-                      if (col & 2)
+-                              modeSwitch.press();
++      if (maxKeysPerMod != 0) {
++              ModifierState shift(keyboardDev, ShiftMapIndex);
++              ModifierState modeSwitch(keyboardDev, modeSwitchMapIndex);
++              if (down) {
++                      if (col & 1)
++                              shift.press();
+                       else
+-                              modeSwitch.release();
++                              shift.release();
++                      if (modeSwitchMapIndex) {
++                              if (col & 2)
++                                      modeSwitch.press();
++                              else
++                                      modeSwitch.release();
++                      }
+               }
+       }
+ 

================================================================
Index: packages/tigervnc/tigervnc-rh633931.patch
diff -u /dev/null packages/tigervnc/tigervnc-rh633931.patch:1.1
--- /dev/null   Sun Oct 10 20:22:50 2010
+++ packages/tigervnc/tigervnc-rh633931.patch   Sun Oct 10 20:22:44 2010
@@ -0,0 +1,87 @@
+diff -up tigervnc-1.0.90-20100813svn4123/unix/xserver/hw/vnc/Input.cc.rh633931 
tigervnc-1.0.90-20100813svn4123/unix/xserver/hw/vnc/Input.cc
+--- tigervnc-1.0.90-20100813svn4123/unix/xserver/hw/vnc/Input.cc.rh633931      
2010-09-16 11:29:33.670000097 +0200
++++ tigervnc-1.0.90-20100813svn4123/unix/xserver/hw/vnc/Input.cc       
2010-09-16 12:59:31.530002411 +0200
+@@ -271,6 +271,19 @@ void InputDevice::initInputDevice(void)
+ #endif
+ }
+ 
++static inline void pressKey(DeviceIntPtr dev, int kc, bool down, const char 
*msg)
++{
++      int action;
++      unsigned int n;
++
++      if (msg != NULL)
++              vlog.debug("%s %d %s", msg, kc, down ? "down" : "up");
++
++      action = down ? KeyPress : KeyRelease;
++      n = GetKeyboardEvents(eventq, dev, action, kc);
++      enqueueEvents(dev, n);
++}
++
+ #define IS_PRESSED(keyc, keycode) \
+       ((keyc)->down[(keycode) >> 3] & (1 << ((keycode) & 7)))
+ 
+@@ -294,7 +307,7 @@ public:
+       ~ModifierState()
+       {
+               for (int i = 0; i < nKeys; i++)
+-                      generateXKeyEvent(keys[i], !pressed);
++                      pressKey(dev, keys[i], !pressed, "fake keycode");
+               delete [] keys;
+       }
+ 
+@@ -389,22 +402,10 @@ private:
+               if (keycode) {
+                       if (!keys) keys = new int[maxKeysPerMod];
+                       keys[nKeys++] = keycode;
+-                      generateXKeyEvent(keycode, down);
++                      pressKey(dev, keycode, down, "fake keycode");
+               }
+       }
+ 
+-      void generateXKeyEvent(int keycode, bool down)
+-      {
+-              int n, action;
+-
+-              action = down ? KeyPress : KeyRelease;
+-              n = GetKeyboardEvents(eventq, dev, action, keycode);
+-              enqueueEvents(dev, n);
+-
+-              vlog.debug("fake keycode %d %s", keycode,
+-                         down ? "down" : "up");
+-      }
+-
+       int modIndex;
+       int nKeys;
+       int *keys;
+@@ -503,8 +504,8 @@ void InputDevice::keyEvent(rdr::U32 keys
+       KeyCode minKeyCode, maxKeyCode;
+       KeyCode *modmap = NULL;
+       int mapWidth;
+-      unsigned int i, n;
+-      int j, k, action, state, maxKeysPerMod;
++      unsigned int i;
++      int j, k, state, maxKeysPerMod;
+ 
+       initInputDevice();
+ 
+@@ -691,12 +692,14 @@ ModeSwitchFound:
+                                       modeSwitch.release();
+                       }
+               }
+-      }
++              /*
++               * Ensure ModifierState objects are not destroyed before
++               * pressKey call, otherwise fake modifier keypress can be lost.
++               */
++              pressKey(keyboardDev, kc, down, "keycode");
++      } else
++              pressKey(keyboardDev, kc, down, "keycode");
+ 
+-      vlog.debug("keycode %d %s", kc, down ? "down" : "up");
+-      action = down ? KeyPress : KeyRelease;
+-      n = GetKeyboardEvents(eventq, keyboardDev, action, kc);
+-      enqueueEvents(keyboardDev, n);
+ 
+         FREE_MAPS;
+       

================================================================
Index: packages/tigervnc/tigervnc-viewer-reparent.patch
diff -u /dev/null packages/tigervnc/tigervnc-viewer-reparent.patch:1.1
--- /dev/null   Sun Oct 10 20:22:50 2010
+++ packages/tigervnc/tigervnc-viewer-reparent.patch    Sun Oct 10 20:22:44 2010
@@ -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<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);
================================================================
_______________________________________________
pld-cvs-commit mailing list
[email protected]
http://lists.pld-linux.org/mailman/listinfo/pld-cvs-commit

Reply via email to