Commit 5764cd3f authored by runge's avatar runge

x11vnc: Fix problems in --without-x builds. Fix crash

with -QD query for dbus info.  Adjust window size for
small screens in -gui.  Improve F1 help for xdm, etc.
include ssvnc 1.0.25 source.
parent 018f152b
2009-12-28 Karl Runge <runge@karlrunge.com>
* x11vnc: Fix problems in --without-x builds. Fix crash
with -QD query for dbus info. Adjust window size for
small screens in -gui. Improve F1 help for xdm, etc.
include ssvnc 1.0.25 source.
2009-12-24 Karl Runge <runge@karlrunge.com>
* x11vnc: prepare_x11vnc_dist.sh for 0.9.10. -xdummy_xvfb,
-svc_xdummy_xvfb and -create_x shorthand. lxde session.
......
This diff is collapsed.
......@@ -563,6 +563,9 @@ static void be_helper_pid(char *dpy_str) {
if (ms < 50) ms = 50;
#if NO_X11
fprintf(stderr, "be_helper_pid: not compiled with X11.\n");
#else
dpy = XOpenDisplay(dpy_str);
ticker_atom = XInternAtom(dpy, ticker_atom_str, False);
......@@ -583,6 +586,7 @@ static void be_helper_pid(char *dpy_str) {
}
}
}
#endif
exit(0);
}
......@@ -895,7 +899,7 @@ static void delete_win(Window win) {
static void recurse_search(int level, int level_max, Window top, Window app, int *nw) {
Window w, r, parent, *list = NULL;
unsigned int nchild;
int ok;
int ok = 0;
if (appshare_debug > 1) {
fprintf(stderr, "level: %d level_max: %d top: 0x%lx app: 0x%lx\n", level, level_max, top, app);
......@@ -904,6 +908,7 @@ static void recurse_search(int level, int level_max, Window top, Window app, int
return;
}
#if !NO_X11
ok = XQueryTree(dpy, top, &r, &parent, &list, &nchild);
if (ok) {
int i;
......@@ -930,6 +935,7 @@ static void recurse_search(int level, int level_max, Window top, Window app, int
if (list) {
XFree(list);
}
#endif
}
static void add_app(Window app) {
......
......@@ -652,7 +652,8 @@ if [ -e "$xserver_path" -a "X$root" = "X" -a "X$runit" != "X" ]; then
warn ""
warn "Please restart Xdummy now."
exit 0
elif [ ! -O $new ]; then
fi
if [ ! -O $new ]; then
warn "file \"$new\" not owned by us!"
ls -l $new
exit 1
......
......@@ -17,6 +17,7 @@ SYNOPSIS
ssvnc [host][:display]
ssvnc [saved-profile-name]
ssvnc [options] [host-or-profile]
ssvnc -cmd [ssvnc_cmd-args]
ssvnc --help
DESCRIPTION
......@@ -33,6 +34,12 @@ OPTIONS
--help Starts up the GUI as though the 'Help' button was pressed to
show the main Help panel.
-cmd [ssvnc_cmd-args]
Launch the ssvnc_cmd utility command directly (no GUI) with the
given arguments (for use when ssvnc_cmd is not in one's PATH.)
If neither ssvnc_cmd nor ssvncviewer is in PATH, one can launch
the viewer directly via: ssvnc -cmd -viewer [viewer-args]
-profiles
List the saved SSVNC profiles you have created. A profile is a
destination host with specific parameter settings.
......@@ -67,7 +74,8 @@ OPTIONS
present. You can toggle the mode with Ctrl-E. Same as
SSVNC_DISABLE_ENCRYPTION_BUTTON=1. Or noenc=1 in ~/.ssvncrc.
Selecting no encryption is the same as the vnc:// and Vnc://
prefixes described below. -enc implies the opposite.
prefixes described below. The -noenc mode is now the default,
use -enc or noenc=0 for the opposite behavior.
-killstunnel
On Windows, automatically terminate the STUNNEL process when the
......@@ -271,7 +279,7 @@ if [ -f "$dir/util/ultraftp.jar" ]; then
export SSVNC_ULTRA_FTP_JAR
fi
if [ "X$1" = "X-cmd" ]; then
if [ "X$1" = "X-cmd" -o "X$1" = "X--cmd" ]; then
shift
exec ssvnc_cmd "$@"
elif [ "X$WISH" = "Xwish" ]; then
......
......@@ -25,13 +25,16 @@
#
# ssvnc_cmd [ss_vncviewer-args] hostname:N [vncviewer-args]
#
# if, instead, this script is named "tightvncviewer" it calls the
# vncviewer directly and must be invoked as:
# if, instead, this script is named "tightvncviewer" or "-viewer" is the
# first argument it calls the vncviewer directly (there is no encryption)
# and must be invoked as:
#
# tightvncviewer [vncviewer-args] hostname:N
# or
# ssvnc_cmd -viewer [vncviewer-args] hostname:N
#
# In both cases, "hostname:N" is the host and VNC display to connect to,
# e.g. snoopy:0
# e.g. snoopy:0. (-listen N and -appshare N modes works too.)
#
# See the script util/ss_vncviewer for details about its arguments:
#
......@@ -240,6 +243,15 @@ if [ "X$1" = "X-ssl" ]; then
base="ssvnc_cmd"
fi
do_viewer_directly=""
if [ "X$1" = "X-viewer" ]; then
do_viewer_directly=1
shift
fi
if [ "X$base" = "Xtightvncviewer" ]; then
do_viewer_directly=1
fi
# If ours (and not cotvnc), force the use of tight encoding for localhost
# redir connection:
#
......@@ -260,13 +272,13 @@ if [ $use_ours = 1 ]; then
fi
fi
if [ "X$base" = "Xtightvncviewer" ]; then
if [ "X$do_viewer_directly" = "X1" ]; then
$VNCVIEWERCMD -encodings 'copyrect tight zrle zlib hextile' "$@"
else
ss_vncviewer "$@" -encodings 'copyrect tight zrle zlib hextile'
fi
else
if [ "X$base" = "Xtightvncviewer" ]; then
if [ "X$do_viewer_directly" = "X1" ]; then
$VNCVIEWERCMD "$@"
else
ss_vncviewer "$@"
......
......@@ -2,13 +2,13 @@
.\" ** The above line should force tbl to be a preprocessor **
.\" Man page for the SSVNC vncviewer
.\"
.\" Copyright (C) 2006-2008 Karl J. Runge <runge@karlrunge.com>
.\" Copyright (C) 2006-2009 Karl J. Runge <runge@karlrunge.com>
.\"
.\" You may distribute under the terms of the GNU General Public
.\" License as specified in the file LICENCE.TXT that comes with the
.\" TightVNC distribution.
.\"
.TH ssvnc 1 "September 2009" "" "SSVNC"
.TH ssvnc 1 "December 2009" "" "SSVNC"
.SH NAME
ssvnc \- a GUI wrapper for SSL and SSH VNC connections.
.SH SYNOPSIS
......@@ -24,6 +24,10 @@ ssvnc \- a GUI wrapper for SSL and SSH VNC connections.
.RI [\| options \|]\ [\| host-or-profile \]
.br
.B ssvnc
.IR \-cmd
.RI [\| ssvnc_cmd-args \|]
.br
.B ssvnc
.IR \--help
.br
.SH DESCRIPTION
......@@ -47,10 +51,10 @@ Or supply user@hostname:display and click on the "Use SSH" option, then
press the "Connect" button to connect to the server via an SSH tunnel.
E.g. "fred@far-away.east:0".
As an easter egg, we note it is also possible to disable the use of SSL/SSH
Note it is also possible to disable the use of SSL/SSH
encryption tunnels by using a vnc:// or Vnc:// prefix before
host:display. Shift+Ctrl-E is a short-cut to add/remove it.
See also the \fB-noenc\fR option below.
See also the \fB-noenc\fR option below for the 'No Encryption' button.
Normally you do not specify any command line options. You simply
run \fBssvnc\fR and use the GUI that starts up.
......@@ -70,6 +74,12 @@ See below and the application Help for more information on the modes.
You can also place certain settings in your ~/.ssvncrc, see the
SSVNC Help panel ('Tips') for more info.
The \fB-cmd\fR option does not start the GUI, it runs the command
line utility \fBssvnc_cmd\fR directly with the given arguments.
\fBssvnc_cmd\fR can launch the viewer directly (\fB-viewer ...\fR)
or, by default, the \fBss_vncviewer\fR SSL/SSH tunnel wrapper script.
See its help output for more information.
There are also some command line options described as follows.
.SH OPTIONS
.TP
......@@ -80,6 +90,12 @@ Prints out to the terminal a brief description and the options.
Starts up the GUI as though the 'Help' button was pressed to show the
main Help panel.
.TP
\fB\-cmd\fR \fI[ssvnc_cmd-args]\fR
Launch the ssvnc_cmd utility command directly (no GUI) with the given
arguments (for use when ssvnc_cmd is not in one's PATH.) If neither
ssvnc_cmd nor ssvncviewer is in PATH, one can launch the viewer
directly via: ssvnc -cmd -viewer [viewer-args]
.TP
\fB\-profiles\fR
List the saved SSVNC profiles you have created. A profile
is a destination host with specific parameter settings.
......@@ -122,7 +138,8 @@ Start off in a mode where a 'No Encryption' check button is present.
You can toggle the mode with Ctrl-E.
Same as SSVNC_DISABLE_ENCRYPTION_BUTTON=1. Or \fInoenc=1\fR in ~/.ssvncrc.
Selecting no encryption is the same as the vnc:// and Vnc:// prefixes
described below. \fB-enc\fR implies the opposite.
described below. The \fB\-noenc\fR mode is now the default, use \fB-enc\fR
or \fInoenc=0\fR for the opposite behavior.
.TP
\fB\-killstunnel\fR
On Windows, automatically terminate the STUNNEL process when the viewer
......
......@@ -11,7 +11,7 @@
.\" License as specified in the file LICENCE.TXT that comes with the
.\" TightVNC distribution.
.\"
.TH ssvncviewer 1 "September 2009" "" "SSVNC"
.TH ssvncviewer 1 "December 2009" "" "SSVNC"
.SH NAME
ssvncviewer \- an X viewer client for VNC
.SH SYNOPSIS
......@@ -465,6 +465,18 @@ as possible instead of waiting until the end of the current
framebuffer update coming in. Helps 'pipeline' the updates.
This is currently the default, use \fB-nopipeline\fR to disable.
.TP
\fB\-appshare\fR
Enable features for use with x11vnc's \fB\-appshare\fR mode where
instead of sharing the full desktop only the application's
windows are shared. Viewer multilisten mode is used to
create the multiple windows: \fB\-multilisten\fR is implied.
See 'x11vnc \fB\-appshare\fR \fB\-help\fR' more information on the mode.
Features enabled in the viewer under \fB\-appshare\fR are:
Minimum extra text in the title, auto \fB\-ycrop\fR is disabled,
x11vnc \fB\-remote_prefix\fR X11VNC_APPSHARE_CMD: message channel,
x11vnc initial window position hints. See also Escape Keys
below for additional key and mouse bindings.
.TP
\fB\-escape \fR\fIstr\fR
This sets the 'Escape Keys' modifier sequence and enables
escape keys mode. When the modifier keys escape sequence
......@@ -511,6 +523,18 @@ Clicking Mouse Button3 brings up the Popup Menu.
The above mappings are \fBalways\fR active in ViewOnly mode, unless you set
the Escape Keys value to 'never'.
x11vnc -appshare hot-keys: x11vnc has a simple application sharing mode
that enables the viewer-side to move, resize, or raise the remote toplevel
windows. To enable it, hold down Shift + the Escape Keys and press these:
Arrow keys: move the remote window around in its desktop.
PageUp/PageDn/Home/End: resize the remote window.
+/-: raise or lower the remote window.
M or Button1 move win to local position; D or Button3: delete remote win.
If the Escape Keys value below is set to 'default' then a default list of
of modifier keys is used. For Unix it is: Alt_L,Super_L and for MacOSX it
is Control_L,Meta_L. Note: the Super_L key usually has a Windows(TM) Flag
......
......@@ -5920,7 +5920,9 @@ char *process_remote_cmd(char *cmd, int stringonly) {
grab_state(&ptr_grabbed, &kbd_grabbed);
snprintf(buf, bufn, "aro=%s:%d,%d", p, ptr_grabbed, kbd_grabbed);
if (dpy) {
rfbLog("remote_cmd: ptr,kbd: %s\n", buf);
}
goto qry;
}
......
......@@ -561,6 +561,9 @@ char *dbus_session(void) {
if (dbus_env != NULL && strlen(dbus_env) > 0) {
return "";
}
if (!dpy) {
return "";
}
#if NO_X11
return "";
#else
......
......@@ -2532,7 +2532,7 @@ proc see_if_ok {query item expected} {
}
proc get_default_vars {} {
global default_var
global default_var env
set qry [all_query_vars]
......@@ -2550,6 +2550,11 @@ proc get_default_vars {} {
if {$i > 50} {
set qargs [list "-QD" $q]
set a [run_remote_cmd $qargs]
if [info exists env(TKX11VNC_PRINT_ALL_QD)] {
puts $q
puts $a
puts "---------------"
}
if {$all != ""} {
append all ","
}
......@@ -2561,6 +2566,11 @@ proc get_default_vars {} {
if {$q != ""} {
set qargs [list "-QD" $q]
set a [run_remote_cmd $qargs]
if [info exists env(TKX11VNC_PRINT_ALL_QD)] {
puts $q
puts $a
puts "---------------"
}
if {$all != ""} {
append all ","
}
......@@ -5982,6 +5992,8 @@ proc get_settings_rcfile {} {
set qst $hmm
} elseif {$item == "nevershared"} {
set qst $hmm
} elseif {$item == "gui"} {
set qst $hmm
}
if {![info exists menu_var($item)]} {
......@@ -6956,7 +6968,10 @@ if {$tk_version < 8.4} {
set screen_height [winfo screenheight .]
set screen_width [winfo screenwidth .]
if {$screen_height < 500} {
if {$screen_height < 700} {
# short screen, netbook?
set max_text_height 30
if {$screen_height < 500} {
# short screen, PDA?
set max_text_height 22
set text_height 13
......@@ -6966,6 +6981,7 @@ if {$screen_height < 500} {
set max_text_width 60
set text_height 11
}
}
}
if {[info exists env(X11VNC_GUI_TEXT_HEIGHT)]} {
set max_text_height $env(X11VNC_GUI_TEXT_HEIGHT)
......
......@@ -2543,7 +2543,7 @@ char gui_code[] = "";
"}\n"
"\n"
"proc get_default_vars {} {\n"
" global default_var\n"
" global default_var env\n"
"\n"
" set qry [all_query_vars]\n"
"\n"
......@@ -2561,6 +2561,11 @@ char gui_code[] = "";
" if {$i > 50} {\n"
" set qargs [list \"-QD\" $q]\n"
" set a [run_remote_cmd $qargs]\n"
" if [info exists env(TKX11VNC_PRINT_ALL_QD)] {\n"
" puts $q\n"
" puts $a\n"
" puts \"---------------\"\n"
" }\n"
" if {$all != \"\"} {\n"
" append all \",\"\n"
" }\n"
......@@ -2572,6 +2577,11 @@ char gui_code[] = "";
" if {$q != \"\"} {\n"
" set qargs [list \"-QD\" $q]\n"
" set a [run_remote_cmd $qargs]\n"
" if [info exists env(TKX11VNC_PRINT_ALL_QD)] {\n"
" puts $q\n"
" puts $a\n"
" puts \"---------------\"\n"
" }\n"
" if {$all != \"\"} {\n"
" append all \",\"\n"
" }\n"
......@@ -5993,6 +6003,8 @@ char gui_code[] = "";
" set qst $hmm\n"
" } elseif {$item == \"nevershared\"} {\n"
" set qst $hmm\n"
" } elseif {$item == \"gui\"} {\n"
" set qst $hmm\n"
" }\n"
"\n"
" if {![info exists menu_var($item)]} {\n"
......@@ -6967,7 +6979,10 @@ char gui_code[] = "";
"\n"
"set screen_height [winfo screenheight .]\n"
"set screen_width [winfo screenwidth .]\n"
"if {$screen_height < 500} {\n"
"if {$screen_height < 700} {\n"
" # short screen, netbook?\n"
" set max_text_height 30\n"
" if {$screen_height < 500} {\n"
" # short screen, PDA?\n"
" set max_text_height 22\n"
" set text_height 13\n"
......@@ -6977,6 +6992,7 @@ char gui_code[] = "";
" set max_text_width 60\n"
" set text_height 11\n"
" }\n"
" }\n"
"}\n"
"if {[info exists env(X11VNC_GUI_TEXT_HEIGHT)]} {\n"
" set max_text_height $env(X11VNC_GUI_TEXT_HEIGHT)\n"
......
......@@ -444,6 +444,9 @@ void unixpw_screen(int init) {
x = nfix(dpy_x / 2 - strlen(log) * char_w, dpy_x);
y = (int) (dpy_y / 3.5);
if (unixpw_system_greeter) {
y = (int) (dpy_y / 3);
}
if (scaling) {
x = (int) (x * scale_fac_x);
......@@ -461,7 +464,7 @@ void unixpw_screen(int init) {
pscreen = screen;
}
if (pscreen && pscreen->width >= 640) {
if (pscreen && pscreen->width >= 640 && pscreen->height >= 480) {
rfbDrawString(pscreen, &default6x13Font, 8, 2+1*13, "F1-Help:", white_pixel());
}
f1_help = 0;
......@@ -473,8 +476,8 @@ void unixpw_screen(int init) {
char moo[] = "Press 'Escape' for System Greeter";
rfbDrawString(pscreen, &default8x16Font, x-90, y-30, moo, white_pixel());
} else {
char moo1[] = "Press 'Escape' for New Session via System Greeter,";
char moo2[] = "or otherwise login here for Existing Session: ";
char moo1[] = "Press 'Escape' for a New Session via System Greeter, or";
char moo2[] = "otherwise login here to connect to an Existing Session:";
rfbDrawString(pscreen, &default6x13Font, x-110, y-38, moo1, white_pixel());
rfbDrawString(pscreen, &default6x13Font, x-110, y-25, moo2, white_pixel());
}
......@@ -1210,7 +1213,7 @@ int su_verify(char *user, char *pass, char *cmd, char *rbuf, int *rbuf_size, int
* auth sufficient pam_self.so
* it may be commented out without problem.
*/
for (i=0; i<sizeof(instr); i++) {
for (i=0; i< (int) sizeof(instr); i++) {
instr[i] = '\0';
}
......@@ -1253,7 +1256,7 @@ int su_verify(char *user, char *pass, char *cmd, char *rbuf, int *rbuf_size, int
if (i < -1) i = -1;
continue;
}
if (j >= sizeof(instr)-1) {
if (j >= (int) sizeof(instr)-1) {
rfbLog("su_verify: problem finding Password:\n");
fflush(stderr);
return 0;
......@@ -1700,14 +1703,20 @@ void unixpw_keystroke(rfbBool down, rfbKeySym keysym, int init) {
} else if (! down) {
return;
}
if (keysym == XK_F1 && pscreen && pscreen->width >= 640) {
char h1[] = "F1-Help: For 'login:' type in the username and press Enter, then for 'Password:' type in the password.";
if (keysym == XK_F1) {
char h1[] = "F1-Help: For 'login:' type in the username and press Enter, then for 'Password:' enter the password.";
char hf[] = " Once logged in, username's X session will be searched for and if found then attached to.";
char hc[] = " Once logged in, username's X session is sought and attached to, otherwise a new session is created.";
char hx[] = " Once logged in, username's X session is sought and attached to, otherwise a login greeter is presented.";
char h2[] = " Specify options after a ':' like this: username:opt,opt=val,... Where an opt may be any of:";
char h3[] = " scale=... (n/m); scale_cursor=... (sc=); solid (so); id=; repeat; clear_mods (cm); clear_keys (ck);";
char h4[] = " clear_all (ca); speeds=... (sp=); readtimeout=... (rd=) rotate=... (ro=); noncache (nc) (nc=n);";
char h5[] = " geom=WxHxD (ge=); nodisplay=... (nd=); viewonly (vo); tag=...; gnome kde twm fvwm mwm dtwm wmaker";
char h6[] = " xfce lxde enlightenment Xsession failsafe. Examples: fred:3/4,so,cm wilma:geom=1024x768x16,kde";
int ch = 13, p;
if (!pscreen || pscreen->width < 640 || pscreen->height < 480) {
return;
}
if (f1_help) {
p = black_pixel();
f1_help = 0;
......@@ -1717,11 +1726,22 @@ void unixpw_keystroke(rfbBool down, rfbKeySym keysym, int init) {
unixpw_last_try_time = time(NULL) + 45;
}
rfbDrawString(pscreen, &default6x13Font, 8, 2+1*ch, h1, p);
rfbDrawString(pscreen, &default6x13Font, 8, 2+2*ch, h2, p);
rfbDrawString(pscreen, &default6x13Font, 8, 2+3*ch, h3, p);
rfbDrawString(pscreen, &default6x13Font, 8, 2+4*ch, h4, p);
rfbDrawString(pscreen, &default6x13Font, 8, 2+5*ch, h5, p);
rfbDrawString(pscreen, &default6x13Font, 8, 2+6*ch, h6, p);
if (use_dpy == NULL) {
;
} else if (strstr(use_dpy, "cmd=FINDDISPLAY")) {
rfbDrawString(pscreen, &default6x13Font, 8, 2+2*ch, hf, p);
} else if (strstr(use_dpy, "cmd=FINDCREATEDISPLAY")) {
if (strstr(use_dpy, "xdmcp")) {
rfbDrawString(pscreen, &default6x13Font, 8, 2+2*ch, hx, p);
} else {
rfbDrawString(pscreen, &default6x13Font, 8, 2+2*ch, hc, p);
}
}
rfbDrawString(pscreen, &default6x13Font, 8, 2+3*ch, h2, p);
rfbDrawString(pscreen, &default6x13Font, 8, 2+4*ch, h3, p);
rfbDrawString(pscreen, &default6x13Font, 8, 2+5*ch, h4, p);
rfbDrawString(pscreen, &default6x13Font, 8, 2+6*ch, h5, p);
rfbDrawString(pscreen, &default6x13Font, 8, 2+7*ch, h6, p);
if (!f1_help) {
rfbDrawString(pscreen, &default6x13Font, 8, 2+1*ch, "F1-Help:", white_pixel());
}
......
......@@ -2,7 +2,7 @@
.TH X11VNC "1" "December 2009" "x11vnc " "User Commands"
.SH NAME
x11vnc - allow VNC connections to real X11 displays
version: 0.9.10, lastmod: 2009-12-24
version: 0.9.10, lastmod: 2009-12-27
.SH SYNOPSIS
.B x11vnc
[OPTION]...
......
......@@ -5018,6 +5018,7 @@ int main(int argc, char* argv[]) {
}
if (dpy && !xrandr && !got_noxrandr) {
#if !NO_X11
Atom trap_xrandr = XInternAtom(dpy, "X11VNC_TRAP_XRANDR", True);
if (trap_xrandr != None) {
if (! quiet) {
......@@ -5025,6 +5026,7 @@ int main(int argc, char* argv[]) {
}
xrandr = 1;
}
#endif
}
#ifdef MACOSX
......
......@@ -47,7 +47,7 @@ int xtrap_base_event_type = 0;
int xdamage_base_event_type = 0;
/* date +'lastmod: %Y-%m-%d' */
char lastmod[] = "0.9.10 lastmod: 2009-12-24";
char lastmod[] = "0.9.10 lastmod: 2009-12-27";
/* X display info */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment