x11vnc: synchronous mode for -remote, string cleanup

pull/1/head
runge 20 years ago
parent f28038b28a
commit 2cc1b1d3e7

@ -1,3 +1,7 @@
2004-12-19 Karl Runge <runge@karlrunge.com>
* x11vnc: string cleanup, synchronous remote-control option -sync
* libvncserver/cursor.c: zero underCursorBufferLen when cursor freed.
2004-12-16 Karl Runge <runge@karlrunge.com>
* test/encodingstest.c: fix decl bug in main()
* x11vnc: use XFIXES extension to show the exact cursor shape.

@ -529,6 +529,7 @@ void rfbSetCursor(rfbScreenInfoPtr rfbScreen,rfbCursorPtr c,rfbBool freeOld)
free(rfbScreen->underCursorBuffer);
rfbScreen->underCursorBuffer=0;
rfbScreen->underCursorBufferLen=0;
if(rfbScreen->cursor && (freeOld || rfbScreen->cursor->cleanup))
rfbFreeCursor(rfbScreen->cursor);

@ -1,3 +1,8 @@
2004-12-19 Karl Runge <runge@karlrunge.com>
* cleanup putenv, snprint, other string manip.
* add -sync mode to remote control for better control
* allow -remote and -query at same time.
2004-12-16 Karl Runge <runge@karlrunge.com>
* support for XFIXES extension to show the exact cursor shape,
working on Linux/Xorg and Solaris 10. disable with -noxfixes

File diff suppressed because it is too large Load Diff

@ -47,6 +47,7 @@ catch {rename send {}}
# Q means it is an action worth querying after running.
# D means it is a good idea to delay a little before querying
# (i.e. perhaps it causes x11vnc to do a lot of work, new fb)
# No longer used, -sync is used instead.
# P means the string can be +/- appended/deleted (string may not
# be the same after the remote command)
# G means gui internal item
@ -839,7 +840,8 @@ proc entry_delete {} {
# Utilities for remote control and updating vars.
proc push_new_value {item name new {query 1}} {
proc push_new_value0 {item name new {query 1}} {
# old way w/o -sync
global menu_var always_update remote_output query_output
global delay_sleep extra_sleep extra_sleep_split
@ -953,6 +955,125 @@ proc push_new_value {item name new {query 1}} {
}
}
proc push_new_value {item name new {query 1}} {
global menu_var always_update remote_output query_output
global delay_sleep extra_sleep extra_sleep_split
global query_result_list
set debug [in_debug_mode]
set getout 0
set print_getout 0;
set do_query_all 0
set newnew ""
if {$item == "disconnect"} {
set newnew "N/A"
set do_query_all 1
} elseif {$always_update} {
set do_query_all 1
}
if {$item == "remote-cmd"} {
# kludge for arbitrary remote command:
if {[regexp {^Q:} $new]} {
# extra kludge for Q:var to mean -Q var
regsub {^Q:} $new "" new
set qonly 1
} else {
set qonly 0
}
# need to extract item from new:
set qtmp $new
regsub {:.*$} $qtmp "" qtmp
if {$qonly} {
set rargs [list "-Q" "$qtmp"]
set print_getout 1
set qargs ""
} else {
set rargs [list "-R" "$new"]
set qargs ""
}
set getout 1
} elseif {[value_is_string $item]} {
# string var:
set rargs [list "-R" "$name:$new"]
set qargs [list "-Q" "$name"]
} else {
# boolean var:
set rargs [list "-R" "$name"]
set qargs [list "-Q" "$name"]
}
if {! $query && ! $always_update} {
set getout 1
} elseif {$item == "noremote"} {
set getout 1
} elseif {[is_action $item] && ![opt_match Q $item] && $rargs != ""} {
set getout 1
} elseif {[regexp {^(sid|id)$} $item] && ![regexp {^0x} $new]} {
set getout 1
}
set remote_output ""
set query_output ""
if {!$debug} {
append_text "x11vnc $rargs ..."
}
if {$getout} {
set remote_output [run_remote_cmd $rargs]
if {$print_getout} {
append_text "\t$remote_output"
}
append_text "\n"
return
}
if {$do_query_all} {
set all [all_query_vars]
set qargs [list "-Q" $all]
}
set rqargs [concat $rargs $qargs]
set query [run_remote_cmd $rqargs]
set query_output $query
set query_result_list ""
if {$newnew != ""} {
set new $newnew
}
if {![see_if_ok $query $item "$name:$new"]} {
# failed
if {[regexp {^a..=} $query]} {
# but some result came back
# synchronize everything with a 2nd call.
set query_output [query_all 1]
} else {
# server may be dead
if {$item != "ping" && $item != "attach"} {
try_connect
}
}
} else {
# succeeded
# synchronize this variable (or variables)
# for a speedup used the list parsed by see_if_ok.
update_menu_vars "USE_LIST"
if {$do_query_all} {
global all_settings
set all_settings $query
}
}
}
# For updating a string variable. Also used for simple OK/Skip dialogs
# with entry = 0.
proc entry_dialog {item {entry 1}} {
@ -1042,14 +1163,25 @@ proc check_var {item} {
}
proc see_if_ok {query item expected} {
global query_result_list
set ok 0
set found ""
foreach q [split_query $query] {
if {[regexp "^$item:" $q]} {
set query_result_list [split_query $query]
foreach q $query_result_list {
# if {[regexp "^$item:" $q]} {
# set found $q
# }
if {[string first "$item:" $q] == 0} {
set found $q
}
if {$q == $expected} {
set ok 1
if {$found != ""} {
break;
}
}
}
if {$found == ""} {
@ -1076,23 +1208,26 @@ proc see_if_ok {query item expected} {
}
proc update_menu_vars {{query ""}} {
global all_settings menu_var
global all_settings menu_var query_result_list
set debug [in_debug_mode]
if {$query == ""} {
set qstr $all_settings
if {$query == "USE_LIST"} {
;
} elseif {$query == ""} {
set query_result_list [split_query $all_settings]
} else {
set qstr $query
set query_result_list [split_query $query]
}
foreach piece [split_query $qstr] {
foreach piece $query_result_list {
if {[regexp {^([^:][^:]*):(.*)$} $piece m0 item val]} {
if {[info exists menu_var($item)]} {
set old $menu_var($item)
if {$val == "N/A"} {
continue
}
if {$debug} {
if {0 && $debug} {
puts "setting menuvar: $item: $old -> $val"
}
set menu_var($item) $val
@ -1127,7 +1262,12 @@ proc clear_all {} {
proc all_query_vars {} {
global query_ans_list query_aro_list all_settings
global cache_all_query_vars
if {$cache_all_query_vars != ""} {
return $cache_all_query_vars
}
set qry ""
foreach item $query_ans_list {
if {$qry == ""} {
@ -1143,6 +1283,8 @@ proc all_query_vars {} {
append qry ",$item"
}
}
set cache_all_query_vars $qry
return $qry
}
@ -1151,8 +1293,6 @@ proc query_all {{quiet 0}} {
set qry [all_query_vars]
#puts "into query_all $quiet"
set qargs [list "-Q" $qry]
set all [run_remote_cmd $qargs]
@ -1282,13 +1422,25 @@ proc do_action {item} {
}
}
proc ptime {time} {
set usec [lindex [split $time] 0]
set sec [format "%.3f" [expr "$usec / 1000000.0"]]
puts "time: $sec secs."
}
proc do_var {item} {
global connected_to_x11vnc item_cascade menu_var
set debug [in_debug_mode]
set string 0
if {[is_action $item]} {
# Menu item is action:
do_action $item
if {$debug} {
ptime [time {do_action $item}]
} else {
do_action $item
}
return
}
@ -1313,7 +1465,11 @@ proc do_var {item} {
set new 1
}
if {$connected_to_x11vnc} {
push_new_value $item $name $new 1
if {$debug} {
ptime [time {push_new_value $item $name $new 1}]
} else {
push_new_value $item $name $new 1
}
}
}
@ -1364,7 +1520,8 @@ proc value_is_bool {item} {
}
}
proc split_query {query} {
proc split_query0 {query} {
# original slower way with regexp/regsub
regsub -all {aro=} $query {ans=} query
set items {}
while {1} {
@ -1384,6 +1541,38 @@ proc split_query {query} {
return $items
}
proc split_query {query} {
regsub -all {aro=} $query {ans=} query
set items {}
while {1} {
set n [string first "ans=" $query]
if {$n < 0} {
break
}
set from [expr $n+4]
set m [string first ",ans=" $query]
if {$m < 0} {
set more 0
set item [string range $query $from end]
} else {
set more 1
set to [expr $m-1]
set item [string range $query $from $to]
}
if {$item != ""} {
lappend items $item
}
if {$more} {
incr m
set query [string range $query $m end]
} else {
set query ""
}
}
return $items
}
proc set_x11_display {name} {
global x11_display
set x11_display "x11vnc X display: $name"
@ -1398,6 +1587,7 @@ proc no_x11_display {} {
proc no_vnc_display {} {
set_vnc_display "(*none*)"
}
proc fetch_displays {} {
set qargs [list "-Q" "display,vncdisplay"]
@ -1899,6 +2089,8 @@ proc get_start_x11vnc_cmd {} {
lappend cmd $x11vnc_prog
set saw_id 0
foreach item [lsort [array names menu_var]] {
if {![active_when_starting $item]} {
continue
@ -1906,6 +2098,27 @@ proc get_start_x11vnc_cmd {} {
if {[is_action $item]} {
continue
}
if {$item == "debug_gui"} {
continue
}
if {$item == "id" || $item == "sid"} {
set val $menu_var($item);
if {$val == "0x0" || $val == "root"} {
continue
}
}
if {$item == "sid" && $saw_id} {
continue
}
if {$item == "id"} {
set saw_id 1
}
if {$item == "progressive" && $menu_var($item) == "0"} {
continue
}
if {$item == "dontdisconnect" && $menu_var($item) == "-1"} {
continue
}
if {[value_is_bool $item]} {
if {[info exists menu_var($item)]} {
@ -1917,7 +2130,11 @@ proc get_start_x11vnc_cmd {} {
if {[info exists menu_var($item)]} {
if {$menu_var($item) != ""
&& $menu_var($item) != $unset_str} {
lappend cmd "-$item"
set nitem $item
if {$nitem == "screen_blank"} {
set nitem "sb"
}
lappend cmd "-$nitem"
lappend cmd $menu_var($item)
}
}
@ -1996,6 +2213,7 @@ proc run_remote_cmd {opts} {
lappend cmd "-display"
lappend cmd $x11vnc_xdisplay
}
lappend cmd "-sync"
foreach word $opts {
lappend cmd $word
}
@ -2011,11 +2229,18 @@ if {0} {
}
set output ""
menus_disable
stop_watch on
catch {set output [eval exec $cmd]}
stop_watch off
menus_enable
if {$debug} {
append_text "output: $output\n"
if {[string length $output] > 100} {
set str [string range $output 0 100]
append_text "output: $str ...\n"
} else {
append_text "output: $output\n"
}
}
return $output
}
@ -2083,6 +2308,7 @@ global menu_var unset_str
global bfont
global connected_to_x11vnc
global delay_sleep extra_sleep extra_sleep_split
global cache_all_query_vars
set unset_str "(unset)"
set connected_to_x11vnc 0
@ -2093,9 +2319,9 @@ set help_indent 24;
set reply_xdisplay ""
set all_settings "None so far."
set always_update 1
set cache_all_query_vars ""
#set delay_sleep 500
#set extra_sleep 1500
# these are no longer used under x11vnc -sync:
set delay_sleep 350
set extra_sleep 1000
set extra_sleep_split 4

@ -53,6 +53,7 @@
"# Q means it is an action worth querying after running.\n"
"# D means it is a good idea to delay a little before querying \n"
"# (i.e. perhaps it causes x11vnc to do a lot of work, new fb)\n"
"# No longer used, -sync is used instead.\n"
"# P means the string can be +/- appended/deleted (string may not\n"
"# be the same after the remote command)\n"
"# G means gui internal item\n"
@ -845,7 +846,8 @@
"\n"
"# Utilities for remote control and updating vars.\n"
"\n"
"proc push_new_value {item name new {query 1}} {\n"
"proc push_new_value0 {item name new {query 1}} {\n"
" # old way w/o -sync\n"
" global menu_var always_update remote_output query_output\n"
" global delay_sleep extra_sleep extra_sleep_split\n"
"\n"
@ -959,6 +961,125 @@
" }\n"
"}\n"
"\n"
"proc push_new_value {item name new {query 1}} {\n"
" global menu_var always_update remote_output query_output\n"
" global delay_sleep extra_sleep extra_sleep_split\n"
" global query_result_list\n"
"\n"
" set debug [in_debug_mode]\n"
"\n"
" set getout 0\n"
" set print_getout 0;\n"
"\n"
" set do_query_all 0\n"
"\n"
" set newnew \"\"\n"
" if {$item == \"disconnect\"} {\n"
" set newnew \"N/A\"\n"
" set do_query_all 1\n"
" } elseif {$always_update} {\n"
" set do_query_all 1\n"
" }\n"
"\n"
" if {$item == \"remote-cmd\"} {\n"
" # kludge for arbitrary remote command:\n"
" if {[regexp {^Q:} $new]} {\n"
" # extra kludge for Q:var to mean -Q var\n"
" regsub {^Q:} $new \"\" new\n"
" set qonly 1\n"
" } else {\n"
" set qonly 0\n"
" }\n"
" # need to extract item from new:\n"
" set qtmp $new\n"
" regsub {:.*$} $qtmp \"\" qtmp\n"
" if {$qonly} {\n"
" set rargs [list \"-Q\" \"$qtmp\"]\n"
" set print_getout 1\n"
" set qargs \"\"\n"
" } else {\n"
" set rargs [list \"-R\" \"$new\"]\n"
" set qargs \"\"\n"
" }\n"
" set getout 1\n"
"\n"
" } elseif {[value_is_string $item]} {\n"
" # string var:\n"
" set rargs [list \"-R\" \"$name:$new\"]\n"
" set qargs [list \"-Q\" \"$name\"]\n"
" } else {\n"
" # boolean var:\n"
" set rargs [list \"-R\" \"$name\"]\n"
" set qargs [list \"-Q\" \"$name\"]\n"
" }\n"
"\n"
" if {! $query && ! $always_update} {\n"
" set getout 1\n"
" } elseif {$item == \"noremote\"} {\n"
" set getout 1\n"
" } elseif {[is_action $item] && ![opt_match Q $item] && $rargs != \"\"} {\n"
" set getout 1\n"
" } elseif {[regexp {^(sid|id)$} $item] && ![regexp {^0x} $new]} {\n"
" set getout 1\n"
" }\n"
"\n"
" set remote_output \"\"\n"
" set query_output \"\"\n"
"\n"
" if {!$debug} {\n"
" append_text \"x11vnc $rargs ...\"\n"
" }\n"
"\n"
" if {$getout} {\n"
" set remote_output [run_remote_cmd $rargs]\n"
" if {$print_getout} {\n"
" append_text \"\\t$remote_output\"\n"
" }\n"
" append_text \"\\n\"\n"
" return\n"
" }\n"
"\n"
" if {$do_query_all} {\n"
" set all [all_query_vars]\n"
" set qargs [list \"-Q\" $all]\n"
" }\n"
"\n"
" set rqargs [concat $rargs $qargs]\n"
"\n"
" set query [run_remote_cmd $rqargs]\n"
" set query_output $query\n"
"\n"
" set query_result_list \"\"\n"
"\n"
" if {$newnew != \"\"} {\n"
" set new $newnew\n"
" }\n"
"\n"
" if {![see_if_ok $query $item \"$name:$new\"]} {\n"
" # failed\n"
" if {[regexp {^a..=} $query]} {\n"
" # but some result came back\n"
" # synchronize everything with a 2nd call.\n"
" set query_output [query_all 1]\n"
" } else {\n"
" # server may be dead\n"
" if {$item != \"ping\" && $item != \"attach\"} {\n"
" try_connect\n"
" }\n"
" }\n"
" } else {\n"
" # succeeded\n"
" # synchronize this variable (or variables)\n"
" # for a speedup used the list parsed by see_if_ok.\n"
" update_menu_vars \"USE_LIST\"\n"
"\n"
" if {$do_query_all} {\n"
" global all_settings\n"
" set all_settings $query\n"
" }\n"
" }\n"
"}\n"
"\n"
"# For updating a string variable. Also used for simple OK/Skip dialogs\n"
"# with entry = 0.\n"
"proc entry_dialog {item {entry 1}} {\n"
@ -1048,14 +1169,25 @@
"}\n"
"\n"
"proc see_if_ok {query item expected} {\n"
" global query_result_list\n"
"\n"
" set ok 0\n"
" set found \"\"\n"
" foreach q [split_query $query] {\n"
" if {[regexp \"^$item:\" $q]} {\n"
"\n"
" set query_result_list [split_query $query]\n"
"\n"
" foreach q $query_result_list {\n"
"# if {[regexp \"^$item:\" $q]} {\n"
"# set found $q\n"
"# }\n"
" if {[string first \"$item:\" $q] == 0} {\n"
" set found $q\n"
" }\n"
" if {$q == $expected} {\n"
" set ok 1\n"
" if {$found != \"\"} {\n"
" break;\n"
" }\n"
" }\n"
" }\n"
" if {$found == \"\"} {\n"
@ -1082,23 +1214,26 @@
"}\n"
"\n"
"proc update_menu_vars {{query \"\"}} {\n"
" global all_settings menu_var\n"
" global all_settings menu_var query_result_list\n"
"\n"
" set debug [in_debug_mode]\n"
"\n"
" if {$query == \"\"} {\n"
" set qstr $all_settings\n"
" if {$query == \"USE_LIST\"} {\n"
" ;\n"
" } elseif {$query == \"\"} {\n"
" set query_result_list [split_query $all_settings]\n"
" } else {\n"
" set qstr $query\n"
" set query_result_list [split_query $query]\n"
" }\n"
" foreach piece [split_query $qstr] {\n"
"\n"
" foreach piece $query_result_list {\n"
" if {[regexp {^([^:][^:]*):(.*)$} $piece m0 item val]} {\n"
" if {[info exists menu_var($item)]} {\n"
" set old $menu_var($item)\n"
" if {$val == \"N/A\"} {\n"
" continue\n"
" }\n"
" if {$debug} {\n"
" if {0 && $debug} {\n"
" puts \"setting menuvar: $item: $old -> $val\"\n"
" }\n"
" set menu_var($item) $val\n"
@ -1133,7 +1268,12 @@
"\n"
"proc all_query_vars {} {\n"
" global query_ans_list query_aro_list all_settings\n"
" global cache_all_query_vars\n"
" \n"
" if {$cache_all_query_vars != \"\"} {\n"
" return $cache_all_query_vars\n"
" }\n"
"\n"
" set qry \"\"\n"
" foreach item $query_ans_list {\n"
" if {$qry == \"\"} {\n"
@ -1149,6 +1289,8 @@
" append qry \",$item\"\n"
" }\n"
" }\n"
" set cache_all_query_vars $qry\n"
"\n"
" return $qry\n"
"}\n"
"\n"
@ -1157,8 +1299,6 @@
"\n"
" set qry [all_query_vars]\n"
"\n"
" #puts \"into query_all $quiet\"\n"
"\n"
" set qargs [list \"-Q\" $qry]\n"
" set all [run_remote_cmd $qargs]\n"
"\n"
@ -1288,13 +1428,25 @@
" }\n"
"}\n"
"\n"
"proc ptime {time} {\n"
" set usec [lindex [split $time] 0]\n"
" set sec [format \"%.3f\" [expr \"$usec / 1000000.0\"]]\n"
" puts \"time: $sec secs.\"\n"
"}\n"
"\n"
"proc do_var {item} {\n"
" global connected_to_x11vnc item_cascade menu_var\n"
"\n"
" set debug [in_debug_mode]\n"
"\n"
" set string 0\n"
" if {[is_action $item]} {\n"
" # Menu item is action:\n"
" do_action $item\n"
" if {$debug} {\n"
" ptime [time {do_action $item}]\n"
" } else {\n"
" do_action $item\n"
" }\n"
" return\n"
" }\n"
"\n"
@ -1319,7 +1471,11 @@
" set new 1\n"
" }\n"
" if {$connected_to_x11vnc} {\n"
" push_new_value $item $name $new 1\n"
" if {$debug} {\n"
" ptime [time {push_new_value $item $name $new 1}]\n"
" } else {\n"
" push_new_value $item $name $new 1\n"
" }\n"
" }\n"
"}\n"
"\n"
@ -1370,7 +1526,8 @@
" }\n"
"}\n"
"\n"
"proc split_query {query} {\n"
"proc split_query0 {query} {\n"
" # original slower way with regexp/regsub\n"
" regsub -all {aro=} $query {ans=} query\n"
" set items {}\n"
" while {1} {\n"
@ -1390,6 +1547,38 @@
" return $items\n"
"}\n"
"\n"
"proc split_query {query} {\n"
" regsub -all {aro=} $query {ans=} query\n"
" set items {}\n"
" while {1} {\n"
" set n [string first \"ans=\" $query]\n"
" if {$n < 0} {\n"
" break\n"
" }\n"
" set from [expr $n+4]\n"
"\n"
" set m [string first \",ans=\" $query]\n"
" if {$m < 0} {\n"
" set more 0\n"
" set item [string range $query $from end]\n"
" } else {\n"
" set more 1\n"
" set to [expr $m-1]\n"
" set item [string range $query $from $to]\n"
" }\n"
" if {$item != \"\"} {\n"
" lappend items $item\n"
" }\n"
" if {$more} {\n"
" incr m\n"
" set query [string range $query $m end]\n"
" } else {\n"
" set query \"\"\n"
" }\n"
" }\n"
" return $items\n"
"}\n"
"\n"
"proc set_x11_display {name} {\n"
" global x11_display\n"
" set x11_display \"x11vnc X display: $name\"\n"
@ -1404,6 +1593,7 @@
"proc no_vnc_display {} {\n"
" set_vnc_display \"(*none*)\"\n"
"}\n"
"\n"
"proc fetch_displays {} {\n"
"\n"
" set qargs [list \"-Q\" \"display,vncdisplay\"]\n"
@ -1905,6 +2095,8 @@
"\n"
" lappend cmd $x11vnc_prog\n"
"\n"
" set saw_id 0\n"
"\n"
" foreach item [lsort [array names menu_var]] {\n"
" if {![active_when_starting $item]} {\n"
" continue\n"
@ -1912,6 +2104,27 @@
" if {[is_action $item]} {\n"
" continue\n"
" }\n"
" if {$item == \"debug_gui\"} {\n"
" continue\n"
" }\n"
" if {$item == \"id\" || $item == \"sid\"} {\n"
" set val $menu_var($item);\n"
" if {$val == \"0x0\" || $val == \"root\"} {\n"
" continue\n"
" }\n"
" }\n"
" if {$item == \"sid\" && $saw_id} {\n"
" continue\n"
" }\n"
" if {$item == \"id\"} {\n"
" set saw_id 1\n"
" }\n"
" if {$item == \"progressive\" && $menu_var($item) == \"0\"} {\n"
" continue\n"
" }\n"
" if {$item == \"dontdisconnect\" && $menu_var($item) == \"-1\"} {\n"
" continue\n"
" }\n"
"\n"
" if {[value_is_bool $item]} {\n"
" if {[info exists menu_var($item)]} {\n"
@ -1923,7 +2136,11 @@
" if {[info exists menu_var($item)]} {\n"
" if {$menu_var($item) != \"\"\n"
" && $menu_var($item) != $unset_str} {\n"
" lappend cmd \"-$item\"\n"
" set nitem $item\n"
" if {$nitem == \"screen_blank\"} {\n"
" set nitem \"sb\"\n"
" }\n"
" lappend cmd \"-$nitem\"\n"
" lappend cmd $menu_var($item)\n"
" }\n"
" }\n"
@ -2002,6 +2219,7 @@
" lappend cmd \"-display\"\n"
" lappend cmd $x11vnc_xdisplay\n"
" }\n"
" lappend cmd \"-sync\"\n"
" foreach word $opts {\n"
" lappend cmd $word\n"
" }\n"
@ -2017,11 +2235,18 @@
"}\n"
"\n"
" set output \"\"\n"
" menus_disable\n"
" stop_watch on\n"
" catch {set output [eval exec $cmd]}\n"
" stop_watch off\n"
" menus_enable\n"
" if {$debug} {\n"
" append_text \"output: $output\\n\"\n"
" if {[string length $output] > 100} {\n"
" set str [string range $output 0 100]\n"
" append_text \"output: $str ...\\n\"\n"
" } else {\n"
" append_text \"output: $output\\n\"\n"
" }\n"
" }\n"
" return $output\n"
"}\n"
@ -2089,6 +2314,7 @@
"global bfont\n"
"global connected_to_x11vnc\n"
"global delay_sleep extra_sleep extra_sleep_split\n"
"global cache_all_query_vars\n"
"\n"
"set unset_str \"(unset)\"\n"
"set connected_to_x11vnc 0\n"
@ -2099,9 +2325,9 @@
"set reply_xdisplay \"\"\n"
"set all_settings \"None so far.\"\n"
"set always_update 1\n"
"set cache_all_query_vars \"\"\n"
"\n"
"#set delay_sleep 500\n"
"#set extra_sleep 1500\n"
"# these are no longer used under x11vnc -sync:\n"
"set delay_sleep 350\n"
"set extra_sleep 1000\n"
"set extra_sleep_split 4\n"

@ -2,7 +2,7 @@
.TH X11VNC "1" "December 2004" "x11vnc " "User Commands"
.SH NAME
x11vnc - allow VNC connections to real X11 displays
version: 0.6.3pre, lastmod: 2004-12-17
version: 0.6.3pre, lastmod: 2004-12-19
.SH SYNOPSIS
.B x11vnc
[OPTION]...
@ -661,28 +661,36 @@ To include button events use "Button1", ... etc.
.PP
\fB-nodragging\fR
.IP
Do not update the display during mouse dragging events
(mouse motion with a button held down). Greatly
improves response on slow setups, but you lose all
visual feedback for drags, text selection, and some
menu traversals.
Do not update the display during mouse dragging
events (mouse motion with a button held down).
Greatly improves response on slow setups, but you lose
all visual feedback for drags, text selection, and some
menu traversals. It overrides any \fB-pointer_mode\fR setting
(think of it as pointer_mode 0)
.PP
\fB-pointer_mode\fR \fIn\fR
.IP
Various pointer update schemes. The problem is pointer
motion can cause rapid changes on the screen, e.g. a
window drag. Neither x11vnc nor the bandwidth to the
vncviewers can keep up these rapid screen changes:
everything bogs down when dragging or scrolling.
Note that most video h/w is optimized for writing, not
reading (a 50X rate difference is possible) and x11vnc
is reading all the time. So a scheme has to be used to
"eat" much of that pointer input before re-polling the
screen. n can be 1 to 4. n=1 was the original scheme
used to about Jan 2004. n=2 is an improved scheme.
n=3 is basically a dynamic \fB-nodragging\fR mode: it detects
if the mouse drag motion has paused and refreshes
the display. n=4 is TBD. The default n is 2.
window drag. Neither x11vnc's screen polling nor the
bandwidth to the vncviewers can keep up these rapid
screen changes: everything bogs down when dragging
or scrolling. Note that most video h/w is optimized
for writing, not reading (a 50X rate difference is
possible) and x11vnc is reading all the time. So a
scheme has to be used to "eat" much of that pointer
input before re-polling the screen. n can be 1 to 4.
.IP
n=1 was the original scheme used to about Jan 2004: it
basically just skips \fB-input_skip\fR pointer events before
repolling the screen. n=2 is an improved scheme:
by watching the current rate it tries to detect if
it should try to "eat" more pointer events. n=3 is
basically a dynamic \fB-nodragging\fR mode: it detects if the
mouse drag motion has paused and refreshes the display.
n=4 is TBD, it will try measure screen read and client
write rates and try to insert "frames" between the
on/off states of mode 3. The default n is 2.
.PP
\fB-input_skip\fR \fIn\fR
.IP
@ -1157,6 +1165,27 @@ button_mask mouse_x mouse_y bpp depth indexed_color
dpy_x dpy_y rfbport rfbwait rfbauth passwd alwaysshared
dontdisconnect httpdir enablehttpproxy
.PP
\fB-sync\fR
.IP
By default \fB-remote\fR commands are run asynchronously, that
is, the request is posted and the program immediately
exits. Use \fB-sync\fR to have the program wait for an
acknowledgement from the x11vnc server that command
was processed. On the other hand \fB-query\fR requests are
always processed synchronously because they have wait
for the result.
.IP
Also note that if both \fB-remote\fR and \fB-query\fR requests are
supplied on the command line, the \fB-remote\fR is processed
first (synchronously: no need for \fB-sync),\fR and then
the \fB-query\fR request is processed in the normal way.
This allows for a reliable way to see if the \fB-remote\fR
command was processed by querying for any new settings.
Note however that there is timeout of a few seconds so
if the x11vnc takes longer than that to process the
requests the requestor will think that a failure has
taken place.
.PP
\fB-noremote\fR
.IP
Do not process any remote control commands or queries.

File diff suppressed because it is too large Load Diff
Loading…
Cancel
Save