x11vnc: -filexfer, -slow_fb, -blackout noptr,...

pull/1/head
runge 19 years ago
parent 94d7fc841e
commit 30c00d0b06

@ -1,3 +1,6 @@
2005-10-22 Karl Runge <runge@karlrunge.com>
* x11vnc: -filexfer file transfer, -slow_fb, -blackout noptr...
2005-10-06 Johannes E. Schindelin <Johannes.Schindelin@gmx.de>
* many a files: kill BackChannel and CustomClientMessage
support. The new extension mechanism is much more versatile.

@ -1,3 +1,10 @@
2005-10-22 Karl Runge <runge@karlrunge.com>
* add tightVNC FileTransfer (-filexfer) and -DFILEXFER=1
* -slow_fb for special purpose infrequent polling.
* make -blackout work with copyrect clipping.
* -blackout noptr,WxH+X+Y,... to prevent pointer from going
into a blacked out region.
2005-07-17 Karl Runge <runge@karlrunge.com>
* more improvements to gui UE. gui requests via client_sock
PASSWD_REQUIRED and PASSWD_UNLESS_NOPW build options.

File diff suppressed because it is too large Load Diff

@ -55,6 +55,7 @@ catch {rename send {}}
# 0 means to skip the item.
# -- means add a separator
#
proc set_template {} {
global template
set template "
@ -186,6 +187,8 @@ Misc
--
=F rc:
norc
filexfer
--
nofb
=D nobell
nolookup
@ -572,6 +575,22 @@ of actions:
Stop x11vnc - Directs the x11vnc server to disconnect all vncviewers
and then exit. The tray/icon GUI then exits as well.
Custom - If you have a \$HOME/.x11vnc.gui file each uncommented
line in it becomes an additional menu item for this
menu. The remote control command is run directly
via \"x11vnc -R <command>\", or if prefixed with
\"action:\" runs a gui internal action, or if \"sep\"
adds a separator. Set X11VNC_CUSTOM_GUI to use
a different filename. Example file contents:
scale:3/4
scale:1
scale_cursor:1
sep
action:all-settings
#debug_keyboard
sep
action:Quit
Termination:
@ -1315,7 +1334,9 @@ proc help_win {item} {
set ok 0
set text "Help on $item:\n\n"
if {[is_gui_internal $item]} {
if {$item == "NewClient"} {
;
} elseif {[is_gui_internal $item]} {
if {$item != "gui" && $item != "all" && $item != "Misc-Tuning:" \
&& $item != "Properties" && $item != "Tray"} {
append text " + Is a gui internal Action (cannot be set).\n";
@ -1327,7 +1348,9 @@ proc help_win {item} {
} else {
append text " - Cannot be changed in a running x11vnc.\n";
}
if {[is_gui_internal $item]} {
if {$item == "NewClient"} {
;
} elseif {[is_gui_internal $item]} {
;
} elseif {[active_when_starting $item]} {
append text " + Can be set at x11vnc startup.\n";
@ -2860,6 +2883,9 @@ proc do_action {item} {
} elseif {$item == "WindowView"} {
change_view_state
return
} elseif {$item == "quit" || $item == "Quit"} {
destroy .
exit 0
} elseif {$item == "stop+quit"} {
do_stop_quit
}
@ -3844,6 +3870,7 @@ proc props_advanced {} {
} else {
set first 0
}
update
wm deiconify $full_win
update
@ -4119,6 +4146,8 @@ proc pmenu {m x y} {
set x [expr $x-10]
set y [expr $y-10]
$m post $x $y
# XXX more care needed
grab set -global $m
}
proc set_client_balloon {str} {
@ -4158,7 +4187,9 @@ proc set_client_balloon {str} {
}
} else {
set i [expr $count+1]
set client_balloon "${client_balloon}\nunknown-host$i"
if {$i == 1} {
set client_balloon "${client_balloon}\nunknown-host$i"
}
}
incr count
}
@ -4458,18 +4489,27 @@ proc get_icon_label {{set 0}} {
return $lab
}
# currently unused
proc lmenu {menu} {
global popup_cascade_posted
global left_iconwin_menu
set left_iconwin_menu 1
after 100
if {!$popup_cascade_posted} {
after 100
if {!$popup_cascade_posted} {
update
if {!$popup_cascade_posted && $left_iconwin_menu} {
for {set i 0} {$i < 3} {incr i} {
after 100
update
}
if {!$popup_cascade_posted && $left_iconwin_menu} {
$menu unpost
return
}
}
# kludge for WindowView
focus $menu
if {$popup_cascade_posted} {
focus $menu
}
}
proc old_balloon {} {
@ -4490,6 +4530,78 @@ proc old_balloon {} {
}
}
proc get_custom_menu_items {} {
global env custom_last_read
if {![info exists custom_last_read]} {
set custom_last_read 0
}
if {[info exists env(X11VNC_CUSTOM_GUI)]} {
set custom "$env(X11VNC_CUSTOM_GUI)"
} elseif {![info exists env(HOME)]} {
return [list "none"]
} else {
set custom "$env(HOME)/.x11vnc.gui"
}
if {![file exists $custom]} {
return [list "none"]
}
# if {[file mtime $custom] <= $custom_last_read} {
# return [list "nochange"]
# }
set in ""
catch {set in [open $custom "r"]}
if {$in == ""} {
return [list "none"]
}
set custom_last_read [clock seconds]
set count 0
while {[gets $in line] > -1} {
if {[regexp {^[ \t]*#} $line]} {
continue
}
set line [string trim $line]
if {$line != ""} {
lappend items $line
incr count
}
}
close $in
if {$count > 0} {
return $items
} else {
return [list "none"]
}
}
proc make_custom_menu {menu font} {
set items [get_custom_menu_items]
set i0 [lindex $items 0]
catch {$menu delete 0 end}
if {$i0 != "none"} {
$menu add command -font $font -label "Custom items:"
$menu add separator
foreach item $items {
if {$item == "sep" || $item == "separator"} {
$menu add separator
continue
}
if {[regexp {^action:(.*)$} $item m action]} {
$menu add command -font $font -label "$action" \
-command "do_var $action"
continue
}
$menu add command -font $font -label "$item" \
-command "run_remote_cmd \[list \"-R\" \"$item\"\]"
}
}
}
proc make_icon {} {
global icon_mode icon_embed_id icon_win props_win full_win
global tray_embed tray_running env
@ -4572,13 +4684,25 @@ proc make_icon {} {
$menu add command -font $mfont -label "Stop x11vnc" -command clean_icon_exit
bind $icon_win <ButtonPress-1> "pmenu $menu %X %Y"
bind $icon_win <ButtonPress-3> "pmenu $menu %X %Y"
set items [get_custom_menu_items]
set i0 [lindex $items 0]
if {$i0 != "none" && $i0 != "nochange"} {
$menu add separator
set cm "$menu.custom"
catch {destroy $cm}
menu $cm -tearoff 0 -font $ffont \
-postcommand "set popup_cascade_posted 1; make_custom_menu $cm $ffont"
$menu add cascade -font $mfont -label "Custom:" -menu $cm
}
bind $icon_win <ButtonRelease-1> "pmenu $menu %X %Y"
bind $icon_win <ButtonRelease-3> "pmenu $menu %X %Y"
bind $icon_win <Enter> {set client_balloon_id [after 500 show_client_balloon]}
bind $icon_win <Button> {kill_client_balloon}
bind $icon_win <Leave> {kill_client_balloon}
bind $icon_win <ButtonPress-2> {kill_client_balloon; show_client_balloon}
bind $menu <Leave> "lmenu $menu"
# bind $menu <Leave> "lmenu $menu"
# bind $menu <Enter> "set left_iconwin_menu 0"
## bind $menu <KeyPress-Escape> "$menu unpost"
bind . <Control-KeyPress-c> {destroy .; exit 0}
@ -4599,7 +4723,9 @@ proc make_icon {} {
}
wm iconname . "tkx11vnc"
wm title . "tkx11vnc"
update
wm deiconify .
update
old_balloon
}
@ -4739,6 +4865,7 @@ proc make_gui {mode} {
set gui_current_state $mode
update
wm deiconify .
update idletasks
wm minsize $w [winfo width $w] [winfo height $w]
@ -5195,9 +5322,10 @@ proc get_settings_rcfile {} {
proc double_check_start_x11vnc {} {
global hostname
set msg [get_start_x11vnc_txt]
bell
append msg "\n"
append msg "*** To run the above command on machine \"$hostname\" to\n"
append msg "*** start x11vnc press \"OK\" otherwise press \"Cancel\".\n"
append msg "*** To run the above command on machine \"$hostname\" (thereby\n"
append msg "*** starting x11vnc) press \"OK\", otherwise press \"Cancel\".\n"
return [warning_dialog $msg "start"]
}
@ -5402,8 +5530,12 @@ proc run_remote_cmd_via_sock {opts} {
global client_sock
set db 0
if {[file channels $client_sock] == ""} {
set client_sock ""
return "fail"
}
if {[eof $client_sock]} {
close $client_sock
catch {close $client_sock}
set client_sock ""
return "fail"
}
@ -5750,6 +5882,8 @@ proc undo_tray_embed {} {
############################################################################
# main:
wm withdraw .
global env x11vnc_prog x11vnc_cmdline x11vnc_xdisplay x11vnc_connect;
global x11vnc_xdisplay0
global x11vnc_client_file x11vnc_gui_geom x11vnc_started vnc_url

@ -61,6 +61,7 @@
"# 0 means to skip the item.\n"
"# -- means add a separator\n"
"#\n"
"\n"
"proc set_template {} {\n"
" global template\n"
" set template \"\n"
@ -192,6 +193,8 @@
" --\n"
" =F rc:\n"
" norc\n"
" filexfer\n"
" --\n"
" nofb\n"
" =D nobell\n"
" nolookup\n"
@ -578,6 +581,22 @@
" Stop x11vnc - Directs the x11vnc server to disconnect all vncviewers\n"
" and then exit. The tray/icon GUI then exits as well.\n"
"\n"
" Custom - If you have a \\$HOME/.x11vnc.gui file each uncommented\n"
" line in it becomes an additional menu item for this\n"
" menu. The remote control command is run directly\n"
" via \\\"x11vnc -R <command>\\\", or if prefixed with \n"
" \\\"action:\\\" runs a gui internal action, or if \\\"sep\\\"\n"
" adds a separator. Set X11VNC_CUSTOM_GUI to use\n"
" a different filename. Example file contents:\n"
"\n"
" scale:3/4\n"
" scale:1\n"
" scale_cursor:1\n"
" sep\n"
" action:all-settings\n"
" #debug_keyboard\n"
" sep\n"
" action:Quit\n"
"\n"
"Termination:\n"
"\n"
@ -1321,7 +1340,9 @@
" set ok 0\n"
" set text \"Help on $item:\\n\\n\"\n"
"\n"
" if {[is_gui_internal $item]} {\n"
" if {$item == \"NewClient\"} {\n"
" ;\n"
" } elseif {[is_gui_internal $item]} {\n"
" if {$item != \"gui\" && $item != \"all\" && $item != \"Misc-Tuning:\" \\\n"
" && $item != \"Properties\" && $item != \"Tray\"} {\n"
" append text \" + Is a gui internal Action (cannot be set).\\n\";\n"
@ -1333,7 +1354,9 @@
" } else {\n"
" append text \" - Cannot be changed in a running x11vnc.\\n\";\n"
" }\n"
" if {[is_gui_internal $item]} {\n"
" if {$item == \"NewClient\"} {\n"
" ;\n"
" } elseif {[is_gui_internal $item]} {\n"
" ;\n"
" } elseif {[active_when_starting $item]} {\n"
" append text \" + Can be set at x11vnc startup.\\n\";\n"
@ -2866,6 +2889,9 @@
" } elseif {$item == \"WindowView\"} {\n"
" change_view_state\n"
" return\n"
" } elseif {$item == \"quit\" || $item == \"Quit\"} {\n"
" destroy .\n"
" exit 0\n"
" } elseif {$item == \"stop+quit\"} {\n"
" do_stop_quit\n"
" }\n"
@ -3850,6 +3876,7 @@
" } else {\n"
" set first 0\n"
" }\n"
" update\n"
" wm deiconify $full_win\n"
" update\n"
"\n"
@ -4125,6 +4152,8 @@
" set x [expr $x-10]\n"
" set y [expr $y-10]\n"
" $m post $x $y\n"
" # XXX more care needed\n"
" grab set -global $m\n"
"}\n"
"\n"
"proc set_client_balloon {str} {\n"
@ -4164,7 +4193,9 @@
" }\n"
" } else {\n"
" set i [expr $count+1]\n"
" set client_balloon \"${client_balloon}\\nunknown-host$i\"\n"
" if {$i == 1} {\n"
" set client_balloon \"${client_balloon}\\nunknown-host$i\"\n"
" }\n"
" }\n"
" incr count\n"
" }\n"
@ -4464,18 +4495,27 @@
" return $lab\n"
"}\n"
"\n"
"# currently unused\n"
"proc lmenu {menu} {\n"
" global popup_cascade_posted\n"
" global left_iconwin_menu\n"
" set left_iconwin_menu 1\n"
" after 100\n"
" if {!$popup_cascade_posted} {\n"
" after 100\n"
" if {!$popup_cascade_posted} {\n"
" update\n"
" if {!$popup_cascade_posted && $left_iconwin_menu} {\n"
" for {set i 0} {$i < 3} {incr i} {\n"
" after 100\n"
" update\n"
" }\n"
" if {!$popup_cascade_posted && $left_iconwin_menu} {\n"
" $menu unpost\n"
" return\n"
" }\n"
" }\n"
" # kludge for WindowView\n"
" focus $menu\n"
" if {$popup_cascade_posted} {\n"
" focus $menu\n"
" }\n"
"}\n"
"\n"
"proc old_balloon {} {\n"
@ -4496,6 +4536,78 @@
" }\n"
"}\n"
"\n"
"proc get_custom_menu_items {} {\n"
" global env custom_last_read\n"
"\n"
" if {![info exists custom_last_read]} {\n"
" set custom_last_read 0\n"
" }\n"
" if {[info exists env(X11VNC_CUSTOM_GUI)]} {\n"
" set custom \"$env(X11VNC_CUSTOM_GUI)\"\n"
" } elseif {![info exists env(HOME)]} {\n"
" return [list \"none\"]\n"
" } else {\n"
" set custom \"$env(HOME)/.x11vnc.gui\"\n"
" }\n"
" if {![file exists $custom]} {\n"
" return [list \"none\"]\n"
" }\n"
"\n"
"# if {[file mtime $custom] <= $custom_last_read} {\n"
"# return [list \"nochange\"]\n"
"# }\n"
"\n"
" set in \"\"\n"
" catch {set in [open $custom \"r\"]} \n"
" if {$in == \"\"} {\n"
" return [list \"none\"]\n"
" }\n"
"\n"
" set custom_last_read [clock seconds]\n"
"\n"
" set count 0\n"
" while {[gets $in line] > -1} {\n"
" if {[regexp {^[ \\t]*#} $line]} {\n"
" continue\n"
" }\n"
" set line [string trim $line]\n"
" if {$line != \"\"} {\n"
" lappend items $line\n"
" incr count\n"
" }\n"
" }\n"
" close $in\n"
" \n"
" if {$count > 0} {\n"
" return $items\n"
" } else {\n"
" return [list \"none\"]\n"
" }\n"
"}\n"
"\n"
"proc make_custom_menu {menu font} {\n"
" set items [get_custom_menu_items]\n"
" set i0 [lindex $items 0]\n"
" catch {$menu delete 0 end}\n"
" if {$i0 != \"none\"} {\n"
" $menu add command -font $font -label \"Custom items:\"\n"
" $menu add separator\n"
" foreach item $items {\n"
" if {$item == \"sep\" || $item == \"separator\"} {\n"
" $menu add separator\n"
" continue\n"
" }\n"
" if {[regexp {^action:(.*)$} $item m action]} {\n"
" $menu add command -font $font -label \"$action\" \\\n"
" -command \"do_var $action\"\n"
" continue\n"
" }\n"
" $menu add command -font $font -label \"$item\" \\\n"
" -command \"run_remote_cmd \\[list \\\"-R\\\" \\\"$item\\\"\\]\"\n"
" }\n"
" }\n"
"}\n"
"\n"
"proc make_icon {} {\n"
" global icon_mode icon_embed_id icon_win props_win full_win\n"
" global tray_embed tray_running env\n"
@ -4578,13 +4690,25 @@
"\n"
" $menu add command -font $mfont -label \"Stop x11vnc\" -command clean_icon_exit\n"
"\n"
" bind $icon_win <ButtonPress-1> \"pmenu $menu %X %Y\"\n"
" bind $icon_win <ButtonPress-3> \"pmenu $menu %X %Y\"\n"
" set items [get_custom_menu_items]\n"
" set i0 [lindex $items 0]\n"
" if {$i0 != \"none\" && $i0 != \"nochange\"} {\n"
" $menu add separator\n"
" set cm \"$menu.custom\"\n"
" catch {destroy $cm}\n"
" menu $cm -tearoff 0 -font $ffont \\\n"
" -postcommand \"set popup_cascade_posted 1; make_custom_menu $cm $ffont\"\n"
" $menu add cascade -font $mfont -label \"Custom:\" -menu $cm\n"
" }\n"
"\n"
" bind $icon_win <ButtonRelease-1> \"pmenu $menu %X %Y\"\n"
" bind $icon_win <ButtonRelease-3> \"pmenu $menu %X %Y\"\n"
" bind $icon_win <Enter> {set client_balloon_id [after 500 show_client_balloon]}\n"
" bind $icon_win <Button> {kill_client_balloon}\n"
" bind $icon_win <Leave> {kill_client_balloon}\n"
" bind $icon_win <ButtonPress-2> {kill_client_balloon; show_client_balloon}\n"
" bind $menu <Leave> \"lmenu $menu\"\n"
"# bind $menu <Leave> \"lmenu $menu\"\n"
"# bind $menu <Enter> \"set left_iconwin_menu 0\"\n"
"## bind $menu <KeyPress-Escape> \"$menu unpost\"\n"
"\n"
" bind . <Control-KeyPress-c> {destroy .; exit 0}\n"
@ -4605,7 +4729,9 @@
" }\n"
" wm iconname . \"tkx11vnc\"\n"
" wm title . \"tkx11vnc\"\n"
" update\n"
" wm deiconify .\n"
" update\n"
"\n"
" old_balloon\n"
"}\n"
@ -4745,6 +4871,7 @@
" set gui_current_state $mode\n"
"\n"
"\n"
" update\n"
" wm deiconify .\n"
" update idletasks\n"
" wm minsize $w [winfo width $w] [winfo height $w]\n"
@ -5201,9 +5328,10 @@
"proc double_check_start_x11vnc {} {\n"
" global hostname\n"
" set msg [get_start_x11vnc_txt]\n"
" bell\n"
" append msg \"\\n\"\n"
" append msg \"*** To run the above command on machine \\\"$hostname\\\" to\\n\"\n"
" append msg \"*** start x11vnc press \\\"OK\\\" otherwise press \\\"Cancel\\\".\\n\"\n"
" append msg \"*** To run the above command on machine \\\"$hostname\\\" (thereby\\n\"\n"
" append msg \"*** starting x11vnc) press \\\"OK\\\", otherwise press \\\"Cancel\\\".\\n\"\n"
" return [warning_dialog $msg \"start\"]\n"
"}\n"
"\n"
@ -5408,8 +5536,12 @@
" global client_sock\n"
"\n"
" set db 0\n"
" if {[file channels $client_sock] == \"\"} {\n"
" set client_sock \"\"\n"
" return \"fail\"\n"
" }\n"
" if {[eof $client_sock]} {\n"
" close $client_sock\n"
" catch {close $client_sock}\n"
" set client_sock \"\"\n"
" return \"fail\"\n"
" }\n"
@ -5756,6 +5888,8 @@
"############################################################################\n"
"# main:\n"
"\n"
"wm withdraw .\n"
"\n"
"global env x11vnc_prog x11vnc_cmdline x11vnc_xdisplay x11vnc_connect;\n"
"global x11vnc_xdisplay0\n"
"global x11vnc_client_file x11vnc_gui_geom x11vnc_started vnc_url\n"

@ -1,8 +1,8 @@
.\" This file was automatically generated from x11vnc -help output.
.TH X11VNC "1" "July 2005" "x11vnc " "User Commands"
.TH X11VNC "1" "October 2005" "x11vnc " "User Commands"
.SH NAME
x11vnc - allow VNC connections to real X11 displays
version: 0.7.3, lastmod: 2005-07-17
version: 0.7.3, lastmod: 2005-10-22
.SH SYNOPSIS
.B x11vnc
[OPTION]...
@ -253,6 +253,10 @@ option, otherwise the stderr goes to the viewer which
will cause it to abort. Specifying both \fB-inetd\fR and \fB-q\fR
and no \fB-o\fR will automatically close the stderr.
.PP
\fB-filexfer\fR
.IP
Enable the TightVNC file transfer extension.
.PP
\fB-http\fR
.IP
Instead of using \fB-httpdir\fR (see below) to specify
@ -577,7 +581,9 @@ color with "gnome:", "kde:", "cde:" or "root:".
.IP
Black out rectangles on the screen. \fIstring\fR is a
comma separated list of WxH+X+Y type geometries for
each rectangle.
each rectangle. If one of the items on the list is the
string "noptr" the mouse pointer will not be allowed
to go into a blacked out region.
.PP
\fB-xinerama\fR
.IP
@ -1545,6 +1551,13 @@ text output. By default x11vnc will try to detect this
no user input), and sleep up to 1.5 secs to let things
"catch up". Use this option to disable that detection.
.PP
\fB-slow_fb\fR \fItime\fR
.IP
Floating point time in seconds delay all screen polling.
For special purpose usage where a low frame rate is
acceptable and desirable, but you want the user input
processed at the normal rate so you cannot use \fB-wait.\fR
.PP
\fB-readtimeout\fR \fIn\fR
.IP
Set libvncserver rfbMaxClientWait to n seconds. On
@ -2190,6 +2203,8 @@ wait_bog disable \fB-nowait_bog\fR mode.
.IP
nowait_bog enable \fB-nowait_bog\fR mode.
.IP
slow_fb:f set \fB-slow_fb\fR to f seconds.
.IP
readtimeout:n set read timeout to n seconds.
.IP
nap enable \fB-nap\fR mode.
@ -2362,14 +2377,14 @@ xwarp noxwarppointer noxwarp buttonmap dragging
nodragging wireframe_mode wireframe wf nowireframe
nowf wirecopyrect wcr nowirecopyrect nowcr scr_area
scr_skip scr_inc scr_keys scr_term scr_keyrepeat
scr_parms scrollcopyrect scr noscrollcopyrect
noscr fixscreen noxrecord xrecord reset_record
pointer_mode pm input_skip input client_input
speeds wmdt debug_pointer dp nodebug_pointer nodp
debug_keyboard dk nodebug_keyboard nodk deferupdate
defer wait_ui wait_bog nowait_bog wait readtimeout
nap nonap sb screen_blank fs gaps grow fuzz snapfb
nosnapfb rawfb progressive rfbport http nohttp httpport
scr_parms scrollcopyrect scr noscrollcopyrect noscr
fixscreen noxrecord xrecord reset_record pointer_mode
pm input_skip input client_input speeds wmdt
debug_pointer dp nodebug_pointer nodp debug_keyboard
dk nodebug_keyboard nodk deferupdate defer wait_ui
wait_bog nowait_bog slow_fb wait readtimeout nap nonap
sb screen_blank fs gaps grow fuzz snapfb nosnapfb
rawfb progressive rfbport http nohttp httpport
httpdir enablehttpproxy noenablehttpproxy alwaysshared
noalwaysshared nevershared noalwaysshared dontdisconnect
nodontdisconnect desktop debug_xevents nodebug_xevents

@ -35,8 +35,8 @@
* respectively. To increase portability it is written in plain C.
*
* Another goal is to improve performance and interactive response.
* The algorithm of x0rfbserver was used as a base. Additional heuristics
* are also applied.
* The algorithm of x0rfbserver was used as a base. Many additional
* heuristics are also applied.
*
* Another goal is to add many features that enable and incourage creative
* usage and application of the tool. Apologies for the large number
@ -163,6 +163,7 @@
* -DREMOTE_DEFAULT=0 to disable remote-control on by default (-yesremote).
* -DREMOTE_CONTROL=0 to disable remote-control mechanism completely.
* -DEXTERNAL_COMMANDS=0 to disable the running of all external commands.
* -DFILEXFER=1 enable -filexfer as the default.
*
* -DHARDWIRE_PASSWD=... hardwired passwords, quoting necessary.
* -DHARDWIRE_VIEWPASSWD=...
@ -397,7 +398,7 @@ double xdamage_scheduled_mark = 0.0;
sraRegionPtr xdamage_scheduled_mark_region = NULL;
/* date +'lastmod: %Y-%m-%d' */
char lastmod[] = "0.7.3 lastmod: 2005-07-17";
char lastmod[] = "0.7.3 lastmod: 2005-10-22";
int hack_val = 0;
/* X display info */
@ -669,7 +670,7 @@ void mark_hint(hint_t);
void mark_rect_as_modified(int x1, int y1, int x2, int y2, int force);
enum rfbNewClientAction new_client(rfbClientPtr client);
void set_nofb_params(void);
void set_nofb_params(int);
void set_raw_fb_params(int);
void nofb_hook(rfbClientPtr client);
void pointer(int mask, int x, int y, rfbClientPtr client);
@ -786,6 +787,7 @@ int logfile_append = 0;
char *flagfile = NULL; /* -flag */
char *passwdfile = NULL; /* -passwdfile */
char *blackout_str = NULL; /* -blackout */
int blackout_ptr = 0;
char *clip_str = NULL; /* -clip */
int use_solid_bg = 0; /* -solid */
char *solid_str = NULL;
@ -863,6 +865,10 @@ char *allowed_input_normal = NULL;
char *allowed_input_str = NULL;
char *viewonly_passwd = NULL; /* view only passwd. */
int inetd = 0; /* spawned from inetd(1) */
#ifndef FILEXFER
#define FILEXFER 0
#endif
int filexfer = FILEXFER;
int first_conn_timeout = 0; /* -timeout */
int flash_cmap = 0; /* follow installed colormaps */
int shift_cmap = 0; /* ncells < 256 and needs shift of pixel values */
@ -980,9 +986,11 @@ typedef struct winattr {
winattr_t *stack_list = NULL;
int stack_list_len = 0;
int stack_list_num = 0;
#if 0
winattr_t *stack_clip = NULL;
int stack_clip_len = 0;
int stack_clip_num = 0;
#endif
/* T+B+L+R,tkey+presist_key,tmouse+persist_mouse */
#ifndef SCROLL_COPYRECT_PARMS
@ -1104,6 +1112,7 @@ int flip_byte_order = 0; /* sometimes needed when using_shm = 0 */
*/
int waitms = 30;
double wait_ui = 2.0;
double slow_fb = 0.0;
int wait_bog = 1;
int defer_update = 30; /* deferUpdateTime ms to wait before sends. */
int got_defer = 0;
@ -6771,6 +6780,9 @@ void read_vnc_connect_prop(void) {
;
} else if (strstr(vnc_connect_str, "ack=") == vnc_connect_str) {
;
} else if (quiet && strstr(vnc_connect_str, "qry=ping") ==
vnc_connect_str) {
;
} else if (strstr(vnc_connect_str, "cmd=") &&
strstr(vnc_connect_str, "passwd")) {
rfbLog("read VNC_CONNECT: *\n");
@ -10206,6 +10218,12 @@ void initialize_pointer_map(char *pointer_remap) {
}
}
typedef struct bout {
int x1, y1, x2, y2;
} blackout_t;
int blackouts;
blackout_t blackr[];
/*
* For use in the -wireframe stuff, save the stacking order of the direct
* children of the root window. Ideally done before we send ButtonPress
@ -10214,7 +10232,7 @@ void initialize_pointer_map(char *pointer_remap) {
void snapshot_stack_list(int free_only, double allowed_age) {
static double last_snap = 0.0, last_free = 0.0;
double now;
int num, rc, i;
int num, rc, i, j;
unsigned int ui;
Window r, w;
Window *list;
@ -10253,19 +10271,40 @@ void snapshot_stack_list(int free_only, double allowed_age) {
}
last_snap = now;
if (num > stack_list_len) {
if (num > stack_list_len + blackouts) {
int n = 2*num;
free(stack_list);
stack_list = (winattr_t *) malloc(n*sizeof(winattr_t));
stack_list_len = n;
}
j = 0;
for (i=0; i<num; i++) {
stack_list[i].win = list[i];
stack_list[i].fetched = 0;
stack_list[i].valid = 0;
stack_list[i].time = now;
}
stack_list_num = num;
stack_list[j].win = list[i];
stack_list[j].fetched = 0;
stack_list[j].valid = 0;
stack_list[j].time = now;
j++;
}
for (i=0; i<blackouts; i++) {
stack_list[j].win = 0x1;
stack_list[j].fetched = 1;
stack_list[j].valid = 1;
stack_list[j].x = blackr[i].x1;
stack_list[j].y = blackr[i].y1;
stack_list[j].width = blackr[i].x2 - blackr[i].x1;
stack_list[j].height = blackr[i].y2 - blackr[i].y1;
stack_list[j].time = now;
stack_list[j].map_state = IsViewable;
stack_list[j].rx = -1;
stack_list[j].ry = -1;
j++;
if (0) fprintf(stderr, "blackr: %d %dx%d+%d+%d\n", i,
stack_list[j-1].width, stack_list[j-1].height,
stack_list[j-1].x, stack_list[j-1].y);
}
stack_list_num = num + blackouts;
if (debug_wireframe > 1) {
fprintf(stderr, "snapshot_stack_list: num=%d len=%d\n",
stack_list_num, stack_list_len);
@ -10291,7 +10330,9 @@ void update_stack_list(void) {
for (k=0; k < stack_list_num; k++) {
Window win = stack_list[k].win;
if (!valid_window(win, &attr, 1)) {
if (win != None && win < 10) {
; /* special, blackout */
} else if (!valid_window(win, &attr, 1)) {
stack_list[k].valid = 0;
} else {
stack_list[k].valid = 1;
@ -10685,6 +10726,31 @@ void pointer(int mask, int x, int y, rfbClientPtr client) {
last_pointer_client = client;
last_pointer_time = now;
if (blackout_ptr && blackouts) {
int b, ok = 1;
/* see if it goes into the blacked out region */
for (b=0; b < blackouts; b++) {
if (x < blackr[b].x1 || x > blackr[b].x2) {
continue;
}
if (y < blackr[b].y1 || y > blackr[b].y2) {
continue;
}
/* x1 <= x <= x2 and y1 <= y <= y2 */
ok = 0;
break;
}
if (! ok) {
if (debug_pointer) {
rfbLog("pointer(): blackout_ptr skipping "
"x=%d y=%d in rectangle %d,%d %d,%d\n", x, y,
blackr[b].x1, blackr[b].y1,
blackr[b].x2, blackr[b].y2);
}
return;
}
}
}
/*
@ -13694,6 +13760,18 @@ char *process_remote_cmd(char *cmd, int stringonly) {
first_conn_timeout = to;
rfbLog("remote_cmd: set -timeout to %d\n", -to);
#if 0
} else if (!strcmp(p, "filexfer")) {
/* does this work after rfbInitServer? */
if (query) {
snprintf(buf, bufn, "ans=%s:%d", p, filexfer);
goto qry;
}
rfbLog("remote_cmd: enabling -filexfer.\n");
filexfer = 1;
rfbRegisterTightVNCFileTransferExtension();
#endif
} else if (!strcmp(p, "deny") || !strcmp(p, "lock")) {
if (query) {
snprintf(buf, bufn, "ans=%s:%d", p, deny_all);
@ -14559,6 +14637,7 @@ char *process_remote_cmd(char *cmd, int stringonly) {
rfbLog(" overlay, shm, noonetile, nap, cursor\n");
rfbLog(" cursorpos, cursorshape, bell.\n");
nofb = 0;
set_nofb_params(1);
do_new_fb(1);
}
} else if (!strcmp(p, "nofb")) {
@ -14574,7 +14653,7 @@ char *process_remote_cmd(char *cmd, int stringonly) {
nofb = 1;
sound_bell = 0;
initialize_watch_bell();
set_nofb_params();
set_nofb_params(0);
do_new_fb(1);
}
@ -15491,6 +15570,20 @@ char *process_remote_cmd(char *cmd, int stringonly) {
wait_bog = 0;
rfbLog("remote_cmd: setting wait_bog to %d\n", wait_bog);
} else if (strstr(p, "slow_fb") == p) {
double w;
COLON_CHECK("slow_fb:")
if (query) {
snprintf(buf, bufn, "ans=%s%s%.2f", p, co, slow_fb);
goto qry;
}
p += strlen("slow_fb:");
w = atof(p);
if (w <= 0) w = 0.0;
rfbLog("remote_cmd: setting slow_fb factor %.2f -> %.2f\n",
slow_fb, w);
slow_fb = w;
} else if (strstr(p, "wait") == p) {
int w;
COLON_CHECK("wait:")
@ -18829,7 +18922,55 @@ void set_visual(char *str) {
visual_id = vinfo.visualid;
}
void set_nofb_params(void) {
void set_nofb_params(int restore) {
static int first = 1;
static int save[100];
int i = 0;
if (first) {
first = 0;
save[i++] = use_xfixes;
save[i++] = use_xdamage;
save[i++] = use_xrecord;
save[i++] = wireframe;
save[i++] = use_solid_bg;
save[i++] = overlay;
save[i++] = overlay_cursor;
save[i++] = using_shm;
save[i++] = single_copytile;
save[i++] = take_naps;
save[i++] = measure_speeds;
save[i++] = grab_buster;
save[i++] = show_cursor;
save[i++] = cursor_shape_updates;
save[i++] = cursor_pos_updates;
}
if (restore) {
i = 0;
use_xfixes = save[i++];
use_xdamage = save[i++];
use_xrecord = save[i++];
wireframe = save[i++];
use_solid_bg = save[i++];
overlay = save[i++];
overlay_cursor = save[i++];
using_shm = save[i++];
single_copytile = save[i++];
take_naps = save[i++];
measure_speeds = save[i++];
grab_buster = save[i++];
show_cursor = save[i++];
cursor_shape_updates = save[i++];
cursor_pos_updates = save[i++];
if (cursor_shape_updates) {
restore_cursor_shape_updates(screen);
}
initialize_cursors_mode();
return;
}
use_xfixes = 0;
use_xdamage = 0;
use_xrecord = 0;
@ -20289,6 +20430,9 @@ void initialize_screen(int *argc, char **argv, XImage *fb) {
screen->ptrAddEvent = pointer;
screen->setXCutText = xcut_receive;
if (filexfer) {
rfbRegisterTightVNCFileTransferExtension();
}
rfbInitServer(screen);
if (viewonly_passwd) {
@ -21013,10 +21157,7 @@ void solid_bg(int restore) {
*/
/* blacked-out region (-blackout, -xinerama) */
typedef struct bout {
int x1, y1, x2, y2;
} blackout_t;
#define BO_MAX 16
#define BO_MAX 32
typedef struct tbout {
blackout_t bo[BO_MAX]; /* hardwired max rectangles. */
int cover;
@ -21036,10 +21177,15 @@ void initialize_blackouts(char *list) {
char *p, *blist = strdup(list);
int x, y, X, Y, h, w, t;
blackouts = 0;
p = strtok(blist, ", \t");
while (p) {
if (!strcmp("noptr", p)) {
blackout_ptr = 1;
rfbLog("pointer will be blocked from blackout "
"regions\n");
p = strtok(NULL, ", \t");
continue;
}
if (! parse_geom(p, &w, &h, &x, &y, dpy_x, dpy_y)) {
if (*p != '\0') {
rfbLog("skipping invalid geometry: %s\n", p);
@ -21325,6 +21471,10 @@ void initialize_xinerama (void) {
}
void initialize_blackouts_and_xinerama(void) {
blackouts = 0;
blackout_ptr = 0;
if (blackout_str != NULL) {
initialize_blackouts(blackout_str);
}
@ -23693,6 +23843,16 @@ int scan_for_updates(int count_only) {
double frac1 = 0.1; /* tweak parameter to try a 2nd scan_display() */
double frac2 = 0.35; /* or 3rd */
double frac3 = 0.02; /* do scan_display() again after copy_tiles() */
static double last_poll = 0.0;
if (slow_fb > 0.0) {
double now = dnow();
if (now < last_poll + slow_fb) {
return 0;
}
last_poll = now;
}
for (i=0; i < ntiles; i++) {
tile_has_diff[i] = 0;
tile_has_xdamage_diff[i] = 0;
@ -24130,12 +24290,16 @@ void run_gui(char *gui_xdisplay, int connect_to_x11vnc, int start_x11vnc,
}
usleep(2200*1000);
fprintf(stderr, "\n");
rfbLog("gui: trying to contact a x11vnc server at X display "
"%s ...\n", NONUL(x11vnc_xdisplay));
if (!quiet) {
rfbLog("gui: trying to contact a x11vnc server at X"
" display %s ...\n", NONUL(x11vnc_xdisplay));
}
for (i=0; i<try_max; i++) {
usleep(sleep*1000);
rfbLog("gui: pinging %s try=%d ...\n",
NONUL(x11vnc_xdisplay), i+1);
if (!quiet) {
rfbLog("gui: pinging %s try=%d ...\n",
NONUL(x11vnc_xdisplay), i+1);
}
rc = send_remote_cmd("qry=ping", 1, 1);
if (rc == 0) {
break;
@ -24424,7 +24588,10 @@ void do_gui(char *opts, int sleep) {
" to display on.\n");
exit(1);
}
fprintf(stderr, "starting gui, trying display: %s\n", gui_xdisplay);
if (!quiet) {
fprintf(stderr, "starting gui, trying display: %s\n",
gui_xdisplay);
}
test_dpy = XOpenDisplay(gui_xdisplay);
if (! test_dpy && auth_file) {
if (getenv("XAUTHORITY") != NULL) {
@ -27389,6 +27556,17 @@ int try_copyrect(Window frame, int x, int y, int w, int h, int dx, int dy,
y2 = crfix(nfix(y+h, dpy_y+1), dy, dpy_y+1);
rect = sraRgnCreateRect(x1, y1, x2, y2);
if (blackouts) {
int i;
sraRegionPtr bo_rect;
for (i=0; i<blackouts; i++) {
bo_rect = sraRgnCreateRect(blackr[i].x1,
blackr[i].y1, blackr[i].x2, blackr[i].y2);
sraRgnSubtract(rect, bo_rect);
sraRgnDestroy(bo_rect);
}
}
do_copyregion(rect, dx, dy);
sraRgnDestroy(rect);
@ -27440,12 +27618,17 @@ saw_me = 1; fprintf(stderr, " ----------\n");
break;
}
}
#if 0
fprintf(stderr, "bo: %d/%lx\n", k, swin);
#endif
/* skip some unwanted cases: */
if (swin == None) {
continue;
}
if (! stack_list[k].fetched ||
if (swin < 10) {
; /* blackouts */
} else if (! stack_list[k].fetched ||
stack_list[k].time > tm + 2.0) {
if (!valid_window(swin, &attr, 1)) {
stack_list[k].valid = 0;
@ -29214,6 +29397,8 @@ void measure_send_rates(int init) {
rfbClientPtr cl;
int db = 0, msg = 0;
db = 0;
if (! measure_speeds) {
return;
}
@ -30090,6 +30275,7 @@ static void print_help(int mode) {
" option, otherwise the stderr goes to the viewer which\n"
" will cause it to abort. Specifying both -inetd and -q\n"
" and no -o will automatically close the stderr.\n"
"-filexfer Enable the TightVNC file transfer extension.\n"
"-http Instead of using -httpdir (see below) to specify\n"
" where the Java vncviewer applet is, have x11vnc try\n"
" to *guess* where the directory is by looking relative\n"
@ -30336,7 +30522,9 @@ static void print_help(int mode) {
" color with \"gnome:\", \"kde:\", \"cde:\" or \"root:\".\n"
"-blackout string Black out rectangles on the screen. \"string\" is a\n"
" comma separated list of WxH+X+Y type geometries for\n"
" each rectangle.\n"
" each rectangle. If one of the items on the list is the\n"
" string \"noptr\" the mouse pointer will not be allowed\n"
" to go into a blacked out region.\n"
"-xinerama If your screen is composed of multiple monitors\n"
" glued together via XINERAMA, and that screen is\n"
" not a rectangle this option will try to guess the\n"
@ -31133,6 +31321,10 @@ static void print_help(int mode) {
" (3 screen polls in a row each longer than 0.25 sec with\n"
" no user input), and sleep up to 1.5 secs to let things\n"
" \"catch up\". Use this option to disable that detection.\n"
"-slow_fb time Floating point time in seconds delay all screen polling.\n"
" For special purpose usage where a low frame rate is\n"
" acceptable and desirable, but you want the user input\n"
" processed at the normal rate so you cannot use -wait.\n"
"-readtimeout n Set libvncserver rfbMaxClientWait to n seconds. On\n"
" slow links that take a long time to paint the first\n"
" screen libvncserver may hit the timeout and drop the\n"
@ -31583,6 +31775,7 @@ static void print_help(int mode) {
" wait_ui:f set -wait_ui factor to f.\n"
" wait_bog disable -nowait_bog mode.\n"
" nowait_bog enable -nowait_bog mode.\n"
" slow_fb:f set -slow_fb to f seconds.\n"
" readtimeout:n set read timeout to n seconds.\n"
" nap enable -nap mode.\n"
" nonap disable -nap mode.\n"
@ -31696,14 +31889,14 @@ static void print_help(int mode) {
" nodragging wireframe_mode wireframe wf nowireframe\n"
" nowf wirecopyrect wcr nowirecopyrect nowcr scr_area\n"
" scr_skip scr_inc scr_keys scr_term scr_keyrepeat\n"
" scr_parms scrollcopyrect scr noscrollcopyrect\n"
" noscr fixscreen noxrecord xrecord reset_record\n"
" pointer_mode pm input_skip input client_input\n"
" speeds wmdt debug_pointer dp nodebug_pointer nodp\n"
" debug_keyboard dk nodebug_keyboard nodk deferupdate\n"
" defer wait_ui wait_bog nowait_bog wait readtimeout\n"
" nap nonap sb screen_blank fs gaps grow fuzz snapfb\n"
" nosnapfb rawfb progressive rfbport http nohttp httpport\n"
" scr_parms scrollcopyrect scr noscrollcopyrect noscr\n"
" fixscreen noxrecord xrecord reset_record pointer_mode\n"
" pm input_skip input client_input speeds wmdt\n"
" debug_pointer dp nodebug_pointer nodp debug_keyboard\n"
" dk nodebug_keyboard nodk deferupdate defer wait_ui\n"
" wait_bog nowait_bog slow_fb wait readtimeout nap nonap\n"
" sb screen_blank fs gaps grow fuzz snapfb nosnapfb\n"
" rawfb progressive rfbport http nohttp httpport\n"
" httpdir enablehttpproxy noenablehttpproxy alwaysshared\n"
" noalwaysshared nevershared noalwaysshared dontdisconnect\n"
" nodontdisconnect desktop debug_xevents nodebug_xevents\n"
@ -32385,6 +32578,7 @@ void print_settings(int try_http, int bg, char *gui_str) {
fprintf(stderr, " conn_once: %d\n", connect_once);
fprintf(stderr, " timeout: %d\n", first_conn_timeout);
fprintf(stderr, " inetd: %d\n", inetd);
fprintf(stderr, " filexfer: %d\n", filexfer);
fprintf(stderr, " http: %d\n", try_http);
fprintf(stderr, " connect: %s\n", client_connect
? client_connect : "null");
@ -32498,6 +32692,7 @@ void print_settings(int try_http, int bg, char *gui_str) {
fprintf(stderr, " waitms: %d\n", waitms);
fprintf(stderr, " wait_ui: %.2f\n", wait_ui);
fprintf(stderr, " nowait_bog: %d\n", !wait_bog);
fprintf(stderr, " slow_fb: %.2f\n", slow_fb);
fprintf(stderr, " readtimeout: %d\n", rfbMaxClientWait/1000);
fprintf(stderr, " take_naps: %d\n", take_naps);
fprintf(stderr, " sb: %d\n", screen_blank);
@ -32590,20 +32785,27 @@ void nopassword_warning_msg(int gotloc) {
"#@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@#\n"
"###############################################################\n"
;
if (quiet) {
char str5[] =
"###############################################################\n\n"
;
if (inetd) {
return;
}
fprintf(stderr, "%s", str1);
fflush(stderr);
#if !PASSWD_REQUIRED
usleep(2000 * 1000);
usleep(2500 * 1000);
#endif
fprintf(stderr, "%s", str2);
if (gotloc) {
fprintf(stderr, "%s", str3);
if (!quiet) {
fprintf(stderr, "%s", str2);
if (gotloc) {
fprintf(stderr, "%s", str3);
}
fprintf(stderr, "%s", str4);
} else {
fprintf(stderr, "%s", str5);
}
fprintf(stderr, "%s", str4);
fflush(stderr);
#if !PASSWD_REQUIRED
usleep(500 * 1000);
@ -32763,6 +32965,8 @@ int main(int argc, char* argv[]) {
users_list = strdup(argv[++i]);
} else if (!strcmp(arg, "-inetd")) {
inetd = 1;
} else if (!strcmp(arg, "-filexfer")) {
filexfer = 1;
} else if (!strcmp(arg, "-http")) {
try_http = 1;
} else if (!strcmp(arg, "-connect")) {
@ -33103,6 +33307,9 @@ int main(int argc, char* argv[]) {
wait_ui = atof(argv[++i]);
} else if (!strcmp(arg, "-nowait_bog")) {
wait_bog = 0;
} else if (!strcmp(arg, "-slow_fb")) {
CHECK_ARGC
slow_fb = atof(argv[++i]);
} else if (!strcmp(arg, "-readtimeout")) {
CHECK_ARGC
rfbMaxClientWait = atoi(argv[++i]) * 1000;
@ -33283,6 +33490,7 @@ int main(int argc, char* argv[]) {
}
}
}
if (launch_gui && (query_cmd || remote_cmd)) {
launch_gui = 0;
gui_str = NULL;
@ -33472,7 +33680,8 @@ int main(int argc, char* argv[]) {
exit(1);
}
if (!got_passwd && !got_rfbauth && !got_passwdfile) {
if (!got_passwd && !got_rfbauth && !got_passwdfile &&
!query_cmd && !remote_cmd) {
char message[] =
"-rfbauth, -passwdfile, or -passwd password required.";
if (! nopw) {
@ -33569,7 +33778,7 @@ int main(int argc, char* argv[]) {
if (nofb) {
/* disable things that do not make sense with no fb */
set_nofb_params();
set_nofb_params(0);
if (! got_deferupdate && ! got_defer) {
/* reduce defer time under -nofb */

Loading…
Cancel
Save