Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
L
libvncserver
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
rasky
libvncserver
Commits
36181297
Commit
36181297
authored
Dec 23, 2004
by
runge
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
x11vnc: minor tweaks for x11vnc 0.7 file release
parent
42adf572
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
359 additions
and
49 deletions
+359
-49
prepare_x11vnc_dist.sh
prepare_x11vnc_dist.sh
+1
-1
ChangeLog
x11vnc/ChangeLog
+4
-0
README
x11vnc/README
+7
-23
tkx11vnc
x11vnc/tkx11vnc
+85
-8
tkx11vnc.h
x11vnc/tkx11vnc.h
+85
-8
x11vnc.1
x11vnc/x11vnc.1
+1
-1
x11vnc.c
x11vnc/x11vnc.c
+176
-8
No files found.
prepare_x11vnc_dist.sh
View file @
36181297
#!/bin/bash
#!/bin/bash
VERSION
=
"0.
6.3
pre"
VERSION
=
"0.
7
pre"
cd
"
$(
dirname
"
$0
"
)
"
cd
"
$(
dirname
"
$0
"
)
"
...
...
x11vnc/ChangeLog
View file @
36181297
2004-12-22 Karl Runge <runge@karlrunge.com>
* final polishing for 0.7 release, tkx11vnc tweaks
* more careful rfbPE in pick_window, start check_user_input4()
2004-12-19 Karl Runge <runge@karlrunge.com>
2004-12-19 Karl Runge <runge@karlrunge.com>
* cleanup putenv, snprint, other string manip.
* cleanup putenv, snprint, other string manip.
* add -sync mode to remote control for better control
* add -sync mode to remote control for better control
...
...
x11vnc/README
View file @
36181297
x11vnc
README
file
Date
:
Mon
Dec
20
11
:
34
:
56
EST
2004
x11vnc
README
file
Date
:
Wed
Dec
22
23
:
18
:
56
EST
2004
The
following
information
is
taken
from
these
URLs
:
The
following
information
is
taken
from
these
URLs
:
...
@@ -895,31 +895,15 @@ int srandom(unsigned int seed);
...
@@ -895,31 +895,15 @@ int srandom(unsigned int seed);
#undef LIBVNCSERVER_HAVE_LIBPTHREAD
#undef LIBVNCSERVER_HAVE_LIBPTHREAD
#define SHUT_RDWR 2
#define SHUT_RDWR 2
typedef unsigned int in_addr_t;
typedef unsigned int in_addr_t;
#define XConvertCase(sym, lower, upper) \
#ifndef snprintf
*(lower) = sym; \
#define snprintf(a, n, args...) sprintf((a), ## args)
*(upper) = sym; \
#endif
if (sym >> 8 == 0) { \
if ((sym >= XK_A) && (sym <= XK_Z)) \
*(lower) += (XK_a - XK_A); \
else if ((sym >= XK_a) && (sym <= XK_z)) \
*(upper) -= (XK_a - XK_A); \
else if ((sym >= XK_Agrave) && (sym <= XK_Odiaeresis)) \
*(lower) += (XK_agrave - XK_Agrave); \
else if ((sym >= XK_agrave) && (sym <= XK_odiaeresis)) \
*(upper) -= (XK_agrave - XK_Agrave); \
else if ((sym >= XK_Ooblique) && (sym <= XK_Thorn)) \
*(lower) += (XK_oslash - XK_Ooblique); \
else if ((sym >= XK_oslash) && (sym <= XK_thorn)) \
*(upper) -= (XK_oslash - XK_Ooblique); \
}
You will also have to change all the snprint() references to sprintf()
calls x11vnc.c (sorry I don'
t
know
how
to
do
this
in
a
macro
since
snprint
()
is
varargs
).
Then run make with the Solaris build script environment, everything
Then run make with the Solaris build script environment, everything
should compile without problems, and the resulting x11vnc binary
should compile without problems, and the resulting x11vnc binary
should
work
OK
(
but
note
the
above
XConvertCase
only
covers
Latin
1
).
should work OK (but note the workaround for XConvertCase in x11vnc.c
only covers Latin 1). If some non-x11vnc related programs fail (e.g.
test programs) and the x11vnc binary is not created try "make -k".
Similar sorts of kludges can be done on other older OS (Solaris,
Similar sorts of kludges can be done on other older OS (Solaris,
Linux, ...) releases.
Linux, ...) releases.
...
...
x11vnc/tkx11vnc
View file @
36181297
...
@@ -73,6 +73,7 @@ Actions
...
@@ -73,6 +73,7 @@ Actions
=RA update-all
=RA update-all
=GA clear-all
=GA clear-all
--
--
=RA stop+quit
=GA Quit
=GA Quit
Help
Help
...
@@ -284,6 +285,10 @@ remote commands are not on a menu, but for those few you can
...
@@ -284,6 +285,10 @@ remote commands are not on a menu, but for those few you can
run the command directly this way. Just enter the command into
run the command directly this way. Just enter the command into
the Entry box when prompted. Use the prefix
\"
Q:
\"
to indicate
the Entry box when prompted. Use the prefix
\"
Q:
\"
to indicate
a -Q query. Examples:
\"
zero:20,20,100,100
\"
,
\"
Q:ext_xfixes
\"
a -Q query. Examples:
\"
zero:20,20,100,100
\"
,
\"
Q:ext_xfixes
\"
"
set
helptext
(
stop+quit
)
"
Send the stop command to the x11vnc server, then terminate the tkx11vnc gui.
"
"
set
helptext
(
Quit
)
"
set
helptext
(
Quit
)
"
...
@@ -778,10 +783,16 @@ proc menus_state {state} {
...
@@ -778,10 +783,16 @@ proc menus_state {state} {
}
}
proc menus_enable
{}
{
proc menus_enable
{}
{
global menus_disabled
menus_state
"normal"
menus_state
"normal"
set
menus_disabled 0
}
}
proc menus_disable
{}
{
proc menus_disable
{}
{
global menus_disabled
set
menus_disabled 1
menus_state
"disabled"
menus_state
"disabled"
}
}
...
@@ -1183,6 +1194,8 @@ proc see_if_ok {query item expected} {
...
@@ -1183,6 +1194,8 @@ proc see_if_ok {query item expected} {
set
query_result_list
[
split_query
$query
]
set
query_result_list
[
split_query
$query
]
foreach q
$query_result_list
{
foreach q
$query_result_list
{
# XXX following will crash if $item is not a good regexp
# need to protect it \Q$item\E style...
# if {[regexp "^$item:" $q]} {
# if {[regexp "^$item:" $q]} {
# set found $q
# set found $q
# }
# }
...
@@ -1409,6 +1422,12 @@ proc do_action {item} {
...
@@ -1409,6 +1422,12 @@ proc do_action {item} {
}
elseif
{
$item
==
"all-settings"
}
{
}
elseif
{
$item
==
"all-settings"
}
{
show_all_settings
show_all_settings
return
return
}
elseif
{
$item
==
"stop+quit"
}
{
push_new_value
"stop"
"stop"
1 0
set_connected no
update
after 500
destroy
.
}
}
if
{[
value_is_string
$item
]}
{
if
{[
value_is_string
$item
]}
{
...
@@ -1656,12 +1675,45 @@ proc disconnect_dialog {client} {
...
@@ -1656,12 +1675,45 @@ proc disconnect_dialog {client} {
}
}
}
}
proc update_clients_and_repost
{}
{
global item_cascade menu_m menu_b
append_text
"Refreshing connected clients list... "
query_all 1
update
set
saw 0
set
casc
$item_cascade
(
current
)
set
last
[
$casc
index end]
for
{
set
i 0
}
{
$i
<
=
$last
}
{
incr i
}
{
if
{[
$casc
type
$i
]
==
"separator"
}
{
continue
}
set
name
[
$casc
entrycget
$i
-label
]
if
{[
regexp
{
^#
}
$name
]}
{
continue
}
if
{[
regexp
{
^refresh-list
}
$name
]}
{
continue
}
if
{!
$saw
}
{
append_text
"
\n
"
}
set
saw 1
append_text
"client:
$name
\n
"
}
if
{!
$saw
}
{
append_text
"done.
\n
"
}
}
proc update_clients_menu
{
list
}
{
proc update_clients_menu
{
list
}
{
global item_cascade
global item_cascade
set
subm
$item_cascade
(
current
)
;
set
subm
$item_cascade
(
current
)
;
catch
{
destroy
$subm
}
catch
{
destroy
$subm
}
menu
$subm
-tearoff
0
menu
$subm
-tearoff
0
$subm
add
command
$subm
add
command
$subm
add
command
-label
"refresh-list"
-command
"update_clients_and_repost"
$subm
add separator
$subm
add separator
set
count 0
set
count 0
foreach client
[
split
$list
","
]
{
foreach client
[
split
$list
","
]
{
...
@@ -1762,7 +1814,16 @@ set v 0
...
@@ -1762,7 +1814,16 @@ set v 0
set
menu
"
$colf
.menu
$case
.menu"
;
set
menu
"
$colf
.menu
$case
.menu"
;
set
menu_b
(
$case
)
$menub
set
menu_b
(
$case
)
$menub
set
menu_m
(
$case
)
$menu
set
menu_m
(
$case
)
$menu
menubutton
$menub
-text
"
$case
"
-underline
0
\
set
ul 0
foreach char
[
split
$case
""
]
{
set
char
[
string tolower
$char
]
if
{![
info exists underlined
(
$char
)]}
{
set
underlined
(
$char
)
1
break
}
incr ul
}
menubutton
$menub
-text
"
$case
"
-underline
$ul
\
-anchor
w
-menu
$menu
-background
$fbg
\
-anchor
w
-menu
$menu
-background
$fbg
\
-font
$bfont
-font
$bfont
pack
$menub
-side
top
-fill
x
pack
$menub
-side
top
-fill
x
...
@@ -2036,16 +2097,31 @@ MenuSelect>>
...
@@ -2036,16 +2097,31 @@ MenuSelect>>
}
}
proc key_bindings {} {
proc key_bindings {} {
global env
global env
menus_disabled
if {[info exists env(USER)] &&
$env
(USER) == "runge"} {
if {[info exists env(USER)] &&
$env
(USER) == "runge"} {
# quick restart
# quick restart
bind . <Control-KeyPress-c> {exec
$argv0
$argv
&; destroy .}
bind . <Control-KeyPress-c> {exec
$argv0
$argv
&; destroy .}
}
}
bind . <Control-KeyPress-p> {try_connect_and_query_all}
bind . <Control-KeyPress-p> { \
bind . <Control-KeyPress-u> {query_all 0}
global menus_disabled; \
bind . <Control-KeyPress-r> {query_all 0}
if {!
$menus_disabled
} {try_connect_and_query_all} \
bind . <Control-KeyPress-d> {detach_from_display}
}
bind . <Control-KeyPress-a> {try_connect_and_query_all}
bind . <Control-KeyPress-u> { \
global menus_disabled; \
if {!
$menus_disabled
} {query_all 0} \
}
bind . <Control-KeyPress-r> { \
global menus_disabled; \
if {!
$menus_disabled
} {query_all 0} \
}
bind . <Control-KeyPress-d> { \
global menus_disabled; \
if {!
$menus_disabled
} {detach_from_display} \
}
bind . <Control-KeyPress-a> { \
global menus_disabled; \
if {!
$menus_disabled
} {try_connect_and_query_all} \
}
}
}
proc stop_watch {onoff} {
proc stop_watch {onoff} {
...
@@ -2337,7 +2413,7 @@ global env x11vnc_prog x11vnc_cmdline x11vnc_xdisplay x11vnc_connect;
...
@@ -2337,7 +2413,7 @@ global env x11vnc_prog x11vnc_cmdline x11vnc_xdisplay x11vnc_connect;
global helpall helptext helpremote helplabel hostname;
global helpall helptext helpremote helplabel hostname;
global all_settings reply_xdisplay always_update
global all_settings reply_xdisplay always_update
global max_text_height max_text_width
global max_text_height max_text_width
global menu_var unset_str
global menu_var unset_str
menus_disabled
global bfont
global bfont
global connected_to_x11vnc
global connected_to_x11vnc
global delay_sleep extra_sleep extra_sleep_split
global delay_sleep extra_sleep extra_sleep_split
...
@@ -2345,6 +2421,7 @@ global cache_all_query_vars
...
@@ -2345,6 +2421,7 @@ global cache_all_query_vars
set unset_str "(unset)"
set unset_str "(unset)"
set connected_to_x11vnc 0
set connected_to_x11vnc 0
set menus_disabled 0
set max_text_height 40
set max_text_height 40
set max_text_width 90
set max_text_width 90
set bfont -adobe-helvetica-bold-r-*-*-*-120-*-*-*-*-*-*;
set bfont -adobe-helvetica-bold-r-*-*-*-120-*-*-*-*-*-*;
...
...
x11vnc/tkx11vnc.h
View file @
36181297
...
@@ -79,6 +79,7 @@
...
@@ -79,6 +79,7 @@
" =RA update-all
\n
"
" =RA update-all
\n
"
" =GA clear-all
\n
"
" =GA clear-all
\n
"
" --
\n
"
" --
\n
"
" =RA stop+quit
\n
"
" =GA Quit
\n
"
" =GA Quit
\n
"
"
\n
"
"
\n
"
"Help
\n
"
"Help
\n
"
...
@@ -292,6 +293,10 @@
...
@@ -292,6 +293,10 @@
"a -Q query. Examples:
\\\"
zero:20,20,100,100
\\\"
,
\\\"
Q:ext_xfixes
\\\"
\n
"
"a -Q query. Examples:
\\\"
zero:20,20,100,100
\\\"
,
\\\"
Q:ext_xfixes
\\\"
\n
"
"
\"\n
"
"
\"\n
"
"
\n
"
"
\n
"
" set helptext(stop+quit)
\"\n
"
"Send the stop command to the x11vnc server, then terminate the tkx11vnc gui.
\n
"
"
\"\n
"
"
\n
"
" set helptext(Quit)
\"\n
"
" set helptext(Quit)
\"\n
"
"Terminate the tkx11vnc gui. Any x11vnc servers will be left running.
\n
"
"Terminate the tkx11vnc gui. Any x11vnc servers will be left running.
\n
"
"
\"\n
"
"
\"\n
"
...
@@ -784,10 +789,16 @@
...
@@ -784,10 +789,16 @@
"}
\n
"
"}
\n
"
"
\n
"
"
\n
"
"proc menus_enable {} {
\n
"
"proc menus_enable {} {
\n
"
" global menus_disabled
\n
"
"
\n
"
" menus_state
\"
normal
\"\n
"
" menus_state
\"
normal
\"\n
"
" set menus_disabled 0
\n
"
"}
\n
"
"}
\n
"
"
\n
"
"
\n
"
"proc menus_disable {} {
\n
"
"proc menus_disable {} {
\n
"
" global menus_disabled
\n
"
"
\n
"
" set menus_disabled 1
\n
"
" menus_state
\"
disabled
\"\n
"
" menus_state
\"
disabled
\"\n
"
"}
\n
"
"}
\n
"
"
\n
"
"
\n
"
...
@@ -1189,6 +1200,8 @@
...
@@ -1189,6 +1200,8 @@
" set query_result_list [split_query $query]
\n
"
" set query_result_list [split_query $query]
\n
"
"
\n
"
"
\n
"
" foreach q $query_result_list {
\n
"
" foreach q $query_result_list {
\n
"
" # XXX following will crash if $item is not a good regexp
\n
"
" # need to protect it
\\
Q$item
\\
E style...
\n
"
"# if {[regexp
\"
^$item:
\"
$q]} {
\n
"
"# if {[regexp
\"
^$item:
\"
$q]} {
\n
"
"# set found $q
\n
"
"# set found $q
\n
"
"# }
\n
"
"# }
\n
"
...
@@ -1415,6 +1428,12 @@
...
@@ -1415,6 +1428,12 @@
" } elseif {$item ==
\"
all-settings
\"
} {
\n
"
" } elseif {$item ==
\"
all-settings
\"
} {
\n
"
" show_all_settings
\n
"
" show_all_settings
\n
"
" return
\n
"
" return
\n
"
" } elseif {$item ==
\"
stop+quit
\"
} {
\n
"
" push_new_value
\"
stop
\"
\"
stop
\"
1 0
\n
"
" set_connected no
\n
"
" update
\n
"
" after 500
\n
"
" destroy .
\n
"
" }
\n
"
" }
\n
"
"
\n
"
"
\n
"
" if {[value_is_string $item]} {
\n
"
" if {[value_is_string $item]} {
\n
"
...
@@ -1662,12 +1681,45 @@
...
@@ -1662,12 +1681,45 @@
" }
\n
"
" }
\n
"
"}
\n
"
"}
\n
"
"
\n
"
"
\n
"
"proc update_clients_and_repost {} {
\n
"
" global item_cascade menu_m menu_b
\n
"
"
\n
"
" append_text
\"
Refreshing connected clients list...
\"\n
"
" query_all 1
\n
"
" update
\n
"
"
\n
"
" set saw 0
\n
"
" set casc $item_cascade(current)
\n
"
" set last [$casc index end]
\n
"
" for {set i 0} {$i <= $last} {incr i} {
\n
"
" if {[$casc type $i] ==
\"
separator
\"
} {
\n
"
" continue
\n
"
" }
\n
"
" set name [$casc entrycget $i -label]
\n
"
" if {[regexp {^#} $name]} {
\n
"
" continue
\n
"
" }
\n
"
" if {[regexp {^refresh-list} $name]} {
\n
"
" continue
\n
"
" }
\n
"
" if {! $saw} {
\n
"
" append_text
\"\\
n
\"\n
"
" }
\n
"
" set saw 1
\n
"
" append_text
\"
client: $name
\\
n
\"\n
"
" }
\n
"
" if {! $saw} {
\n
"
" append_text
\"
done.
\\
n
\"\n
"
" }
\n
"
"}
\n
"
"
\n
"
"proc update_clients_menu {list} {
\n
"
"proc update_clients_menu {list} {
\n
"
" global item_cascade
\n
"
" global item_cascade
\n
"
" set subm $item_cascade(current);
\n
"
" set subm $item_cascade(current);
\n
"
" catch {destroy $subm}
\n
"
" catch {destroy $subm}
\n
"
" menu $subm -tearoff 0
\n
"
" menu $subm -tearoff 0
\n
"
" $subm add command
\n
"
" $subm add command
\n
"
" $subm add command -label
\"
refresh-list
\"
-command
\"
update_clients_and_repost
\"\n
"
" $subm add separator
\n
"
" $subm add separator
\n
"
" set count 0
\n
"
" set count 0
\n
"
" foreach client [split $list
\"
,
\"
] {
\n
"
" foreach client [split $list
\"
,
\"
] {
\n
"
...
@@ -1768,7 +1820,16 @@
...
@@ -1768,7 +1820,16 @@
" set menu
\"
$colf.menu$case.menu
\"
;
\n
"
" set menu
\"
$colf.menu$case.menu
\"
;
\n
"
" set menu_b($case) $menub
\n
"
" set menu_b($case) $menub
\n
"
" set menu_m($case) $menu
\n
"
" set menu_m($case) $menu
\n
"
" menubutton $menub -text
\"
$case
\"
-underline 0
\\\n
"
" set ul 0
\n
"
" foreach char [split $case
\"\"
] {
\n
"
" set char [string tolower $char]
\n
"
" if {![info exists underlined($char)]} {
\n
"
" set underlined($char) 1
\n
"
" break
\n
"
" }
\n
"
" incr ul
\n
"
" }
\n
"
" menubutton $menub -text
\"
$case
\"
-underline $ul
\\\n
"
" -anchor w -menu $menu -background $fbg
\\\n
"
" -anchor w -menu $menu -background $fbg
\\\n
"
" -font $bfont
\n
"
" -font $bfont
\n
"
" pack $menub -side top -fill x
\n
"
" pack $menub -side top -fill x
\n
"
...
@@ -2042,16 +2103,31 @@
...
@@ -2042,16 +2103,31 @@
"}
\n
"
"}
\n
"
"
\n
"
"
\n
"
"proc key_bindings {} {
\n
"
"proc key_bindings {} {
\n
"
" global env
\n
"
" global env
menus_disabled
\n
"
" if {[info exists env(USER)] && $env(USER) ==
\"
runge
\"
} {
\n
"
" if {[info exists env(USER)] && $env(USER) ==
\"
runge
\"
} {
\n
"
" # quick restart
\n
"
" # quick restart
\n
"
" bind . <Control-KeyPress-c> {exec $argv0 $argv &; destroy .}
\n
"
" bind . <Control-KeyPress-c> {exec $argv0 $argv &; destroy .}
\n
"
" }
\n
"
" }
\n
"
" bind . <Control-KeyPress-p> {try_connect_and_query_all}
\n
"
" bind . <Control-KeyPress-p> {
\\\n
"
" bind . <Control-KeyPress-u> {query_all 0}
\n
"
" global menus_disabled;
\\\n
"
" bind . <Control-KeyPress-r> {query_all 0}
\n
"
" if {!$menus_disabled} {try_connect_and_query_all}
\\\n
"
" bind . <Control-KeyPress-d> {detach_from_display}
\n
"
" }
\n
"
" bind . <Control-KeyPress-a> {try_connect_and_query_all}
\n
"
" bind . <Control-KeyPress-u> {
\\\n
"
" global menus_disabled;
\\\n
"
" if {!$menus_disabled} {query_all 0}
\\\n
"
" }
\n
"
" bind . <Control-KeyPress-r> {
\\\n
"
" global menus_disabled;
\\\n
"
" if {!$menus_disabled} {query_all 0}
\\\n
"
" }
\n
"
" bind . <Control-KeyPress-d> {
\\\n
"
" global menus_disabled;
\\\n
"
" if {!$menus_disabled} {detach_from_display}
\\\n
"
" }
\n
"
" bind . <Control-KeyPress-a> {
\\\n
"
" global menus_disabled;
\\\n
"
" if {!$menus_disabled} {try_connect_and_query_all}
\\\n
"
" }
\n
"
"}
\n
"
"}
\n
"
"
\n
"
"
\n
"
"proc stop_watch {onoff} {
\n
"
"proc stop_watch {onoff} {
\n
"
...
@@ -2343,7 +2419,7 @@
...
@@ -2343,7 +2419,7 @@
"global helpall helptext helpremote helplabel hostname;
\n
"
"global helpall helptext helpremote helplabel hostname;
\n
"
"global all_settings reply_xdisplay always_update
\n
"
"global all_settings reply_xdisplay always_update
\n
"
"global max_text_height max_text_width
\n
"
"global max_text_height max_text_width
\n
"
"global menu_var unset_str
\n
"
"global menu_var unset_str
menus_disabled
\n
"
"global bfont
\n
"
"global bfont
\n
"
"global connected_to_x11vnc
\n
"
"global connected_to_x11vnc
\n
"
"global delay_sleep extra_sleep extra_sleep_split
\n
"
"global delay_sleep extra_sleep extra_sleep_split
\n
"
...
@@ -2351,6 +2427,7 @@
...
@@ -2351,6 +2427,7 @@
"
\n
"
"
\n
"
"set unset_str
\"
(unset)
\"\n
"
"set unset_str
\"
(unset)
\"\n
"
"set connected_to_x11vnc 0
\n
"
"set connected_to_x11vnc 0
\n
"
"set menus_disabled 0
\n
"
"set max_text_height 40
\n
"
"set max_text_height 40
\n
"
"set max_text_width 90
\n
"
"set max_text_width 90
\n
"
"set bfont -adobe-helvetica-bold-r-*-*-*-120-*-*-*-*-*-*;
\n
"
"set bfont -adobe-helvetica-bold-r-*-*-*-120-*-*-*-*-*-*;
\n
"
...
...
x11vnc/x11vnc.1
View file @
36181297
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
.TH X11VNC "1" "December 2004" "x11vnc " "User Commands"
.TH X11VNC "1" "December 2004" "x11vnc " "User Commands"
.SH NAME
.SH NAME
x11vnc - allow VNC connections to real X11 displays
x11vnc - allow VNC connections to real X11 displays
version: 0.7pre, lastmod: 2004-12-2
0
version: 0.7pre, lastmod: 2004-12-2
3
.SH SYNOPSIS
.SH SYNOPSIS
.B x11vnc
.B x11vnc
[OPTION]...
[OPTION]...
...
...
x11vnc/x11vnc.c
View file @
36181297
...
@@ -256,7 +256,7 @@ static int xdamage_base_event_type;
...
@@ -256,7 +256,7 @@ static int xdamage_base_event_type;
#endif
#endif
/* date +'lastmod: %Y-%m-%d' */
/* date +'lastmod: %Y-%m-%d' */
char
lastmod
[]
=
"0.7pre lastmod: 2004-12-2
0
"
;
char
lastmod
[]
=
"0.7pre lastmod: 2004-12-2
3
"
;
/* X display info */
/* X display info */
...
@@ -732,13 +732,21 @@ int pick_windowid(unsigned long *num) {
...
@@ -732,13 +732,21 @@ int pick_windowid(unsigned long *num) {
if
(
screen
&&
screen
->
clientHead
)
{
if
(
screen
&&
screen
->
clientHead
)
{
/* they may be doing the pointer-pick thru vnc: */
/* they may be doing the pointer-pick thru vnc: */
int
nfds
;
tv
.
tv_sec
=
0
;
tv
.
tv_sec
=
0
;
tv
.
tv_usec
=
msec
*
1000
;
tv
.
tv_usec
=
msec
*
1000
;
FD_ZERO
(
&
set
);
FD_ZERO
(
&
set
);
FD_SET
(
fileno
(
p
),
&
set
);
FD_SET
(
fileno
(
p
),
&
set
);
if
(
select
(
fileno
(
p
)
+
1
,
&
set
,
NULL
,
NULL
,
&
tv
)
==
0
)
{
/* note that rfbPE takes about 30ms too */
nfds
=
select
(
fileno
(
p
)
+
1
,
&
set
,
NULL
,
NULL
,
&
tv
);
if
(
nfds
==
0
||
nfds
<
0
)
{
/*
* select timedout or error.
* note this rfbPE takes about 30ms too:
*/
rfbPE
(
screen
,
-
1
);
rfbPE
(
screen
,
-
1
);
XFlush
(
dpy
);
continue
;
continue
;
}
}
}
}
...
@@ -12585,7 +12593,7 @@ static void check_user_input3(double dt, int tile_diffs) {
...
@@ -12585,7 +12593,7 @@ static void check_user_input3(double dt, int tile_diffs) {
int
spun_out
,
missed_out
,
allowed_misses
,
g
,
g_in
;
int
spun_out
,
missed_out
,
allowed_misses
,
g
,
g_in
;
double
spin
,
spin_max
,
tm
,
to
,
dtm
,
rpe_last
;
double
spin
,
spin_max
,
tm
,
to
,
dtm
,
rpe_last
;
static
int
rfb_wait_ms
=
2
;
static
int
rfb_wait_ms
=
2
;
static
double
grind_spin_time
=
0
.
30
,
dt_
min
=
0
.
075
;
static
double
grind_spin_time
=
0
.
30
,
dt_
cut
=
0
.
075
;
static
double
quick_spin_fac
=
0
.
65
,
spin_max_fac
=
2
.
0
;
static
double
quick_spin_fac
=
0
.
65
,
spin_max_fac
=
2
.
0
;
static
double
rpe_wait
=
0
.
15
;
static
double
rpe_wait
=
0
.
15
;
int
grinding
,
gcnt
,
ms
,
split
=
200
;
int
grinding
,
gcnt
,
ms
,
split
=
200
;
...
@@ -12593,12 +12601,13 @@ static void check_user_input3(double dt, int tile_diffs) {
...
@@ -12593,12 +12601,13 @@ static void check_user_input3(double dt, int tile_diffs) {
if
(
first
)
{
if
(
first
)
{
char
*
p
=
getenv
(
"SPIN"
);
char
*
p
=
getenv
(
"SPIN"
);
if
(
p
)
{
if
(
p
)
{
sscanf
(
p
,
"%lf,%lf,%lf"
,
&
grind_spin_time
,
&
dt_
min
,
&
quick_spin_fac
);
sscanf
(
p
,
"%lf,%lf,%lf"
,
&
grind_spin_time
,
&
dt_
cut
,
&
quick_spin_fac
);
}
}
first
=
0
;
first
=
0
;
}
}
/*
/*
* Try for some "quick" pointer input processing.
* Try for some "quick" pointer input processing.
*
*
...
@@ -12615,8 +12624,8 @@ static void check_user_input3(double dt, int tile_diffs) {
...
@@ -12615,8 +12624,8 @@ static void check_user_input3(double dt, int tile_diffs) {
* should continue, if we do so we say we are "grinding"
* should continue, if we do so we say we are "grinding"
*/
*/
if
(
dt
<
dt_
min
)
{
if
(
dt
<
dt_
cut
)
{
dt
=
dt_
min
;
/* this is to try to avoid early exit */
dt
=
dt_
cut
;
/* this is to try to avoid early exit */
}
}
/* max spin time in 1st pass, comparable to last dt */
/* max spin time in 1st pass, comparable to last dt */
spin_max
=
quick_spin_fac
*
dt
;
spin_max
=
quick_spin_fac
*
dt
;
...
@@ -12723,8 +12732,167 @@ static void check_user_input3(double dt, int tile_diffs) {
...
@@ -12723,8 +12732,167 @@ static void check_user_input3(double dt, int tile_diffs) {
drag_in_progress
=
0
;
drag_in_progress
=
0
;
}
}
/* quick-n-dirty copy of check_user_input3, merge later... */
static
void
check_user_input4
(
double
dt
,
int
tile_diffs
)
{
static
void
check_user_input4
(
double
dt
,
int
tile_diffs
)
{
return
;
int
spun_out
,
missed_out
,
allowed_misses
,
g
,
g_in
;
double
spin
,
spin_max
,
tm
,
to
,
dtm
,
rpe_last
;
static
int
rfb_wait_ms
=
2
;
static
double
grind_spin_time
=
0
.
30
,
dt_cut
=
0
.
075
;
static
double
quick_spin_fac
=
0
.
65
,
spin_max_fac
=
2
.
0
;
static
double
rpe_wait
=
0
.
15
;
int
grinding
,
gcnt
,
ms
,
split
=
200
;
static
int
first
=
1
;
int
Btile
=
tile_x
*
tile_y
*
bpp
/
8
;
double
Ttile
;
double
screen_rate
=
5000000
.;
/* 5 MB/sec */
double
client_rate
=
80
*
100000
.;
/* 20 KB/sec @ 80X compression */
static
double
Tfac
=
1
.
0
;
static
double
dt_min
=
-
1
.
0
,
dt_max
=
-
1
.
0
;
if
(
first
)
{
char
*
p
=
getenv
(
"SPIN"
);
if
(
p
)
{
sscanf
(
p
,
"%lf,%lf,%lf,%lf"
,
&
grind_spin_time
,
&
dt_cut
,
&
quick_spin_fac
,
&
Tfac
);
}
first
=
0
;
}
if
(
dt_min
<
0
||
dt
<
dt_min
)
{
dt_min
=
dt
;
}
if
(
dt_max
<
0
||
dt
>
dt_max
)
{
dt_max
=
dt
;
}
/*
* when we first enter we require some pointer input
*/
if
(
!
got_pointer_input
)
{
drag_in_progress
=
0
;
return
;
}
Ttile
=
Btile
*
(
1
.
0
/
screen_rate
+
1
.
0
/
client_rate
);
Ttile
=
Tfac
*
Ttile
;
if
(
dt
<
dt_cut
)
{
dt
=
dt_cut
;
/* this is to try to avoid early exit */
}
/* max spin time in 1st pass, comparable to last dt */
spin_max
=
quick_spin_fac
*
dt
;
grinding
=
0
;
/* 1st pass is "not grinding" */
spin
=
0
.
0
;
/* amount of time spinning */
spun_out
=
0
;
/* whether we spun out of time */
missed_out
=
0
;
/* whether we received no ptr input */
allowed_misses
=
3
;
/* number of ptr inputs we can miss */
gcnt
=
0
;
tm
=
0
.
0
;
/* timer variable */
dtime
(
&
tm
);
rpe_last
=
to
=
tm
;
/* last time we did rfbPE() */
g
=
g_in
=
got_pointer_input
;
while
(
1
)
{
int
got_input
=
0
;
gcnt
++
;
if
(
grinding
)
{
if
(
gcnt
>=
split
)
{
break
;
}
usleep
(
ms
*
1000
);
}
if
(
button_mask
)
{
drag_in_progress
=
1
;
}
if
(
show_multiple_cursors
&&
tm
>
rpe_last
+
rpe_wait
)
{
rfbPE
(
screen
,
rfb_wait_ms
*
1000
);
rpe_last
=
tm
;
}
else
{
rfbCFD
(
screen
,
rfb_wait_ms
*
1000
);
}
dtm
=
dtime
(
&
tm
);
spin
+=
dtm
;
if
(
spin
>
spin_max
)
{
/* get out if spin time over limit */
spun_out
=
1
;
}
else
if
(
tile_diffs
>
200
&&
spin
>
Ttile
*
tile_diffs
)
{
/* XXX not finished. */
/* we think we can push the frame */
break
;
}
else
if
(
got_pointer_input
>
g
)
{
/* received some input, flush to display. */
got_input
=
1
;
g
=
got_pointer_input
;
XFlush
(
dpy
);
}
else
if
(
--
allowed_misses
<=
0
)
{
/* too many misses */
missed_out
=
1
;
}
else
{
/* these are misses */
int
wms
=
0
;
if
(
!
grinding
&&
gcnt
==
1
&&
button_mask
)
{
/*
* missed our first input, wait for
* a defer time. (e.g. on slow link)
* hopefully client will batch them.
*/
wms
=
1000
*
(
0
.
5
*
(
spin_max
-
spin
));
}
else
if
(
button_mask
)
{
wms
=
10
;
}
if
(
wms
)
{
usleep
(
wms
*
1000
);
}
}
if
(
spun_out
&&
!
grinding
)
{
/* set parameters for grinding mode. */
grinding
=
1
;
if
(
spin
>
grind_spin_time
||
button_mask
)
{
spin_max
=
spin
+
grind_spin_time
*
spin_max_fac
;
}
else
{
spin_max
=
spin
+
dt
*
spin_max_fac
;
}
ms
=
(
int
)
(
1000
*
((
spin_max
-
spin
)
/
split
));
if
(
ms
<
1
)
{
ms
=
1
;
}
/* reset for second pass */
spun_out
=
0
;
missed_out
=
0
;
allowed_misses
=
3
;
g
=
got_pointer_input
;
gcnt
=
0
;
}
else
if
(
spun_out
&&
grinding
)
{
/* done in 2nd pass */
break
;
}
else
if
(
missed_out
)
{
/* done in either pass */
break
;
}
}
drag_in_progress
=
0
;
}
}
static
int
check_user_input
(
double
dt
,
int
tile_diffs
,
int
*
cnt
)
{
static
int
check_user_input
(
double
dt
,
int
tile_diffs
,
int
*
cnt
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment