Here's the patch. I'm surprised I haven't seen any response to this message. Maybe I'm the only one who uses the -query option??

        -Kyle

-------------

--- vncserver   Tue Jan 25 16:28:29 2005
+++ vncserver.new       Tue Jan 25 16:25:08 2005
@@ -54,7 +54,8 @@
 # Check command line options


&ParseOptions("-geometry",1,"-depth",1,"-pixelformat",1,"-name",1,"-kill",1, - "-help",0,"-h",0,"--help",0); + "-help",0,"-h",0,"--help",0,"-query",1,"-broadcast",0, + "-indirect",1);

 &Usage() if ($opt{'-help'} || $opt{'-h'} || $opt{'--help'});

@@ -147,6 +148,9 @@
 $cmd .= " -rfbwait 30000";
 $cmd .= " -rfbauth $vncUserDir/passwd";
 $cmd .= " -rfbport $vncPort";
+$cmd .= " -query $opt{'-query'}" if ($opt{'-query'});
+$cmd .= " -indirect $opt{'-indirect'}" if ($opt{'-indirect'});
+$cmd .= " -broadcast" if ($opt{'-broadcast'});

 # Add font path and color database stuff here, e.g.:
 #
@@ -157,6 +161,7 @@
 foreach $arg (@ARGV) {
     $cmd .= " " . &quotedString($arg);
 }
+
 $cmd .= " >> " . &quotedString($desktopLog) . " 2>&1";

 # Run $cmd and record the process ID.
@@ -168,36 +173,38 @@

 sleep(3);

-warn "\nNew '$desktopName' desktop is $host:$displayNumber\n\n";
+warn "\nNew '$desktopName' desktop is $host:$displayNumber\n";
+warn "Log file is $desktopLog\n\n";

-# Create the user's xstartup script if necessary.
+if ( !($opt{'-broadcast'} || $opt{'-indirect'} || $opt{'-query'})) {

-if (!(-e "$vncUserDir/xstartup")) {
- warn "Creating default startup script $vncUserDir/xstartup\n";
- open(XSTARTUP, ">$vncUserDir/xstartup");
- print XSTARTUP $defaultXStartup;
- close(XSTARTUP);
- chmod 0755, "$vncUserDir/xstartup";
-}
+ # Create the user's xstartup script if necessary.
+ if (!(-e "$vncUserDir/xstartup")) {
+ warn "Creating default startup script $vncUserDir/xstartup\n";
+ open(XSTARTUP, ">$vncUserDir/xstartup");
+ print XSTARTUP $defaultXStartup;
+ close(XSTARTUP);
+ chmod 0755, "$vncUserDir/xstartup";
+ }


-# Run the X startup script.
+    # Run the X startup script.

-warn "Starting applications specified in $vncUserDir/xstartup\n";
-warn "Log file is $desktopLog\n\n";
+ warn "Starting applications specified in $vncUserDir/xstartup\n\n";


-# If the unix domain socket exists then use that (DISPLAY=:n) otherwise use
-# TCP (DISPLAY=host:n)
+ # If the unix domain socket exists then use that (DISPLAY=:n) otherwise use+ # TCP (DISPLAY=host:n)


-if (-e "/tmp/.X11-unix/X$displayNumber" ||
-    -e "/usr/spool/sockets/X11/$displayNumber")
-{
-    $ENV{DISPLAY}= ":$displayNumber";
-} else {
-    $ENV{DISPLAY}= "$host:$displayNumber";
-}
-$ENV{VNCDESKTOP}= $desktopName;
+    if (-e "/tmp/.X11-unix/X$displayNumber" ||
+        -e "/usr/spool/sockets/X11/$displayNumber")
+    {
+        $ENV{DISPLAY}= ":$displayNumber";
+    } else {
+        $ENV{DISPLAY}= "$host:$displayNumber";
+    }
+    $ENV{VNCDESKTOP}= $desktopName;

-system("$vncUserDir/xstartup >> " . &quotedString($desktopLog) . " 2>&1 &");
+ system("$vncUserDir/xstartup >> " . &quotedString($desktopLog) . " 2>&1 &");
+}


 exit;



--
                             _
-------------------------ooO( )Ooo--------------------------------
Kyle J. McDonald           (o o)          Systems Support Engineer
Sun Microsystems Inc.      |||||             [EMAIL PROTECTED]
1 Network Drive                   \\\//      voice: (781) 442-2184
Burlington, MA 01803              (o o)        fax: (781) 442-1542
--------------------------------ooO(_)Ooo-------------------------
_______________________________________________
VNC-List mailing list
VNC-List@realvnc.com
To remove yourself from the list visit:
http://www.realvnc.com/mailman/listinfo/vnc-list

Reply via email to