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
c9e24e5b
Commit
c9e24e5b
authored
18 years ago
by
runge
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
more speed and accuracy improvements to -ncache mode.
parent
5b607a44
Changes
13
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
773 additions
and
390 deletions
+773
-390
README
x11vnc/README
+291
-257
help.c
x11vnc/help.c
+4
-0
options.c
x11vnc/options.c
+5
-0
options.h
x11vnc/options.h
+1
-0
remote.c
x11vnc/remote.c
+2
-0
screen.c
x11vnc/screen.c
+11
-6
solid.c
x11vnc/solid.c
+15
-7
solid.h
x11vnc/solid.h
+1
-0
userinput.c
x11vnc/userinput.c
+421
-116
x11vnc.1
x11vnc/x11vnc.1
+5
-1
x11vnc.c
x11vnc/x11vnc.c
+6
-1
x11vnc_defs.c
x11vnc/x11vnc_defs.c
+1
-1
xdamage.c
x11vnc/xdamage.c
+10
-1
No files found.
x11vnc/README
View file @
c9e24e5b
x11vnc
README
file
Date
:
Sun
Jan
7
12
:
08
:
49
EST
2007
x11vnc
README
file
Date
:
Mon
Jan
8
23
:
02
:
20
EST
2007
The
following
information
is
taken
from
these
URLs
:
...
...
@@ -667,17 +667,18 @@ make
by
default
when
XINERAMA
is
active
.
*
[
93
]
Viewer
-
side
pixmap
caching
.
This
one
might
not
make
it
into
0.8.4
but
will
benefit
from
much
testing
,
thanks
.
A
large
area
of
pixels
(
at
least
twice
as
big
as
the
framebuffer
itself
)
is
placed
below
the
framebuffer
to
act
as
a
buffer
/
cache
area
for
pixel
data
.
The
VNC
CopyRect
encoding
is
used
to
move
it
around
(
so
any
viewer
should
work
).
Until
we
start
modifying
viewers
you
will
be
able
to
see
the
cache
area
if
you
scroll
down
(
this
makes
it
easier
to
debug
!). Test it with something like "-ncache 10".
pixels
(
at
least
twice
as
big
as
the
framebuffer
itself
;
the
bigger
the
better
...)
is
placed
below
the
framebuffer
to
act
as
a
buffer
/
cache
area
for
pixel
data
.
The
VNC
CopyRect
encoding
is
used
to
move
it
around
(
so
any
viewer
should
work
).
Until
we
start
modifying
viewers
you
will
be
able
to
see
the
cache
area
if
you
scroll
down
(
this
makes
it
easier
to
debug
!). Test it with
something
like
"-ncache 10"
.
If
you
have
a
Mac
please
try
out
the
native
Mac
OS
X
support
(
build
with
"./configure --without-x"
,
or
download
a
binary
mentioned
above
),
even
if
you
don
't plan on using it in this mode, and let me know h
ow
it went. Thanks.
(
even
if
you
don
't plan on using it in this mode!), and let me kn
ow
how
it went. Thanks.
Here are some features that appeared in the 0.8.3 release:
...
...
@@ -4570,14 +4571,15 @@ EndSection
As
of
Dec
/
2006
in
the
[
547
]
0.8.4
development
tarball
there
is
an
experimental
client
-
side
caching
implementation
enabled
by
the
"[548]-ncache n"
option
.
In
fact
,
during
the
test
period
at
least
it
is
on
by
default
with
n
set
to
1
0
.
is
on
by
default
with
n
set
to
1
2
.
It
is
a
simple
scheme
where
the
lower
portion
of
the
framebuffer
(
i
.
e
.
below
the
user
's actual display) is used for storing pixel data.
CopyRect; a fast, local, viewer-side VNC encoding; is used to move the
pixel data in and out of the actual display area. It gives a good
speedup for iconifying/deiconifying and moving windows and re-posting
of menus.
pixel data in and out of the actual display area. It gives an
excellent speedup for iconifying/deiconifying and moving windows and
re-posting of menus (often it doesn'
t
feel
like
VNC
at
all
;
there
is
no
delay
).
This
scheme
is
nice
because
it
does
all
of
this
within
the
existing
VNC
protocol
,
and
so
it
works
with
all
VNC
viewers
.
...
...
@@ -4585,22 +4587,23 @@ EndSection
A
challenge
to
doing
more
sophisticated
(
e
.
g
.
compressed
)
client
-
side
caching
is
that
one
needs
to
extend
the
VNC
protocol
and
then
also
get
users
to
adopt
your
VNC
Viewer
or
modify
existing
viewers
and
get
them
to be used instead...
to
be
used
instead
,
patches
accepted
,
etc
...
A
drawback
of
the
"-ncache n"
method
is
that
in
the
VNC
Viewer
you
can
scroll
down
and
actually
see
the
cached
pixel
data
.
One
will
need
to
try
to
adjust
the
size
of
the
VNC
Viewer
window
so
the
cache
area
cannot
be
seen
.
At some point Lib
vncs
erver may implement a "rfbFBCrop" pseudoencoding
At
some
point
Lib
VNCS
erver
may
implement
a
"rfbFBCrop"
pseudoencoding
that
viewers
can
use
to
learn
which
portion
of
the
framebuffer
to
actually
show
to
the
users
(
with
the
hidden
part
used
for
caching
,
or
perhaps something else).
perhaps
something
else
,
maybe
double
buffering
or
other
offscreen
rendering
...).
Another
drawback
of
the
scheme
is
that
it
is
very
memory
intensive
,
the
n
in
"-ncache n"
is
the
factor
of
increase
over
the
base
framebuffer
size
to
use
for
caching
.
It
is
an
even
integer
and
should
be fairly large, 6-1
0
, to acheive good response. This usually requires
be
fairly
large
,
6
-
1
2
,
to
acheive
good
response
.
This
usually
requires
about
50
MB
of
additional
RAM
on
both
the
client
and
server
sides
.
So
with
n
=
6
a
1280
x1024
display
will
use
a
framebuffer
that
is
1280
x7168
:
everything
below
row
1024
is
the
buffer
cache
.
...
...
@@ -4608,14 +4611,40 @@ EndSection
The
reason
for
so
much
memory
is
because
the
pixel
data
is
not
compressed
and
so
the
whole
window
to
be
saved
must
be
stored
"offscreen"
.
E
.
g
.
for
a
large
web
browser
window
this
can
be
1
million
pixels, and that is
just
for a single window. One typically wants to
pixels
,
and
that
is
only
for
a
single
window
.
One
typically
wants
to
cycle
between
5
-
10
large
active
windows
.
Also
because
both
backing-store and save-unders are used for window caching that
introduces a factor of 2 in memory use. The large memory consumption
of the current implementation can be thought of as a tradeoff of
providing caching and being compatible with all VNC viewers and also
ease of implementing. Hopefully it can be tuned to use less.
backing
-
store
(
the
window
's actual contents) and save-unders (the
pixels covered up by the window) are used for window caching that
introduces an additional factor of 2 in memory use.
The large memory consumption of the current implementation can be
thought of as a tradeoff to providing caching and being compatible
with all VNC viewers and also ease of implementing. Hopefully it can
be tuned to use less, or the VNC community will extend the protocol to
allow caching and replaying of compressed blobs of data.
Another option to experiment with is "[549]-ncache_cr". By specifying
it, x11vnc will try to do smooth opaque window moves instead of its
wireframe. This can give a very nice effect (note: on Unix the realvnc
viewer seems to be smoother than the tightvnc viewer), but can lead to
some painting problems, and can be jerky in some circumstances.
Surprisingly, for very slow connections, e.g. modem, the -ncache_cr
option can actually improve window drags. This is probably because no
pixel data (only CopyRect instructions) are sent when dragging a
window. Normally, the wireframe must be sent and this involves
compressing and sending the lines that give rise to the moving box
effect (note that real framebuffer data is sent to "erase" the white
lines of the box).
If you experience painting errors you can can tap the Alt_L key (Left
"Alt" key) 3 times in a row to signal x11vnc to refresh the screen to
all viewers. You may also need to iconify and then deiconify any
damaged windows to correct their cache data as well. Note that if you
change color depth (e.g. 8bpp to full color) dynamically that will
usually lead to the entire extended framebuffer being resent which can
take a long time over very slow links: it may be better to reconnect
and reset the format right after doing so.
Gotcha for older Unix VNC Viewers: The older Unix VNC viewers (e.g.
current TightVNC Unix Viewer) require X server backingstore to keep
...
...
@@ -4653,23 +4682,23 @@ EndSection
this
is
because
the
cursor
shape
is
often
downloaded
to
the
graphics
hardware
(
video
card
),
but
I
could
be
mistaken
.
A
simple
kludge
is
provided
by
the
"[5
49
]-cursor X"
option
that
A
simple
kludge
is
provided
by
the
"[5
50
]-cursor X"
option
that
changes
the
cursor
when
the
mouse
is
on
the
root
background
(
or
any
window
has
the
same
cursor
as
the
root
background
).
Note
that
desktops
like
GNOME
or
KDE
often
cover
up
the
root
background
,
so
this
won
't
work for those cases. Also see the "[55
0
]-cursor some" option for
work for those cases. Also see the "[55
1
]-cursor some" option for
additional kludges.
Note that as of Aug/2004 on Solaris using the SUN_OVL overlay
extension and IRIX, x11vnc can show the correct mouse cursor when the
[55
1]-overlay option is supplied. See [552
]this FAQ for more info.
[55
2]-overlay option is supplied. See [553
]this FAQ for more info.
Also as of Dec/2004 XFIXES X extension support has been added to allow
exact extraction of the mouse cursor shape. XFIXES fixes the problem
of the cursor-shape being write-only: x11vnc can now query the X
server for the current shape and send it back to the connected
viewers. XFIXES is available on recent Linux Xorg based distros and
[55
3
]Solaris 10.
[55
4
]Solaris 10.
The only XFIXES issue is the handling of alpha channel transparency in
cursors. If a cursor has any translucency then in general it must be
...
...
@@ -4677,7 +4706,7 @@ EndSection
situations where the cursor transparency can also handled exactly:
when the VNC Viewer requires the cursor shape be drawn into the VNC
framebuffer or if you apply a patch to your VNC Viewer to extract
hidden alpha channel data under 32bpp. [55
4
]Details can be found here.
hidden alpha channel data under 32bpp. [55
5
]Details can be found here.
Q-71: When using XFIXES cursorshape mode, some of the cursors look
...
...
@@ -4710,17 +4739,17 @@ EndSection
for most cursor themes and you don'
t
have
to
worry
about
it
.
In
case
it
still
looks
bad
for
your
cursor
theme
,
there
are
(
of
course
!) some tunable parameters. The "[55
5
]-alphacut n" option lets
course
!) some tunable parameters. The "[55
6
]-alphacut n" option lets
you
set
the
threshold
"n"
(
between
0
and
255
):
cursor
pixels
with
alpha
values
below
n
will
be
considered
completely
transparent
while
values
equal
to
or
above
n
will
be
completely
opaque
.
The
default
is
240.
The
"[55
6
]-alphafrac f"
option
tries
to
correct
individual
240.
The
"[55
7
]-alphafrac f"
option
tries
to
correct
individual
cursors
that
did
not
fare
well
with
the
default
-
alphacut
value
:
if
a
cursor
has
less
than
fraction
f
(
between
0.0
and
1.0
)
of
its
pixels
selected
by
the
default
-
alphacut
,
the
threshold
is
lowered
until
f
of
its
pixels
are
selected
.
The
default
fraction
is
0.33
.
Finally
,
there
is
an
option
[
55
7
]-
alpharemove
that
is
useful
for
Finally
,
there
is
an
option
[
55
8
]-
alpharemove
that
is
useful
for
themes
where
many
cursors
are
light
colored
(
e
.
g
.
"whiteglass"
).
XFIXES
returns
the
cursor
data
with
the
RGB
values
pre
-
multiplied
by
the
alpha
value
.
If
the
white
cursors
look
too
grey
,
specify
...
...
@@ -4746,10 +4775,10 @@ EndSection
alpha
channel
data
to
libvncserver
.
However
,
this
data
will
only
be
used
for
VNC
clients
that
do
not
support
the
CursorShapeUpdates
VNC
extension
(
or
have
disabled
it
).
It
can
be
disabled
for
all
clients
with
the
[
55
8
]-
nocursorshape
x11vnc
option
.
In
this
case
the
cursor
is
with
the
[
55
9
]-
nocursorshape
x11vnc
option
.
In
this
case
the
cursor
is
drawn
,
correctly
blended
with
the
background
,
into
the
VNC
framebuffer
before
being
sent
out
to
the
client
.
So
the
alpha
blending
is
done
on
the
x11vnc
side
.
Use
the
[
5
59
]-
noalphablend
option
to
disable
this
the
x11vnc
side
.
Use
the
[
5
60
]-
noalphablend
option
to
disable
this
behavior
(
always
approximate
transparent
cursors
with
opaque
RGB
values
).
...
...
@@ -4773,7 +4802,7 @@ EndSection
example
on
how
to
change
the
Windows
TightVNC
viewer
to
achieve
the
same
thing
(
send
me
the
patch
if
you
get
that
working
).
This
patch
is
applied
to
the
[
56
0
]
Enhanced
TightVNC
Viewer
(
ssvnc
)
This
patch
is
applied
to
the
[
56
1
]
Enhanced
TightVNC
Viewer
(
ssvnc
)
package
we
provide
.
[
Mouse
Pointer
]
...
...
@@ -4781,9 +4810,9 @@ EndSection
Q
-
73
:
Why
does
the
mouse
arrow
just
stay
in
one
corner
in
my
vncviewer
,
whereas
my
cursor
(
that
does
move
)
is
just
a
dot
?
This
default
takes
advantage
of
a
[
56
1
]
tightvnc
extension
This
default
takes
advantage
of
a
[
56
2
]
tightvnc
extension
(
CursorShapeUpdates
)
that
allows
specifying
a
cursor
image
shape
for
the
local
VNC
viewer
.
You
may
disable
it
with
the
[
56
2
]-
nocursor
the
local
VNC
viewer
.
You
may
disable
it
with
the
[
56
3
]-
nocursor
option
to
x11vnc
if
your
viewer
does
not
have
this
extension
.
Note
:
as
of
Aug
/
2004
this
should
be
fixed
:
the
default
for
...
...
@@ -4797,17 +4826,17 @@ EndSection
clients
(
i
.
e
.
passive
viewers
can
see
the
mouse
cursor
being
moved
around
by
another
viewer
)?
Use
the
[
56
3
]-
cursorpos
option
when
starting
x11vnc
.
A
VNC
viewer
must
Use
the
[
56
4
]-
cursorpos
option
when
starting
x11vnc
.
A
VNC
viewer
must
support
the
Cursor
Positions
Updates
for
the
user
to
see
the
mouse
motions
(
the
TightVNC
viewers
support
this
).
As
of
Aug
/
2004
-
cursorpos
is
the
default
.
See
also
[
56
4
]-
nocursorpos
and
[
565
]-
nocursorshape
.
is
the
default
.
See
also
[
56
5
]-
nocursorpos
and
[
566
]-
nocursorshape
.
Q
-
75
:
Is
it
possible
to
swap
the
mouse
buttons
(
e
.
g
.
left
-
handed
operation
),
or
arbitrarily
remap
them
?
How
about
mapping
button
clicks
to
keystrokes
,
e
.
g
.
to
partially
emulate
Mouse
wheel
scrolling
?
You
can
remap
the
mouse
buttons
via
something
like
:
[
56
6
]-
buttonmap
You
can
remap
the
mouse
buttons
via
something
like
:
[
56
7
]-
buttonmap
13
-
31
(
or
perhaps
12
-
21
).
Also
,
note
that
xmodmap
(
1
)
lets
you
directly
adjust
the
X
server
's button mappings, but in some circumstances it
might be more desirable to have x11vnc do it.
...
...
@@ -4815,7 +4844,7 @@ EndSection
One user had an X server with only one mouse button(!) and was able to
map all of the VNC client mouse buttons to it via: -buttonmap 123-111.
Note that the [56
7
]-debug_pointer option prints out much info for
Note that the [56
8
]-debug_pointer option prints out much info for
every mouse/pointer event and is handy in solving problems.
To map mouse button clicks to keystrokes you can use the alternate
...
...
@@ -4837,7 +4866,7 @@ EndSection
Exactly what keystroke "scrolling" events they should be bound to
depends on one'
s
taste
.
If
this
method
is
too
approximate
,
one
could
consider
not
using
[
56
8
]-
buttonmap
but
rather
configuring
the
X
server
consider
not
using
[
56
9
]-
buttonmap
but
rather
configuring
the
X
server
to
think
it
has
a
mouse
with
5
buttons
even
though
the
physical
mouse
does
not
.
(
e
.
g
.
'Option "ZAxisMapping" "4 5"'
).
...
...
@@ -4867,7 +4896,7 @@ EndSection
Q
-
76
:
How
can
I
get
my
AltGr
and
Shift
modifiers
to
work
between
keyboards
for
different
languages
?
The
option
[
5
69
]-
modtweak
should
help
here
.
It
is
a
mode
that
monitors
The
option
[
5
70
]-
modtweak
should
help
here
.
It
is
a
mode
that
monitors
the
state
of
the
Shift
and
AltGr
Modifiers
and
tries
to
deduce
the
correct
keycode
to
send
,
possibly
by
sending
fake
modifier
key
presses
and
releases
in
addition
to
the
actual
keystroke
.
...
...
@@ -4876,16 +4905,16 @@ EndSection
to
get
the
old
behavior
).
This
was
done
because
it
was
noticed
on
newer
XFree86
setups
even
on
bland
"us"
keyboards
like
"pc104 us"
XFree86
included
a
"ghost"
key
with
both
"<"
and
">"
it
.
This
key
does
not
exist
on
the
keyboard
(
see
[
57
0
]
this
FAQ
for
more
info
).
Without
not
exist
on
the
keyboard
(
see
[
57
1
]
this
FAQ
for
more
info
).
Without
-
modtweak
there
was
then
an
ambiguity
in
the
reverse
map
keysym
=>
keycode
,
making
it
so
the
"<"
symbol
could
not
be
typed
.
Also
see
the
[
57
1
]
FAQ
about
the
-
xkb
option
for
a
more
powerful
method
Also
see
the
[
57
2
]
FAQ
about
the
-
xkb
option
for
a
more
powerful
method
of
modifier
tweaking
for
use
on
X
servers
with
the
XKEYBOARD
extension
.
When
trying
to
resolve
keyboard
mapping
problems
,
note
that
the
[
57
2
]-
debug_keyboard
option
prints
out
much
info
for
every
keystroke
[
57
3
]-
debug_keyboard
option
prints
out
much
info
for
every
keystroke
and
so
can
be
useful
debugging
things
.
...
...
@@ -4897,9 +4926,9 @@ EndSection
(e.g. pc105 in the XF86Config file when it should be something else,
say pc104).
Short Cut: Try the [57
3]-xkb or [574
]-sloppy_keys options and see if
Short Cut: Try the [57
4]-xkb or [575
]-sloppy_keys options and see if
that helps the situation. The discussion below is a bit outdated (e.g.
[57
5
]-modtweak is now the default) but it is useful reference for
[57
6
]-modtweak is now the default) but it is useful reference for
various tricks and so is kept.
...
...
@@ -4942,17 +4971,17 @@ EndSection
-remap less-comma
These are convenient in that they do not modify the actual X server
settings. The former ([57
6
]-modtweak) is a mode that monitors the
settings. The former ([57
7
]-modtweak) is a mode that monitors the
state of the Shift and AltGr modifiers and tries to deduce the correct
keycode sequence to send. Since Jul/2004 -modtweak is now the default.
The latter ([57
7
]-remap less-comma) is an immediate remapping of the
The latter ([57
8
]-remap less-comma) is an immediate remapping of the
keysym less to the keysym comma when it comes in from a client (so
when Shift is down the comma press will yield "<").
See also the [57
8
]FAQ about the -xkb option as a possible workaround
See also the [57
9
]FAQ about the -xkb option as a possible workaround
using the XKEYBOARD extension.
Note that the [5
79
]-debug_keyboard option prints out much info for
Note that the [5
80
]-debug_keyboard option prints out much info for
every keystroke to aid debugging keyboard problems.
...
...
@@ -4960,13 +4989,13 @@ EndSection
(i.e. an extra comma).
This is likely because you press "Shift" then "<" but then released
the Shift key before releasing the "<". Because of a [58
0
]keymapping
the Shift key before releasing the "<". Because of a [58
1
]keymapping
ambiguity the last event "< up" is interpreted as "," because that key
unshifted is the comma.
This should not happen in [58
1
]-xkb mode, because it works hard to
This should not happen in [58
2
]-xkb mode, because it works hard to
resolve the ambiguities. If you do not want to use -xkb, try the
option [58
2
]-sloppy_keys to attempt a similar type of algorithm.
option [58
3
]-sloppy_keys to attempt a similar type of algorithm.
Q-79: I'
m
using
an
"international"
keyboard
(
e
.
g
.
German
"de"
,
or
...
...
@@ -4990,7 +5019,7 @@ EndSection
In both cases no AltGr is sent to the VNC server, but we know AltGr is
needed on the physical international keyboard to type a "@".
This all worked fine with x11vnc running with the [58
3
]-modtweak
This all worked fine with x11vnc running with the [58
4
]-modtweak
option (it figures out how to adjust the Modifier keys (Shift or
AltGr) to get the "@"). However it fails under recent versions of
XFree86 (and the X.org fork). These run the XKEYBOARD extension by
...
...
@@ -5007,7 +5036,7 @@ EndSection
*
there
is
a
new
option
-
xkb
to
use
the
XKEYBOARD
extension
API
to
do
the
Modifier
key
tweaking
.
The
[
58
4
]-
xkb
option
seems
to
fix
all
of
the
missing
keys
:
"@"
,
"<"
,
The
[
58
5
]-
xkb
option
seems
to
fix
all
of
the
missing
keys
:
"@"
,
"<"
,
">"
,
etc
.:
it
is
recommended
that
you
try
it
if
you
have
this
sort
of
problem
.
Let
us
know
if
there
are
any
remaining
problems
(
see
the
next
paragraph
for
some
known
problems
).
If
you
specify
the
-
debug_keyboard
...
...
@@ -5015,7 +5044,7 @@ EndSection
debugging
output
(
send
it
along
with
any
problems
you
report
).
Update
:
as
of
Jun
/
2005
x11vnc
will
try
to
automatically
enable
[
58
5
]-
xkb
if
it
appears
that
would
be
beneficial
(
e
.
g
.
if
it
sees
any
[
58
6
]-
xkb
if
it
appears
that
would
be
beneficial
(
e
.
g
.
if
it
sees
any
of
"@"
,
"<"
,
">"
,
"["
and
similar
keys
are
mapped
in
a
way
that
needs
the
-
xkb
to
access
them
).
To
disable
this
automatic
check
use
-
noxkb
.
...
...
@@ -5030,7 +5059,7 @@ EndSection
was
attached
to
keycode
93
(
no
physical
key
generates
this
keycode
)
while
ISO_Level3_Shift
was
attached
to
keycode
113.
The
keycode
skipping
option
was
used
to
disable
the
ghost
key
:
[
58
6
]-
skip_keycodes
93
[
58
7
]-
skip_keycodes
93
*
In
implementing
-
xkb
we
noticed
that
some
characters
were
still
not
getting
through
,
e
.
g
.
"~"
and
"^"
.
This
is
not
really
an
XKEYBOARD
problem
.
What
was
happening
was
the
VNC
viewer
was
...
...
@@ -5048,16 +5077,16 @@ EndSection
What
to
do
?
In
general
the
VNC
protocol
has
not
really
solved
this
problem
:
what
should
be
done
if
the
VNC
viewer
sends
a
keysym
not
recognized
by
the
VNC
server
side
?
Workarounds
can
possibly
be
created
using
the
[
58
7
]-
remap
x11vnc
option
:
created
using
the
[
58
8
]-
remap
x11vnc
option
:
-
remap
asciitilde
-
dead_tilde
,
asciicircum
-
dead_circumflex
etc
.
Use
-
remap
filename
if
the
list
is
long
.
Please
send
us
your
workarounds
for
this
problem
on
your
keyboard
.
Perhaps
we
can
have
x11vnc
adjust
automatically
at
some
point
.
Also
see
the
[
58
8
]-
add_keysyms
option
in
the
next
paragraph
.
Update
:
for
convenience
"[5
89
]-remap DEAD"
does
many
of
these
[
58
9
]-
add_keysyms
option
in
the
next
paragraph
.
Update
:
for
convenience
"[5
90
]-remap DEAD"
does
many
of
these
mappings
at
once
.
*
To
complement
the
above
workaround
using
the
[
59
0
]-
remap
,
an
option
[
59
1
]-
add_keysyms
was
added
.
This
option
instructs
x11vnc
*
To
complement
the
above
workaround
using
the
[
59
1
]-
remap
,
an
option
[
59
2
]-
add_keysyms
was
added
.
This
option
instructs
x11vnc
to
bind
any
unknown
Keysyms
coming
in
from
VNC
viewers
to
unused
Keycodes
in
the
X
server
.
This
modifies
the
global
state
of
the
X
server
.
When
x11vnc
exits
it
removes
the
extra
keymappings
it
...
...
@@ -5076,7 +5105,7 @@ EndSection
Short
answer
:
disable
key
autorepeating
by
running
the
command
"xset r
off"
on
the
Xserver
where
x11vnc
is
run
(
restore
via
"xset r on"
)
or
use
the
new
(
Jul
/
2004
)
[
59
2
]-
norepeat
x11vnc
option
.
You
will
still
use
the
new
(
Jul
/
2004
)
[
59
3
]-
norepeat
x11vnc
option
.
You
will
still
have
autorepeating
because
that
is
taken
care
of
on
your
VNC
viewer
side
.
...
...
@@ -5100,7 +5129,7 @@ EndSection
off", does the problem go away?
The workaround is to manually apply "xset r off" and "xset r on" as
needed, or to use the [59
3
]-norepeat (which has since Dec/2004 been
needed, or to use the [59
4
]-norepeat (which has since Dec/2004 been
made the default). Note that with X server autorepeat turned off the
VNC viewer side of the connection will (nearly always) do its own
autorepeating so there is no big loss here, unless someone is also
...
...
@@ -5111,7 +5140,7 @@ EndSection
keystrokes!!
Are you using x11vnc to log in to an X session via display manager?
(as described in [59
4
]this FAQ) If so, x11vnc is starting before your
(as described in [59
5
]this FAQ) If so, x11vnc is starting before your
session and it disables autorepeat when you connect, but then after
you log in your session startup (GNOME, KDE, ...) could be resetting
the autorepeat to be on. Or it could be something inside your desktop
...
...
@@ -5135,7 +5164,7 @@ EndSection
machine where I run the VNC viewer does not. Is there a way I can map
a local unused key to send an AltGr? How about a Compose key as well?
Something like "[59
5
]-remap Super_R-Mode_switch" x11vnc option may
Something like "[59
6
]-remap Super_R-Mode_switch" x11vnc option may
work. Note that Super_R is the "Right Windoze(tm) Flaggie" key; you
may want to choose another. The -debug_keyboard option comes in handy
in finding keysym names (so does xev(1)).
...
...
@@ -5158,7 +5187,7 @@ EndSection
Since xmodmap(1) modifies the X server mappings you may not want to do
this (because it affects local work on that machine). Something like
the [59
6
]-remap Alt_L-Meta_L to x11vnc may be sufficient for ones
the [59
7
]-remap Alt_L-Meta_L to x11vnc may be sufficient for ones
needs, and does not modify the X server environment. Note that you
cannot send Alt_L in this case, maybe -remap Super_L-Meta_L would be a
better choice if the Super_L key is typically unused in Unix.
...
...
@@ -5169,7 +5198,7 @@ EndSection
This can be done directly in some X servers using AccessX and
Pointer_EnableKeys, but is a bit awkward. It may be more convenient to
have x11vnc do the remapping. This can be done via the [59
7
]-remap
have x11vnc do the remapping. This can be done via the [59
8
]-remap
option using the fake "keysyms" Button1, Button2, etc. as the "to"
keys (i.e. the ones after the "-")
...
...
@@ -5178,7 +5207,7 @@ EndSection
button "paste" because (using XFree86/Xorg Emulate3Buttons) you have
to click both buttons on the touch pad at the same time. This
remapping:
[59
8
]-remap Super_R-Button2
[59
9
]-remap Super_R-Button2
maps the Super_R "flag" key press to the Button2 click, thereby making
X pasting a bit easier.
...
...
@@ -5197,10 +5226,10 @@ EndSection
Caps_Lock in the viewer your local machine goes into the Caps_Lock on
state and sends keysym "A" say when you press "a". x11vnc will then
fake things up so that Shift is held down to generate "A". The
[
599
]-skip_lockkeys option should help to accomplish this. For finer
grain control use something like: "[60
0
]-remap Caps_Lock-None".
[
600
]-skip_lockkeys option should help to accomplish this. For finer
grain control use something like: "[60
1
]-remap Caps_Lock-None".
Also try the [60
1]-nomodtweak and [602
]-capslock options.
Also try the [60
2]-nomodtweak and [603
]-capslock options.
[Screen Related Issues and Features]
...
...
@@ -5223,7 +5252,7 @@ EndSection
There
may
also
be
scaling
viewers
out
there
(
e
.
g
.
TightVNC
or
UltraVNC
on
Windows
)
that
automatically
shrink
or
expand
the
remote
framebuffer
to
fit
the
local
display
.
Especially
for
hand
-
held
devices
.
See
also
[
60
3
]
this
FAQ
on
x11vnc
scaling
.
[
60
4
]
this
FAQ
on
x11vnc
scaling
.
Q
-
87
:
Does
x11vnc
support
server
-
side
framebuffer
scaling
?
(
E
.
g
.
to
...
...
@@ -5231,7 +5260,7 @@ EndSection
As
of
Jun
/
2004
x11vnc
provides
basic
server
-
side
scaling
.
It
is
a
global
scaling
of
the
desktop
,
not
a
per
-
client
setting
.
To
enable
it
use
the
"[60
4
]-scale fraction"
option
.
"fraction"
can
either
be
a
use
the
"[60
5
]-scale fraction"
option
.
"fraction"
can
either
be
a
floating
point
number
(
e
.
g
.
-
scale
0.5
)
or
the
alternative
m
/
n
fraction
notation
(
e
.
g
.
-
scale
3
/
4
).
Note
that
if
fraction
is
greater
than
one
the
display
is
magnified
.
...
...
@@ -5252,7 +5281,7 @@ EndSection
One
can
also
use
the
":nb"
with
an
integer
scale
factor
(
say
"-scale
2:nb"
)
to
use
x11vnc
as
a
screen
magnifier
for
vision
impaired
[
60
5
]
applications
.
Since
with
integer
scale
factors
the
framebuffers
[
60
6
]
applications
.
Since
with
integer
scale
factors
the
framebuffers
become
huge
and
scaling
operations
time
consuming
,
be
sure
to
use
":nb"
for
the
fastest
response
.
...
...
@@ -5278,7 +5307,7 @@ EndSection
If
one
desires
per
-
client
scaling
for
something
like
1
:
1
from
a
workstation
and
1
:
2
from
a
smaller
device
(
e
.
g
.
handheld
),
currently
the
only
option
is
to
run
two
(
or
more
)
x11vnc
processes
with
different
scalings
listening
on
separate
ports
([
60
6
]-
rfbport
option
,
different
scalings
listening
on
separate
ports
([
60
7
]-
rfbport
option
,
etc
.).
Update
:
As
of
May
/
2006
x11vnc
also
supports
the
UltraVNC
server
-
side
...
...
@@ -5288,8 +5317,8 @@ EndSection
"-rfbversion 3.6" for this to be recognized by UltraVNC viewers.
BTW, whenever you run two or more x11vnc'
s
on
the
same
X
display
and
use
the
[
60
7
]
GUI
,
then
to
avoid
all
of
the
x11vnc
's simultaneously
answering the gui you will need to use something like [60
8
]"-connect
use
the
[
60
8
]
GUI
,
then
to
avoid
all
of
the
x11vnc
's simultaneously
answering the gui you will need to use something like [60
9
]"-connect
file1 -gui ..." with different connect files for each x11vnc you want
to control via the gui (or remote-control). The "-connect file1" usage
gives separate communication channels between a x11vnc proces and the
...
...
@@ -5298,7 +5327,7 @@ EndSection
Update: As of Mar/2005 x11vnc now scales the mouse cursor with the
same scale factor as the screen. If you don'
t
want
that
,
use
the
[
6
09
]
"-scale_cursor frac"
option
to
set
the
cursor
scaling
to
a
[
6
10
]
"-scale_cursor frac"
option
to
set
the
cursor
scaling
to
a
different
factor
(
e
.
g
.
use
"-scale_cursor 1"
to
keep
the
cursor
at
its
natural
unscaled
size
).
...
...
@@ -5320,17 +5349,17 @@ EndSection
screen is not rectangular (e.g. 1280x1024 and 1024x768 monitors joined
together), then there will be "non-existent" areas on the screen. The
X server will return "garbage" image data for these areas and so they
may be distracting to the viewer. The [61
0
]-blackout x11vnc option
may be distracting to the viewer. The [61
1
]-blackout x11vnc option
allows you to blacken-out rectangles by manually specifying their
WxH+X+Y geometries. If your system has the libXinerama library, the
[61
1
]-xinerama x11vnc option can be used to have it automatically
[61
2
]-xinerama x11vnc option can be used to have it automatically
determine the rectangles to be blackened out. (Note on 8bpp
PseudoColor displays the fill color may not be black). Update:
[61
2
]-xinerama is now on by default.
[61
3
]-xinerama is now on by default.
Some users have reported that the mouse does not behave properly for
their Xinerama display: i.e. the mouse cannot be moved to all regions
of the large display. If this happens try using the [61
3
]-xwarppointer
of the large display. If this happens try using the [61
4
]-xwarppointer
option. This instructs x11vnc to fake mouse pointer motions using the
XWarpPointer function instead of the XTestFakeMotionEvent XTEST
function. (This may be due to a bug in the X server for XTEST when
...
...
@@ -5355,23 +5384,23 @@ EndSection
Note: if you are running on Solaris 8 or earlier you can easily hit up
against the maximum of 6 shm segments per process (for Xsun in this
case) from running multiple x11vnc processes. You should modify
/etc/system as mentioned in another [61
4
]FAQ to increase the limit. It
is probably also a good idea to run with the [61
5
]-onetile option in
/etc/system as mentioned in another [61
5
]FAQ to increase the limit. It
is probably also a good idea to run with the [61
6
]-onetile option in
this case (to limit each x11vnc to 3 shm segments), or even
[61
6
]-noshm to use no shm segments.
[61
7
]-noshm to use no shm segments.
Q-90: Can x11vnc show only a portion of the display? (E.g. for a
special purpose rfb application).
As of Mar/2005 x11vnc has the "[61
7
]-clip WxH+X+Y" option to select a
As of Mar/2005 x11vnc has the "[61
8
]-clip WxH+X+Y" option to select a
rectangle of width W, height H and offset (X, Y). Thus the VNC screen
will be the clipped sub-region of the display and be only WxH in size.
One user used -clip to split up a large [61
8
]Xinerama screen into two
One user used -clip to split up a large [61
9
]Xinerama screen into two
more managable smaller screens.
This also works to view a sub-region of a single application window if
the [6
19]-id or [620
]-sid options are used. The offset is measured
the [6
20]-id or [621
]-sid options are used. The offset is measured
from the upper left corner of the selected window.
...
...
@@ -5380,7 +5409,7 @@ EndSection
crash.
As of Dec/2004 x11vnc supports XRANDR. You enable it with the
[62
1
]-xrandr option to make x11vnc monitor XRANDR events and also trap
[62
2
]-xrandr option to make x11vnc monitor XRANDR events and also trap
X server errors if the screen change occurred in the middle of an X
call like XGetImage. Once it traps the screen change it will create a
new framebuffer using the new screen.
...
...
@@ -5390,9 +5419,9 @@ EndSection
then the viewer will automatically resize. Otherwise, the new
framebuffer is fit as best as possible into the original viewer size
(portions of the screen may be clipped, unused, etc). For these
viewers you can try the [62
2
]-padgeom option to make the region big
viewers you can try the [62
3
]-padgeom option to make the region big
enough to hold all resizes and rotations. We have fixed this problem
for the TightVNC Viewer on Unix: [62
3
]enhanced_tightvnc_viewer
for the TightVNC Viewer on Unix: [62
4
]enhanced_tightvnc_viewer
If you specify "-xrandr newfbsize" then vnc viewers that do not
support NewFBSize will be disconnected before the resize. If you
...
...
@@ -5404,7 +5433,7 @@ EndSection
reflect the screen that the VNC viewers see? (e.g. for a handheld
whose screen is rotated 90 degrees).
As of Jul/2006 there is the [62
4
]-rotate option allow this. E.g'
s
:
As of Jul/2006 there is the [62
5
]-rotate option allow this. E.g'
s
:
"-rotate +90"
,
"-rotate -90"
,
"-rotate x"
,
etc
.
...
...
@@ -5469,13 +5498,13 @@ EndSection
This may be a bug in kdesktop_lock. For now the only workaround is to
disable the screensaver. You can try using another one such as
straight xscreensaver (see the instructions [62
5
]here for how to
straight xscreensaver (see the instructions [62
6
]here for how to
disable kdesktop_lock). If you have more info on this or see it
outside of KDE please let us know.
Update: It appears this is due to kdesktop_lock enabling the screen
saver when the Monitor is in DPMS low-power state (e.g. standby,
suspend, or off). In Nov/2006 the x11vnc [62
6
]-nodpms option was added
suspend, or off). In Nov/2006 the x11vnc [62
7
]-nodpms option was added
as a workaround. Normally it is a good thing that the monitor powers
down (since x11vnc can still poll the framebuffer in this state), but
if you experience the kdesktop_lock problem you can specify the
...
...
@@ -5496,9 +5525,9 @@ EndSection
*
Fullscreen
mode
The
way
VMWare
does
Fullscreen
mode
on
Linux
is
to
display
the
Guest
desktop
in
a
separate
Virtual
Console
(
e
.
g
.
VC
8
)
(
see
[
62
7
]
this
FAQ
desktop
in
a
separate
Virtual
Console
(
e
.
g
.
VC
8
)
(
see
[
62
8
]
this
FAQ
on
VC
's for background). Unfortunately, this Fullscreen VC is not an X
server. So x11vnc cannot access it (however, [62
8
]see this discussion
server. So x11vnc cannot access it (however, [62
9
]see this discussion
of -rawfb for a possible workaround). x11vnc works fine with "Normal X
application window" and "Quick-Switch mode" because these use X.
...
...
@@ -5519,13 +5548,13 @@ EndSection
improve
response
.
One
can
also
cut
the
display
depth
(
e
.
g
.
to
16
bpp
)
in
this
2
nd
X
session
to
improve
video
performance
.
This
2
nd
X
session
emulates
Fullscreen
mode
to
some
degree
and
can
be
viewed
via
x11vnc
as
long
as
the
VMWare
X
session
[
6
29
]
is
in
the
active
VC
.
as
long
as
the
VMWare
X
session
[
6
30
]
is
in
the
active
VC
.
Also
note
that
with
a
little
bit
of
playing
with
"xwininfo -all
-children"
output
one
can
extract
the
(
non
-
toplevel
)
windowid
of
the
of
the
Guest
desktop
only
when
VMWare
is
running
as
a
normal
X
application
.
Then
one
can
export
just
the
guest
desktop
(
i
.
e
.
without
the
VMWare
menu
buttons
)
by
use
of
the
[
63
0
]-
id
windowid
option
.
The
the
VMWare
menu
buttons
)
by
use
of
the
[
63
1
]-
id
windowid
option
.
The
caveats
are
the
X
session
VMWare
is
in
must
be
in
the
active
VC
and
the
window
must
be
fully
visible
,
so
this
mode
is
not
terribly
convenient
,
but
could
be
useful
in
some
circumstances
(
e
.
g
.
running
...
...
@@ -5541,10 +5570,10 @@ EndSection
controlled
)
via
VNC
with
x11vnc
?
As
of
Apr
/
2005
there
is
support
for
this
.
Two
options
were
added
:
"[63
1
]-rawfb string"
(
to
indicate
the
raw
framembuffer
device
,
file
,
etc
.
and
its
parameters
)
and
"[63
2
]-pipeinput command"
(
to
provide
an
"[63
2
]-rawfb string"
(
to
indicate
the
raw
framembuffer
device
,
file
,
etc
.
and
its
parameters
)
and
"[63
3
]-pipeinput command"
(
to
provide
an
external
program
that
will
inject
or
otherwise
process
mouse
and
keystroke
input
).
Some
useful
[
63
3
]-
pipeinput
schemes
,
VID
,
CONSOLE
,
keystroke
input
).
Some
useful
[
63
4
]-
pipeinput
schemes
,
VID
,
CONSOLE
,
and
UINPUT
,
have
since
been
built
into
x11vnc
for
convenience
.
This
non
-
X
mode
for
x11vnc
is
somewhat
experimental
because
it
is
so
...
...
@@ -5582,9 +5611,9 @@ EndSection
access
method
).
Only
use
file
if
map
isn
't working. BTW, "mmap" is an
alias for "map" and if you do not supply a type and the file exists,
map is assumed (see the -help output and below for some exceptions to
this). The "snap:" setting applies the [63
4
]-snapfb option with
this). The "snap:" setting applies the [63
5
]-snapfb option with
"file:" type reading (this is useful for exporting webcams or TV tuner
video; see [63
5
]the next FAQ for more info).
video; see [63
6
]the next FAQ for more info).
Also, if the string is of the form "setup:cmd" then cmd is run and the
first line of its output retrieved and used as the rawfb string. This
...
...
@@ -5628,7 +5657,7 @@ EndSection
screen
to
either
shm
or
a
mapped
file
.
The
format
of
these
is
XWD
and
so
the
initial
header
should
be
skipped
.
BTW
,
since
XWD
is
not
strictly
RGB
the
view
will
only
be
approximate
,
but
usable
.
Of
course
for
the
case
of
Xvfb
x11vnc
can
poll
it
much
better
via
the
[
63
6
]
X
for
the
case
of
Xvfb
x11vnc
can
poll
it
much
better
via
the
[
63
7
]
X
API
,
but
you
get
the
idea
.
By
default
in
-
rawfb
mode
x11vnc
will
actually
close
any
X
display
it
...
...
@@ -5657,13 +5686,13 @@ EndSection
tty1
-
tty6
),
or
X
graphical
display
(
usually
starting
at
tty7
).
In
addition
to
the
text
console
other
graphical
ones
may
be
viewed
and
interacted
with
as
well
,
e
.
g
.
DirectFB
or
SVGAlib
apps
,
VMWare
non
-
X
fullscreen
,
or
[
63
7
]
Qt
-
embedded
apps
(
PDAs
/
Handhelds
).
By
default
the
fullscreen
,
or
[
63
8
]
Qt
-
embedded
apps
(
PDAs
/
Handhelds
).
By
default
the
pipeinput
mechanisms
UINPUT
and
CONSOLE
(
keystrokes
only
)
are
automatically
attempted
in
this
mode
under
"-rawfb console"
.
The
Video4Linux
Capture
device
,
/
dev
/
video0
,
etc
is
either
a
Webcam
or
a
TV
capture
device
and
needs
to
have
its
driver
enabled
in
the
kernel
.
See
[
63
8
]
this
FAQ
for
details
.
If
specified
via
"-rawfb Video"
kernel
.
See
[
63
9
]
this
FAQ
for
details
.
If
specified
via
"-rawfb Video"
then
the
pipeinput
method
"VID"
is
applied
(
it
lets
you
change
video
parameters
dynamically
via
keystrokes
).
...
...
@@ -5671,10 +5700,10 @@ EndSection
also
useful
in
testing
.
All
of
the
above
[
6
39
]-
rawfb
options
are
just
for
viewing
the
raw
All
of
the
above
[
6
40
]-
rawfb
options
are
just
for
viewing
the
raw
framebuffer
(
although
some
of
the
aliases
do
imply
keystroke
and
mouse
pipeinput
methods
).
That
may
be
enough
for
certain
applications
of
this
feature
(
e
.
g
.
suppose
a
[
64
0
]
video
camera
mapped
its
framebuffer
this
feature
(
e
.
g
.
suppose
a
[
64
1
]
video
camera
mapped
its
framebuffer
into
memory
and
you
just
wanted
to
look
at
it
via
VNC
).
To
handle
the
pointer
and
keyboard
input
from
the
viewer
users
the
"-pipeinput cmd"
option
was
added
to
indicate
a
helper
program
to
...
...
@@ -5712,7 +5741,7 @@ EndSection
keystrokes
into
the
Linux
console
(
e
.
g
.
the
virtual
consoles
:
/
dev
/
tty1
,
/
dev
/
tty2
,
etc
)
in
x11vnc
/
misc
/
vcinject
.
pl
.
It
is
based
on
the
vncterm
/
LinuxVNC
.
c
program
also
in
the
libvncserver
CVS
.
So
to
view
and
interact
with
VC
#
2
(
assuming
it
is
the
[
64
1
]
active
VC
)
one
view
and
interact
with
VC
#
2
(
assuming
it
is
the
[
64
2
]
active
VC
)
one
can
run
something
like
:
x11vnc
-
rawfb
map
:/
dev
/
fb0
@
1024
x768x16
-
pipeinput
'./vcinject.pl 2'
...
...
@@ -5767,7 +5796,7 @@ EndSection
better to use the more accurate and faster LinuxVNC program. The
advantage x11vnc -rawfb might have is that it can allow interaction
with a non-text application, e.g. one based on SVGAlib or
[64
2]Qt-embedded Also, for example the [643
]VMWare Fullscreen mode is
[64
3]Qt-embedded Also, for example the [644
]VMWare Fullscreen mode is
actually viewable under -rawfb and can be interacted with if uinput is
enabled.
...
...
@@ -5787,9 +5816,9 @@ EndSection
Q
-
99
:
Can
I
export
via
VNC
a
Webcam
or
TV
tuner
framebuffer
using
x11vnc
?
Yes
,
this
is
possible
to
some
degree
with
the
[
64
4
]-
rawfb
option
.
Yes
,
this
is
possible
to
some
degree
with
the
[
64
5
]-
rawfb
option
.
There
is
no
X11
involved
:
snapshots
from
the
video
capture
device
are
used
for
the
screen
image
data
.
See
the
[
64
5
]
previous
FAQ
on
-
rawfb
used
for
the
screen
image
data
.
See
the
[
64
6
]
previous
FAQ
on
-
rawfb
for
background
.
For
best
results
,
use
x11vnc
version
0.8.1
or
later
.
Roughly
,
one
would
do
something
like
this
:
...
...
@@ -5801,7 +5830,7 @@ EndSection
snapshot
to
a
file
that
you
point
-
rawfb
to
;
ask
me
if
it
is
not
clear
what
to
do
).
The
"snap:"
enforces
[
64
6
]-
snapfb
mode
which
appears
to
be
necessary
.
The
"snap:"
enforces
[
64
7
]-
snapfb
mode
which
appears
to
be
necessary
.
The
read
pointer
for
video
capture
devices
cannot
be
repositioned
(
which
would
be
needed
for
scanline
polling
),
but
you
can
read
a
full
frame
of
data
from
the
device
.
...
...
@@ -5823,7 +5852,7 @@ EndSection
Many
video4linux
drivers
tend
to
set
the
framebuffer
to
be
24
bpp
(
as
opposed
to
32
bpp
).
Since
this
can
cause
problems
with
VNC
viewers
,
etc
,
the
[
64
7
]-
24
to32
option
will
be
automatically
imposed
when
in
etc
,
the
[
64
8
]-
24
to32
option
will
be
automatically
imposed
when
in
24
bpp
.
Note
that
by
its
very
nature
,
video
capture
involves
rapid
change
in
...
...
@@ -5831,7 +5860,7 @@ EndSection
wavering
in
brightness
is
always
happening
.
This
can
lead
to
much
network
bandwidth
consumption
for
the
VNC
traffic
and
also
local
CPU
and
I
/
O
resource
usage
.
You
may
want
to
experiment
with
"dialing down"
the
framerate
via
the
[
64
8
]-
wait
,
[
649
]-
slow_fb
,
or
[
650
]-
defer
the
framerate
via
the
[
64
9
]-
wait
,
[
650
]-
slow_fb
,
or
[
651
]-
defer
options
.
Decreasing
the
window
size
and
bpp
also
helps
.
...
...
@@ -5920,7 +5949,7 @@ EndSection
format to HI240, RGB565, RGB24, RGB32, RGB555, and
GREY respectively. See -rawfb video for details.
See also the [65
1
]-freqtab option to supply your own xawtv channel to
See also the [65
2
]-freqtab option to supply your own xawtv channel to
frequency mappings for your country (only ntsc-cable-us is built into
x11vnc).
...
...
@@ -5929,7 +5958,7 @@ EndSection
running on my handheld or PC using the Linux console framebuffer (i.e.
not X11)?
Yes, the basic method for this is the [65
2
]-rawfb scheme where the
Yes, the basic method for this is the [65
3
]-rawfb scheme where the
Linux console framebuffer (usually /dev/fb0) is polled and the uinput
driver is used to inject keystrokes and mouse input. Often you will
just have to type:
...
...
@@ -5942,7 +5971,7 @@ EndSection
x11vnc -rawfb /dev/fb0@640x480x16
Also, to force usage of the uinput injection method use "-pipeinput
UINPUT". See the [65
3
]-pipeinput description for tunable parameters,
UINPUT". See the [65
4
]-pipeinput description for tunable parameters,
etc.
One problem with the x11vnc uinput scheme is that it cannot guess the
...
...
@@ -5958,7 +5987,7 @@ EndSection
Even with the correct acceleration setting there is stil some drift
(probably because of the mouse threshold where the acceleration kicks
in) and so x11vnc needs to reposition the cursor from 0,0 about 5
times a second. See the [65
4
]-pipeinput UINPUT option for tuning
times a second. See the [65
5
]-pipeinput UINPUT option for tuning
parameters that can be set (there are some experimental thresh=N
tuning parameters as well)
...
...
@@ -5992,7 +6021,7 @@ EndSection
Q-101: Now that non-X11 devices can be exported via VNC using x11vnc,
can I build it with no dependencies on X11 header files and libraries?
Yes, as of Jul/2006 x11vnc enables building for [65
5
]-rawfb only
Yes, as of Jul/2006 x11vnc enables building for [65
6
]-rawfb only
support. Just do something like when building:
./configure --without-x (plus any other flags)
make
...
...
@@ -6008,11 +6037,11 @@ EndSection
Yes
,
since
Nov
/
2006
in
the
development
tree
(
x11vnc
-
0.8.4
tarball
)
there
is
support
for
native
Mac
OS
X
Aqua
/
Quartz
displays
using
the
[
65
6
]-
rawfb
mechanism
described
above
.
The
mouse
and
keyboard
input
is
[
65
7
]-
rawfb
mechanism
described
above
.
The
mouse
and
keyboard
input
is
acheived
via
Mac
OS
X
API
's.
So you can use x11vnc as an alternative to [65
7
]OSXvnc (aka Vine
Server), or [65
8
]Apple Remote Desktop (ARD). Perhaps there is some
So you can use x11vnc as an alternative to [65
8
]OSXvnc (aka Vine
Server), or [65
9
]Apple Remote Desktop (ARD). Perhaps there is some
x11vnc feature you'
d
like
to
use
on
Mac
OS
X
,
etc
.
Notes
:
...
...
@@ -6021,7 +6050,7 @@ EndSection
(
XDarwin
)
running
on
Mac
OS
X
(
people
often
install
this
software
to
display
remote
X11
apps
on
their
Mac
OS
X
system
,
or
use
some
old
favorites
locally
such
as
xterm
).
However
in
this
case
x11vnc
will
only
work
reasonably
in
single
window
[
6
59
]-
id
windowid
mode
(
and
the
only
work
reasonably
in
single
window
[
6
60
]-
id
windowid
mode
(
and
the
window
may
need
to
have
mouse
focus
).
If
you
do
not
have
the
DISPLAY
env
.
variable
set
,
x11vnc
will
assume
...
...
@@ -6035,9 +6064,9 @@ EndSection
./configure --without-x
make
Win2VNC/x2vnc: One handy use is to use the [66
0
]-nofb mode to
Win2VNC/x2vnc: One handy use is to use the [66
1
]-nofb mode to
redirect mouse and keyboard input to a nearby Mac (i.e. one to the
side of your desk) via [66
1]x2vnc or Win2VNC. See [662
]this FAQ for
side of your desk) via [66
2]x2vnc or Win2VNC. See [663
]this FAQ for
more info.
Options: Here are the Mac OS X specific x11vnc options:
...
...
@@ -6107,11 +6136,11 @@ rm -f $tmp
As of Jan/2004 x11vnc supports the "CutText" part of the rfb protocol.
Furthermore, x11vnc is able to hold the PRIMARY and CLIPBOARD
selection (Xvnc does not seem to do this). If you don'
t
want
the
Clipboard
/
Selection
exchanged
use
the
[
66
3
]-
nosel
option
.
If
you
don
't
Clipboard
/
Selection
exchanged
use
the
[
66
4
]-
nosel
option
.
If
you
don
't
want the PRIMARY selection to be polled for changes use the
[66
4
]-noprimary option. (with a similar thing for CLIPBOARD). You can
also fine-tune it a bit with the [66
5
]-seldir dir option and also
[66
6
]-input.
[66
5
]-noprimary option. (with a similar thing for CLIPBOARD). You can
also fine-tune it a bit with the [66
6
]-seldir dir option and also
[66
7
]-input.
You may need to watch out for desktop utilities such as KDE'
s
"Klipper"
that
do
odd
things
with
the
selection
,
clipboard
,
and
...
...
@@ -6123,7 +6152,7 @@ rm -f $tmp
Yes
,
it
is
possible
with
a
number
of
tools
that
record
VNC
and
transform
it
to
swf
format
or
others
.
One
such
popular
tool
is
[
66
7
]
pyvnc2swf
.
There
are
a
number
of
[
668
]
tutorials
on
how
to
do
[
66
8
]
pyvnc2swf
.
There
are
a
number
of
[
669
]
tutorials
on
how
to
do
this
.
Another
option
is
to
use
the
vnc2mpg
that
comes
in
the
LibVNCServer
package
.
An
important
thing
to
remember
when
doing
this
is
that
tuning
...
...
@@ -6138,7 +6167,7 @@ rm -f $tmp
(
and
Windows
viewers
only
support
filetransfer
it
appears
).
TightVNC
file
transfer
is
on
by
default
,
if
you
want
to
disable
it
use
the
[
6
69
]-
nofilexfer
option
.
UltraVNC
file
transfer
is
currently
off
the
[
6
70
]-
nofilexfer
option
.
UltraVNC
file
transfer
is
currently
off
by
default
,
to
enable
it
use
something
like
"-rfbversion 3.6
-permitfiletransfer"
options
(
UltraVNC
incorrectly
uses
the
RFB
protocol
version
to
...
...
@@ -6154,7 +6183,7 @@ rm -f $tmp
You
will
have
to
use
an
external
network
redirection
for
this
.
Filesystem
mounting
is
not
part
of
the
VNC
protocol
.
We
show
a
simple
[
67
0
]
Samba
example
here
.
We
show
a
simple
[
67
1
]
Samba
example
here
.
First
you
will
need
a
tunnel
to
redirect
the
SMB
requests
from
the
remote
machine
to
the
one
you
sitting
at
.
We
use
an
ssh
tunnel
:
...
...
@@ -6191,7 +6220,7 @@ d,ip=127.0.0.1,port=1139
far
-
away
>
smbumount
/
home
/
fred
/
smb
-
haystack
-
pub
At
some
point
we
hope
to
fold
some
automation
for
SMB
ssh
redir
setup
into
the
[
67
1
]
Enhanced
TightVNC
Viewer
(
ssvnc
)
package
we
provide
(
as
into
the
[
67
2
]
Enhanced
TightVNC
Viewer
(
ssvnc
)
package
we
provide
(
as
of
Sep
2006
it
is
there
for
testing
).
...
...
@@ -6201,7 +6230,7 @@ d,ip=127.0.0.1,port=1139
You
will
have
to
use
an
external
network
redirection
for
this
.
Printing
is
not
part
of
the
VNC
protocol
.
We
show
a
simple
Unix
to
Unix
[
67
2
]
CUPS
example
here
.
Non
-
CUPS
port
We
show
a
simple
Unix
to
Unix
[
67
3
]
CUPS
example
here
.
Non
-
CUPS
port
redirections
(
e
.
g
.
LPD
)
should
also
be
possible
,
but
may
be
a
bit
more
tricky
.
If
you
are
viewing
on
Windows
SMB
and
don
't have a local cups
server it may be trickier still (see below).
...
...
@@ -6273,7 +6302,7 @@ d,ip=127.0.0.1,port=1139
"localhost".
At some point we hope to fold some automation for CUPS ssh redir setup
into the [67
3
]Enhanced TightVNC Viewer (ssvnc) package we provide (as
into the [67
4
]Enhanced TightVNC Viewer (ssvnc) package we provide (as
of Sep 2006 it is there for testing).
...
...
@@ -6374,7 +6403,7 @@ or:
the applications will fail to run because LD_PRELOAD will point to
libraries of the wrong wordsize.
* At some point we hope to fold some automation for esd or artsd ssh
redir setup into the [67
4
]Enhanced TightVNC Viewer (ssvnc) package
redir setup into the [67
5
]Enhanced TightVNC Viewer (ssvnc) package
we provide (as of Sep/2006 it is there for testing).
...
...
@@ -6386,9 +6415,9 @@ or:
in
Solaris
,
see
Xserver
(
1
)
for
how
to
turn
it
on
via
+
kb
),
and
so
you
won
't hear them if the extension is not present.
If you don'
t
want
to
hear
the
beeps
use
the
[
67
5
]-
nobell
option
.
If
If you don'
t
want
to
hear
the
beeps
use
the
[
67
6
]-
nobell
option
.
If
you
want
to
hear
the
audio
from
the
remote
applications
,
consider
trying
a
[
67
6
]
redirector
such
as
esd
.
trying
a
[
67
7
]
redirector
such
as
esd
.
...
...
@@ -6953,134 +6982,135 @@ References
546.
http
://
www
.
karlrunge
.
com
/
x11vnc
/
x11vnc_opts
.
html
#
opt
-
scrollcopyrect
547.
http
://
www
.
karlrunge
.
com
/
x11vnc
/
index
.
html
#
beta
-
test
548.
http
://
www
.
karlrunge
.
com
/
x11vnc
/
x11vnc_opts
.
html
#
opt
-
ncache
549.
http
://
www
.
karlrunge
.
com
/
x11vnc
/
x11vnc_opts
.
html
#
opt
-
curso
r
549.
http
://
www
.
karlrunge
.
com
/
x11vnc
/
x11vnc_opts
.
html
#
opt
-
ncache_c
r
550.
http
://
www
.
karlrunge
.
com
/
x11vnc
/
x11vnc_opts
.
html
#
opt
-
cursor
551.
http
://
www
.
karlrunge
.
com
/
x11vnc
/
x11vnc_opts
.
html
#
opt
-
overlay
552.
http
://
www
.
karlrunge
.
com
/
x11vnc
/
index
.
html
#
the
-
overlay
-
mode
553.
http
://
www
.
karlrunge
.
com
/
x11vnc
/
index
.
html
#
solaris10
-
build
554.
http
://
www
.
karlrunge
.
com
/
x11vnc
/
index
.
html
#
faq
-
xfixes
-
alpha
-
hacks
555.
http
://
www
.
karlrunge
.
com
/
x11vnc
/
x11vnc_opts
.
html
#
opt
-
alphacut
556.
http
://
www
.
karlrunge
.
com
/
x11vnc
/
x11vnc_opts
.
html
#
opt
-
alpha
frac
557.
http
://
www
.
karlrunge
.
com
/
x11vnc
/
x11vnc_opts
.
html
#
opt
-
alpha
remove
558.
http
://
www
.
karlrunge
.
com
/
x11vnc
/
x11vnc_opts
.
html
#
opt
-
nocursorshap
e
559.
http
://
www
.
karlrunge
.
com
/
x11vnc
/
x11vnc_opts
.
html
#
opt
-
no
alphablend
560.
http
://
www
.
karlrunge
.
com
/
x11vnc
/
enhanced_tightvnc_viewer
.
html
561.
http
://
www
.
tightvnc
.
com
/
562.
http
://
www
.
karlrunge
.
com
/
x11vnc
/
x11vnc_opts
.
html
#
opt
-
nocursor
563.
http
://
www
.
karlrunge
.
com
/
x11vnc
/
x11vnc_opts
.
html
#
opt
-
cursorpos
564.
http
://
www
.
karlrunge
.
com
/
x11vnc
/
x11vnc_opts
.
html
#
opt
-
no
cursorpos
565.
http
://
www
.
karlrunge
.
com
/
x11vnc
/
x11vnc_opts
.
html
#
opt
-
nocursor
shape
566.
http
://
www
.
karlrunge
.
com
/
x11vnc
/
x11vnc_opts
.
html
#
opt
-
buttonmap
567.
http
://
www
.
karlrunge
.
com
/
x11vnc
/
x11vnc_opts
.
html
#
opt
-
debug_pointer
568.
http
://
www
.
karlrunge
.
com
/
x11vnc
/
x11vnc_opts
.
html
#
opt
-
buttonmap
569.
http
://
www
.
karlrunge
.
com
/
x11vnc
/
x11vnc_opts
.
html
#
opt
-
modtweak
570.
http
://
www
.
karlrunge
.
com
/
x11vnc
/
index
.
html
#
faq
-
greaterless
571.
http
://
www
.
karlrunge
.
com
/
x11vnc
/
index
.
html
#
faq
-
xkbmodtweak
572.
http
://
www
.
karlrunge
.
com
/
x11vnc
/
x11vnc_opts
.
html
#
opt
-
debug_keyboard
573.
http
://
www
.
karlrunge
.
com
/
x11vnc
/
x11vnc_opts
.
html
#
opt
-
xkb
574.
http
://
www
.
karlrunge
.
com
/
x11vnc
/
x11vnc_opts
.
html
#
opt
-
sloppy_keys
575.
http
://
www
.
karlrunge
.
com
/
x11vnc
/
x11vnc_opts
.
html
#
opt
-
modtweak
551.
http
://
www
.
karlrunge
.
com
/
x11vnc
/
x11vnc_opts
.
html
#
opt
-
cursor
552.
http
://
www
.
karlrunge
.
com
/
x11vnc
/
x11vnc_opts
.
html
#
opt
-
overlay
553.
http
://
www
.
karlrunge
.
com
/
x11vnc
/
index
.
html
#
the
-
overlay
-
mode
554.
http
://
www
.
karlrunge
.
com
/
x11vnc
/
index
.
html
#
solaris10
-
build
555.
http
://
www
.
karlrunge
.
com
/
x11vnc
/
index
.
html
#
faq
-
xfixes
-
alpha
-
hacks
556.
http
://
www
.
karlrunge
.
com
/
x11vnc
/
x11vnc_opts
.
html
#
opt
-
alpha
cut
557.
http
://
www
.
karlrunge
.
com
/
x11vnc
/
x11vnc_opts
.
html
#
opt
-
alpha
frac
558.
http
://
www
.
karlrunge
.
com
/
x11vnc
/
x11vnc_opts
.
html
#
opt
-
alpharemov
e
559.
http
://
www
.
karlrunge
.
com
/
x11vnc
/
x11vnc_opts
.
html
#
opt
-
no
cursorshape
560.
http
://
www
.
karlrunge
.
com
/
x11vnc
/
x11vnc_opts
.
html
#
opt
-
noalphablend
561.
http
://
www
.
karlrunge
.
com
/
x11vnc
/
enhanced_tightvnc_viewer
.
html
562.
http
://
www
.
tightvnc
.
com
/
563.
http
://
www
.
karlrunge
.
com
/
x11vnc
/
x11vnc_opts
.
html
#
opt
-
nocursor
564.
http
://
www
.
karlrunge
.
com
/
x11vnc
/
x11vnc_opts
.
html
#
opt
-
cursorpos
565.
http
://
www
.
karlrunge
.
com
/
x11vnc
/
x11vnc_opts
.
html
#
opt
-
nocursor
pos
566.
http
://
www
.
karlrunge
.
com
/
x11vnc
/
x11vnc_opts
.
html
#
opt
-
nocursorshape
567.
http
://
www
.
karlrunge
.
com
/
x11vnc
/
x11vnc_opts
.
html
#
opt
-
buttonmap
568.
http
://
www
.
karlrunge
.
com
/
x11vnc
/
x11vnc_opts
.
html
#
opt
-
debug_pointer
569.
http
://
www
.
karlrunge
.
com
/
x11vnc
/
x11vnc_opts
.
html
#
opt
-
buttonmap
570.
http
://
www
.
karlrunge
.
com
/
x11vnc
/
x11vnc_opts
.
html
#
opt
-
modtweak
571.
http
://
www
.
karlrunge
.
com
/
x11vnc
/
index
.
html
#
faq
-
greaterless
572.
http
://
www
.
karlrunge
.
com
/
x11vnc
/
index
.
html
#
faq
-
xkbmodtweak
573.
http
://
www
.
karlrunge
.
com
/
x11vnc
/
x11vnc_opts
.
html
#
opt
-
debug_keyboard
574.
http
://
www
.
karlrunge
.
com
/
x11vnc
/
x11vnc_opts
.
html
#
opt
-
xkb
575.
http
://
www
.
karlrunge
.
com
/
x11vnc
/
x11vnc_opts
.
html
#
opt
-
sloppy_keys
576.
http
://
www
.
karlrunge
.
com
/
x11vnc
/
x11vnc_opts
.
html
#
opt
-
modtweak
577.
http
://
www
.
karlrunge
.
com
/
x11vnc
/
x11vnc_opts
.
html
#
opt
-
remap
578.
http
://
www
.
karlrunge
.
com
/
x11vnc
/
index
.
html
#
faq
-
xkbmodtweak
579.
http
://
www
.
karlrunge
.
com
/
x11vnc
/
x11vnc_opts
.
html
#
opt
-
debug_keyboard
580.
http
://
www
.
karlrunge
.
com
/
x11vnc
/
index
.
html
#
faq
-
greaterless
581.
http
://
www
.
karlrunge
.
com
/
x11vnc
/
x11vnc_opts
.
html
#
opt
-
xkb
582.
http
://
www
.
karlrunge
.
com
/
x11vnc
/
x11vnc_opts
.
html
#
opt
-
sloppy_keys
583.
http
://
www
.
karlrunge
.
com
/
x11vnc
/
x11vnc_opts
.
html
#
opt
-
modtweak
584.
http
://
www
.
karlrunge
.
com
/
x11vnc
/
x11vnc_opts
.
html
#
opt
-
xkb
577.
http
://
www
.
karlrunge
.
com
/
x11vnc
/
x11vnc_opts
.
html
#
opt
-
modtweak
578.
http
://
www
.
karlrunge
.
com
/
x11vnc
/
x11vnc_opts
.
html
#
opt
-
remap
579.
http
://
www
.
karlrunge
.
com
/
x11vnc
/
index
.
html
#
faq
-
xkbmodtweak
580.
http
://
www
.
karlrunge
.
com
/
x11vnc
/
x11vnc_opts
.
html
#
opt
-
debug_keyboard
581.
http
://
www
.
karlrunge
.
com
/
x11vnc
/
index
.
html
#
faq
-
greaterless
582.
http
://
www
.
karlrunge
.
com
/
x11vnc
/
x11vnc_opts
.
html
#
opt
-
xkb
583.
http
://
www
.
karlrunge
.
com
/
x11vnc
/
x11vnc_opts
.
html
#
opt
-
sloppy_keys
584.
http
://
www
.
karlrunge
.
com
/
x11vnc
/
x11vnc_opts
.
html
#
opt
-
modtweak
585.
http
://
www
.
karlrunge
.
com
/
x11vnc
/
x11vnc_opts
.
html
#
opt
-
xkb
586.
http
://
www
.
karlrunge
.
com
/
x11vnc
/
x11vnc_opts
.
html
#
opt
-
skip_keycodes
587.
http
://
www
.
karlrunge
.
com
/
x11vnc
/
x11vnc_opts
.
html
#
opt
-
remap
588.
http
://
www
.
karlrunge
.
com
/
x11vnc
/
x11vnc_opts
.
html
#
opt
-
add_keysyms
589.
http
://
www
.
karlrunge
.
com
/
x11vnc
/
x11vnc_opts
.
html
#
opt
-
remap
586.
http
://
www
.
karlrunge
.
com
/
x11vnc
/
x11vnc_opts
.
html
#
opt
-
xkb
587.
http
://
www
.
karlrunge
.
com
/
x11vnc
/
x11vnc_opts
.
html
#
opt
-
skip_keycodes
588.
http
://
www
.
karlrunge
.
com
/
x11vnc
/
x11vnc_opts
.
html
#
opt
-
remap
589.
http
://
www
.
karlrunge
.
com
/
x11vnc
/
x11vnc_opts
.
html
#
opt
-
add_keysyms
590.
http
://
www
.
karlrunge
.
com
/
x11vnc
/
x11vnc_opts
.
html
#
opt
-
remap
591.
http
://
www
.
karlrunge
.
com
/
x11vnc
/
x11vnc_opts
.
html
#
opt
-
add_keysyms
592.
http
://
www
.
karlrunge
.
com
/
x11vnc
/
x11vnc_opts
.
html
#
opt
-
norepeat
591.
http
://
www
.
karlrunge
.
com
/
x11vnc
/
x11vnc_opts
.
html
#
opt
-
remap
592.
http
://
www
.
karlrunge
.
com
/
x11vnc
/
x11vnc_opts
.
html
#
opt
-
add_keysyms
593.
http
://
www
.
karlrunge
.
com
/
x11vnc
/
x11vnc_opts
.
html
#
opt
-
norepeat
594.
http
://
www
.
karlrunge
.
com
/
x11vnc
/
index
.
html
#
faq
-
display
-
manager
595.
http
://
www
.
karlrunge
.
com
/
x11vnc
/
x11vnc_opts
.
html
#
opt
-
remap
594.
http
://
www
.
karlrunge
.
com
/
x11vnc
/
x11vnc_opts
.
html
#
opt
-
norepeat
595.
http
://
www
.
karlrunge
.
com
/
x11vnc
/
index
.
html
#
faq
-
display
-
manager
596.
http
://
www
.
karlrunge
.
com
/
x11vnc
/
x11vnc_opts
.
html
#
opt
-
remap
597.
http
://
www
.
karlrunge
.
com
/
x11vnc
/
x11vnc_opts
.
html
#
opt
-
remap
598.
http
://
www
.
karlrunge
.
com
/
x11vnc
/
x11vnc_opts
.
html
#
opt
-
remap
599.
http
://
www
.
karlrunge
.
com
/
x11vnc
/
x11vnc_opts
.
html
#
opt
-
skip_lockkeys
600.
http
://
www
.
karlrunge
.
com
/
x11vnc
/
x11vnc_opts
.
html
#
opt
-
remap
601.
http
://
www
.
karlrunge
.
com
/
x11vnc
/
x11vnc_opts
.
html
#
opt
-
nomodtweak
602.
http
://
www
.
karlrunge
.
com
/
x11vnc
/
x11vnc_opts
.
html
#
opt
-
capsloc
k
603.
http
://
www
.
karlrunge
.
com
/
x11vnc
/
index
.
html
#
faq
-
scaling
604.
http
://
www
.
karlrunge
.
com
/
x11vnc
/
x11vnc_opts
.
html
#
opt
-
scale
605.
http
://
www
.
cus
.
cam
.
ac
.
uk
/~
ssb22
/
source
/
vnc
-
magnification
.
html
606.
http
://
www
.
karlrunge
.
com
/
x11vnc
/
x11vnc_opts
.
html
#
opt
-
rfbport
607.
http
://
www
.
karlrunge
.
com
/
x11vnc
/
x11vnc_opts
.
html
#
opt
-
gui
608.
http
://
www
.
karlrunge
.
com
/
x11vnc
/
x11vnc_opts
.
html
#
opt
-
connect
609.
http
://
www
.
karlrunge
.
com
/
x11vnc
/
x11vnc_opts
.
html
#
opt
-
scale_cursor
610.
http
://
www
.
karlrunge
.
com
/
x11vnc
/
x11vnc_opts
.
html
#
opt
-
blackout
611.
http
://
www
.
karlrunge
.
com
/
x11vnc
/
x11vnc_opts
.
html
#
opt
-
xinerama
599.
http
://
www
.
karlrunge
.
com
/
x11vnc
/
x11vnc_opts
.
html
#
opt
-
remap
600.
http
://
www
.
karlrunge
.
com
/
x11vnc
/
x11vnc_opts
.
html
#
opt
-
skip_lockkeys
601.
http
://
www
.
karlrunge
.
com
/
x11vnc
/
x11vnc_opts
.
html
#
opt
-
remap
602.
http
://
www
.
karlrunge
.
com
/
x11vnc
/
x11vnc_opts
.
html
#
opt
-
nomodtwea
k
603.
http
://
www
.
karlrunge
.
com
/
x11vnc
/
x11vnc_opts
.
html
#
opt
-
capslock
604.
http
://
www
.
karlrunge
.
com
/
x11vnc
/
index
.
html
#
faq
-
scaling
605.
http
://
www
.
karlrunge
.
com
/
x11vnc
/
x11vnc_opts
.
html
#
opt
-
scale
606.
http
://
www
.
cus
.
cam
.
ac
.
uk
/~
ssb22
/
source
/
vnc
-
magnification
.
html
607.
http
://
www
.
karlrunge
.
com
/
x11vnc
/
x11vnc_opts
.
html
#
opt
-
rfbport
608.
http
://
www
.
karlrunge
.
com
/
x11vnc
/
x11vnc_opts
.
html
#
opt
-
gui
609.
http
://
www
.
karlrunge
.
com
/
x11vnc
/
x11vnc_opts
.
html
#
opt
-
connect
610.
http
://
www
.
karlrunge
.
com
/
x11vnc
/
x11vnc_opts
.
html
#
opt
-
scale_cursor
611.
http
://
www
.
karlrunge
.
com
/
x11vnc
/
x11vnc_opts
.
html
#
opt
-
blackout
612.
http
://
www
.
karlrunge
.
com
/
x11vnc
/
x11vnc_opts
.
html
#
opt
-
xinerama
613.
http
://
www
.
karlrunge
.
com
/
x11vnc
/
x11vnc_opts
.
html
#
opt
-
x
warppointer
614.
http
://
www
.
karlrunge
.
com
/
x11vnc
/
index
.
html
#
faq
-
solshm
615.
http
://
www
.
karlrunge
.
com
/
x11vnc
/
x11vnc_opts
.
html
#
opt
-
onetile
616.
http
://
www
.
karlrunge
.
com
/
x11vnc
/
x11vnc_opts
.
html
#
opt
-
noshm
617.
http
://
www
.
karlrunge
.
com
/
x11vnc
/
x11vnc_opts
.
html
#
opt
-
clip
618.
http
://
www
.
karlrunge
.
com
/
x11vnc
/
index
.
html
#
faq
-
xinerama
619.
http
://
www
.
karlrunge
.
com
/
x11vnc
/
x11vnc_opts
.
html
#
opt
-
id
613.
http
://
www
.
karlrunge
.
com
/
x11vnc
/
x11vnc_opts
.
html
#
opt
-
x
inerama
614.
http
://
www
.
karlrunge
.
com
/
x11vnc
/
x11vnc_opts
.
html
#
opt
-
xwarppointer
615.
http
://
www
.
karlrunge
.
com
/
x11vnc
/
index
.
html
#
faq
-
solshm
616.
http
://
www
.
karlrunge
.
com
/
x11vnc
/
x11vnc_opts
.
html
#
opt
-
onetile
617.
http
://
www
.
karlrunge
.
com
/
x11vnc
/
x11vnc_opts
.
html
#
opt
-
noshm
618.
http
://
www
.
karlrunge
.
com
/
x11vnc
/
x11vnc_opts
.
html
#
opt
-
clip
619.
http
://
www
.
karlrunge
.
com
/
x11vnc
/
index
.
html
#
faq
-
xinerama
620.
http
://
www
.
karlrunge
.
com
/
x11vnc
/
x11vnc_opts
.
html
#
opt
-
id
621.
http
://
www
.
karlrunge
.
com
/
x11vnc
/
x11vnc_opts
.
html
#
opt
-
xrandr
622.
http
://
www
.
karlrunge
.
com
/
x11vnc
/
x11vnc_opts
.
html
#
opt
-
padgeom
623.
http
://
www
.
karlrunge
.
com
/
x11vnc
/
enhanced_tightvnc_viewer
.
html
624.
http
://
www
.
karlrunge
.
com
/
x11vnc
/
x11vnc_opts
.
html
#
opt
-
rotate
625.
http
://
www
.
jwz
.
org
/
xscreensaver
/
man1
.
html
626.
http
://
www
.
karlrunge
.
com
/
x11vnc
/
x11vnc_opts
.
html
#
opt
-
nodpms
627.
http
://
www
.
karlrunge
.
com
/
x11vnc
/
index
.
html
#
faq
-
linuxvc
628.
http
://
www
.
karlrunge
.
com
/
x11vnc
/
index
.
html
#
faq
-
rawfb
629.
http
://
www
.
karlrunge
.
com
/
x11vnc
/
index
.
html
#
faq
-
linuxvc
630.
http
://
www
.
karlrunge
.
com
/
x11vnc
/
x11vnc_opts
.
html
#
opt
-
id
631.
http
://
www
.
karlrunge
.
com
/
x11vnc
/
x11vnc_opts
.
html
#
opt
-
rawfb
632.
http
://
www
.
karlrunge
.
com
/
x11vnc
/
x11vnc_opts
.
html
#
opt
-
pipeinput
621.
http
://
www
.
karlrunge
.
com
/
x11vnc
/
x11vnc_opts
.
html
#
opt
-
id
622.
http
://
www
.
karlrunge
.
com
/
x11vnc
/
x11vnc_opts
.
html
#
opt
-
xrandr
623.
http
://
www
.
karlrunge
.
com
/
x11vnc
/
x11vnc_opts
.
html
#
opt
-
padgeom
624.
http
://
www
.
karlrunge
.
com
/
x11vnc
/
enhanced_tightvnc_viewer
.
html
625.
http
://
www
.
karlrunge
.
com
/
x11vnc
/
x11vnc_opts
.
html
#
opt
-
rotate
626.
http
://
www
.
jwz
.
org
/
xscreensaver
/
man1
.
html
627.
http
://
www
.
karlrunge
.
com
/
x11vnc
/
x11vnc_opts
.
html
#
opt
-
nodpms
628.
http
://
www
.
karlrunge
.
com
/
x11vnc
/
index
.
html
#
faq
-
linuxvc
629.
http
://
www
.
karlrunge
.
com
/
x11vnc
/
index
.
html
#
faq
-
rawfb
630.
http
://
www
.
karlrunge
.
com
/
x11vnc
/
index
.
html
#
faq
-
linuxvc
631.
http
://
www
.
karlrunge
.
com
/
x11vnc
/
x11vnc_opts
.
html
#
opt
-
id
632.
http
://
www
.
karlrunge
.
com
/
x11vnc
/
x11vnc_opts
.
html
#
opt
-
rawfb
633.
http
://
www
.
karlrunge
.
com
/
x11vnc
/
x11vnc_opts
.
html
#
opt
-
pipeinput
634.
http
://
www
.
karlrunge
.
com
/
x11vnc
/
x11vnc_opts
.
html
#
opt
-
snapfb
635.
http
://
www
.
karlrunge
.
com
/
x11vnc
/
index
.
html
#
faq
-
video
636.
http
://
www
.
karlrunge
.
com
/
x11vnc
/
index
.
html
#
faq
-
xvfb
637.
http
://
www
.
karlrunge
.
com
/
x11vnc
/
index
.
html
#
faq
-
qt
-
embedded
638.
http
://
www
.
karlrunge
.
com
/
x11vnc
/
index
.
html
#
faq
-
video
639.
http
://
www
.
karlrunge
.
com
/
x11vnc
/
x11vnc_opts
.
html
#
opt
-
rawfb
640.
http
://
www
.
karlrunge
.
com
/
x11vnc
/
index
.
html
#
faq
-
video
641.
http
://
www
.
karlrunge
.
com
/
x11vnc
/
index
.
html
#
faq
-
linuxvc
642.
http
://
www
.
karlrunge
.
com
/
x11vnc
/
index
.
html
#
faq
-
qt
-
embedded
643.
http
://
www
.
karlrunge
.
com
/
x11vnc
/
index
.
html
#
faq
-
vmware
644.
http
://
www
.
karlrunge
.
com
/
x11vnc
/
x11vnc_opts
.
html
#
opt
-
rawfb
645.
http
://
www
.
karlrunge
.
com
/
x11vnc
/
index
.
html
#
faq
-
rawfb
646.
http
://
www
.
karlrunge
.
com
/
x11vnc
/
x11vnc_opts
.
html
#
opt
-
snap
fb
647.
http
://
www
.
karlrunge
.
com
/
x11vnc
/
x11vnc_opts
.
html
#
opt
-
24
to32
648.
http
://
www
.
karlrunge
.
com
/
x11vnc
/
x11vnc_opts
.
html
#
opt
-
wait
649.
http
://
www
.
karlrunge
.
com
/
x11vnc
/
x11vnc_opts
.
html
#
opt
-
slow_fb
650.
http
://
www
.
karlrunge
.
com
/
x11vnc
/
x11vnc_opts
.
html
#
opt
-
defer
651.
http
://
www
.
karlrunge
.
com
/
x11vnc
/
x11vnc_opts
.
html
#
opt
-
freqtab
652.
http
://
www
.
karlrunge
.
com
/
x11vnc
/
index
.
html
#
faq
-
rawf
b
653.
http
://
www
.
karlrunge
.
com
/
x11vnc
/
x11vnc_opts
.
html
#
opt
-
pipeinput
634.
http
://
www
.
karlrunge
.
com
/
x11vnc
/
x11vnc_opts
.
html
#
opt
-
pipeinput
635.
http
://
www
.
karlrunge
.
com
/
x11vnc
/
x11vnc_opts
.
html
#
opt
-
snapfb
636.
http
://
www
.
karlrunge
.
com
/
x11vnc
/
index
.
html
#
faq
-
video
637.
http
://
www
.
karlrunge
.
com
/
x11vnc
/
index
.
html
#
faq
-
xvfb
638.
http
://
www
.
karlrunge
.
com
/
x11vnc
/
index
.
html
#
faq
-
qt
-
embedded
639.
http
://
www
.
karlrunge
.
com
/
x11vnc
/
index
.
html
#
faq
-
video
640.
http
://
www
.
karlrunge
.
com
/
x11vnc
/
x11vnc_opts
.
html
#
opt
-
rawfb
641.
http
://
www
.
karlrunge
.
com
/
x11vnc
/
index
.
html
#
faq
-
video
642.
http
://
www
.
karlrunge
.
com
/
x11vnc
/
index
.
html
#
faq
-
linuxvc
643.
http
://
www
.
karlrunge
.
com
/
x11vnc
/
index
.
html
#
faq
-
qt
-
embedded
644.
http
://
www
.
karlrunge
.
com
/
x11vnc
/
index
.
html
#
faq
-
vmware
645.
http
://
www
.
karlrunge
.
com
/
x11vnc
/
x11vnc_opts
.
html
#
opt
-
rawfb
646.
http
://
www
.
karlrunge
.
com
/
x11vnc
/
index
.
html
#
faq
-
raw
fb
647.
http
://
www
.
karlrunge
.
com
/
x11vnc
/
x11vnc_opts
.
html
#
opt
-
snapfb
648.
http
://
www
.
karlrunge
.
com
/
x11vnc
/
x11vnc_opts
.
html
#
opt
-
24
to32
649.
http
://
www
.
karlrunge
.
com
/
x11vnc
/
x11vnc_opts
.
html
#
opt
-
wait
650.
http
://
www
.
karlrunge
.
com
/
x11vnc
/
x11vnc_opts
.
html
#
opt
-
slow_fb
651.
http
://
www
.
karlrunge
.
com
/
x11vnc
/
x11vnc_opts
.
html
#
opt
-
defer
652.
http
://
www
.
karlrunge
.
com
/
x11vnc
/
x11vnc_opts
.
html
#
opt
-
freqta
b
653.
http
://
www
.
karlrunge
.
com
/
x11vnc
/
index
.
html
#
faq
-
rawfb
654.
http
://
www
.
karlrunge
.
com
/
x11vnc
/
x11vnc_opts
.
html
#
opt
-
pipeinput
655.
http
://
www
.
karlrunge
.
com
/
x11vnc
/
x11vnc_opts
.
html
#
opt
-
rawfb
655.
http
://
www
.
karlrunge
.
com
/
x11vnc
/
x11vnc_opts
.
html
#
opt
-
pipeinput
656.
http
://
www
.
karlrunge
.
com
/
x11vnc
/
x11vnc_opts
.
html
#
opt
-
rawfb
657.
http
://
www
.
redstonesoftware
.
com
/
vnc
.
html
658.
http
://
www
.
apple
.
com
/
remotedesktop
/
659.
http
://
www
.
karlrunge
.
com
/
x11vnc
/
x11vnc_opts
.
html
#
opt
-
id
657.
http
://
www
.
karlrunge
.
com
/
x11vnc
/
x11vnc_opts
.
html
#
opt
-
rawfb
658.
http
://
www
.
redstonesoftware
.
com
/
vnc
.
html
659.
http
://
www
.
apple
.
com
/
remotedesktop
/
660.
http
://
www
.
karlrunge
.
com
/
x11vnc
/
x11vnc_opts
.
html
#
opt
-
id
661.
http
://
fredrik
.
hubbe
.
net
/
x2vnc
.
html
662.
http
://
www
.
karlrunge
.
com
/
x11vnc
/
index
.
html
#
faq
-
win2vnc
663.
http
://
www
.
karlrunge
.
com
/
x11vnc
/
x11vnc_opts
.
html
#
opt
-
nosel
664.
http
://
www
.
karlrunge
.
com
/
x11vnc
/
x11vnc_opts
.
html
#
opt
-
no
primary
665.
http
://
www
.
karlrunge
.
com
/
x11vnc
/
x11vnc_opts
.
html
#
opt
-
seldir
666.
http
://
www
.
karlrunge
.
com
/
x11vnc
/
x11vnc_opts
.
html
#
opt
-
input
667.
http
://
www
.
unixuser
.
org
/~
euske
/
vnc2swf
/
668.
http
://
w
olphination
.
com
/
linux
/
2006
/
06
/
30
/
how
-
to
-
record
-
videos
-
of
-
your
-
desktop
/
669.
http
://
w
ww
.
karlrunge
.
com
/
x11vnc
/
x11vnc_opts
.
html
#
opt
-
nofilexfer
670.
http
://
www
.
samba
.
org
/
671.
http
://
www
.
karlrunge
.
com
/
x11vnc
/
enhanced_tightvnc_viewer
.
html
672.
http
://
www
.
cups
.
org
/
673.
http
://
www
.
karlrunge
.
com
/
x11vnc
/
enhanced_tightvnc_viewer
.
html
661.
http
://
www
.
karlrunge
.
com
/
x11vnc
/
x11vnc_opts
.
html
#
opt
-
id
662.
http
://
fredrik
.
hubbe
.
net
/
x2vnc
.
html
663.
http
://
www
.
karlrunge
.
com
/
x11vnc
/
index
.
html
#
faq
-
win2vnc
664.
http
://
www
.
karlrunge
.
com
/
x11vnc
/
x11vnc_opts
.
html
#
opt
-
no
sel
665.
http
://
www
.
karlrunge
.
com
/
x11vnc
/
x11vnc_opts
.
html
#
opt
-
noprimary
666.
http
://
www
.
karlrunge
.
com
/
x11vnc
/
x11vnc_opts
.
html
#
opt
-
seldir
667.
http
://
www
.
karlrunge
.
com
/
x11vnc
/
x11vnc_opts
.
html
#
opt
-
input
668.
http
://
w
ww
.
unixuser
.
org
/~
euske
/
vnc2swf
/
669.
http
://
w
olphination
.
com
/
linux
/
2006
/
06
/
30
/
how
-
to
-
record
-
videos
-
of
-
your
-
desktop
/
670.
http
://
www
.
karlrunge
.
com
/
x11vnc
/
x11vnc_opts
.
html
#
opt
-
nofilexfer
671.
http
://
www
.
samba
.
org
/
672.
http
://
www
.
karlrunge
.
com
/
x11vnc
/
enhanced_tightvnc_viewer
.
html
673.
http
://
www
.
cups
.
org
/
674.
http
://
www
.
karlrunge
.
com
/
x11vnc
/
enhanced_tightvnc_viewer
.
html
675.
http
://
www
.
karlrunge
.
com
/
x11vnc
/
x11vnc_opts
.
html
#
opt
-
nobell
676.
http
://
www
.
karlrunge
.
com
/
x11vnc
/
index
.
html
#
faq
-
sound
675.
http
://
www
.
karlrunge
.
com
/
x11vnc
/
enhanced_tightvnc_viewer
.
html
676.
http
://
www
.
karlrunge
.
com
/
x11vnc
/
x11vnc_opts
.
html
#
opt
-
nobell
677.
http
://
www
.
karlrunge
.
com
/
x11vnc
/
index
.
html
#
faq
-
sound
=======================================================================
http
://
www
.
karlrunge
.
com
/
x11vnc
/
chainingssh
.
html
:
...
...
@@ -9319,7 +9349,7 @@ x11vnc: a VNC server for real X displays
Here
are
all
of
x11vnc
command
line
options
:
%
x11vnc
-
opts
(
see
below
for
-
help
long
descriptions
)
x11vnc
:
allow
VNC
connections
to
real
X11
displays
.
0.8.4
lastmod
:
2007
-
01
-
0
7
x11vnc
:
allow
VNC
connections
to
real
X11
displays
.
0.8.4
lastmod
:
2007
-
01
-
0
8
x11vnc
options
:
-
display
disp
-
auth
file
-
id
windowid
...
...
@@ -9426,7 +9456,7 @@ libvncserver-tight-extension options:
% x11vnc -help
x11vnc: allow VNC connections to real X11 displays. 0.8.4 lastmod: 2007-01-0
7
x11vnc: allow VNC connections to real X11 displays. 0.8.4 lastmod: 2007-01-0
8
(type "x11vnc -opts" to just list the options.)
...
...
@@ -11456,6 +11486,10 @@ Options:
smoother drags than tightvnc viewer. Response may also
be choppy if the server side machine is too slow.
Sometimes on very slow modem connections, this actually
gives an improvement because no pixel data at all
(not even the box animation) is sent during the drag.
-ncache_no_moveraise In -ncache mode, do not assume that moving a window
will cause the window manager to raise it to the top
of the stack. The default is to assume it does, and
...
...
This diff is collapsed.
Click to expand it.
x11vnc/help.c
View file @
c9e24e5b
...
...
@@ -2064,6 +2064,10 @@ void print_help(int mode) {
" smoother drags than tightvnc viewer. Response may also
\n
"
" be choppy if the server side machine is too slow.
\n
"
"
\n
"
" Sometimes on very slow modem connections, this actually
\n
"
" gives an improvement because no pixel data at all
\n
"
" (not even the box animation) is sent during the drag.
\n
"
"
\n
"
"-ncache_no_moveraise In -ncache mode, do not assume that moving a window
\n
"
" will cause the window manager to raise it to the top
\n
"
" of the stack. The default is to assume it does, and
\n
"
...
...
This diff is collapsed.
Click to expand it.
x11vnc/options.c
View file @
c9e24e5b
...
...
@@ -195,8 +195,12 @@ int wireframe_in_progress = 0;
int
wireframe_local
=
1
;
#ifndef NCACHE
#ifdef NO_NCACHE
#define NCACHE 0
#else
#define NCACHE -12
#endif
#endif
#ifdef MACOSX
int
ncache
=
0
;
int
ncache_pad
=
24
;
...
...
@@ -204,6 +208,7 @@ int ncache_pad = 24;
int
ncache
=
NCACHE
;
int
ncache_pad
=
0
;
#endif
int
ncache_xrootpmap
=
1
;
int
ncache0
=
0
;
int
ncache_copyrect
=
0
;
int
ncache_wf_raises
=
1
;
...
...
This diff is collapsed.
Click to expand it.
x11vnc/options.h
View file @
c9e24e5b
...
...
@@ -162,6 +162,7 @@ extern int ncache_copyrect;
extern
int
ncache_wf_raises
;
extern
int
ncache_dt_change
;
extern
int
ncache_pad
;
extern
int
ncache_xrootpmap
;
extern
int
macosx_ncache_macmenu
;
extern
int
ncache_beta_tester
;
...
...
This diff is collapsed.
Click to expand it.
x11vnc/remote.c
View file @
c9e24e5b
...
...
@@ -2733,6 +2733,7 @@ char *process_remote_cmd(char *cmd, int stringonly) {
rfbLog
(
"remote_cmd: enabling mouse nodragging mode.
\n
"
);
show_dragging
=
0
;
#ifndef NO_NCACHE
}
else
if
(
!
strcmp
(
p
,
"ncache_cr"
))
{
if
(
query
)
{
snprintf
(
buf
,
bufn
,
"ans=%s:%d"
,
p
,
ncache_copyrect
);
...
...
@@ -2810,6 +2811,7 @@ char *process_remote_cmd(char *cmd, int stringonly) {
check_ncache
(
1
,
0
);
}
}
#endif
}
else
if
(
strstr
(
p
,
"wireframe_mode"
)
==
p
)
{
COLON_CHECK
(
"wireframe_mode:"
)
...
...
This diff is collapsed.
Click to expand it.
x11vnc/screen.c
View file @
c9e24e5b
...
...
@@ -2059,23 +2059,28 @@ void initialize_screen(int *argc, char **argv, XImage *fb) {
#ifndef NO_NCACHE
if
(
ncache
>
0
&&
!
nofb
)
{
#ifdef MACOSX
#
ifdef MACOSX
if
(
!
raw_fb_str
||
macosx_console
)
{
#else
#
else
if
(
!
raw_fb_str
)
{
#endif
#
endif
char
*
new_fb
;
int
sz
=
fb
->
height
*
fb
->
bytes_per_line
;
int
ns
=
1
+
ncache
;
if
(
ncache_xrootpmap
)
{
ns
++
;
}
new_fb
=
(
char
*
)
calloc
((
size_t
)
(
sz
*
(
1
+
ncache
)
),
1
);
new_fb
=
(
char
*
)
calloc
((
size_t
)
(
sz
*
ns
),
1
);
if
(
fb
->
data
)
{
memcpy
(
new_fb
,
fb
->
data
,
sz
);
free
(
fb
->
data
);
}
fb
->
data
=
new_fb
;
fb
->
height
*=
(
1
+
ncache
);
height
*=
(
1
+
ncache
);
fb
->
height
*=
(
ns
);
height
*=
(
ns
);
ncache0
=
ncache
;
}
}
...
...
This diff is collapsed.
Click to expand it.
x11vnc/solid.c
View file @
c9e24e5b
...
...
@@ -13,7 +13,7 @@ void solid_bg(int restore);
static
void
usr_bin_path
(
int
restore
);
static
int
dt_cmd
(
char
*
cmd
);
static
char
*
cmd_output
(
char
*
cmd
);
static
void
solid_root
(
char
*
color
);
XImage
*
solid_root
(
char
*
color
);
static
void
solid_cde
(
char
*
color
);
static
void
solid_gnome
(
char
*
color
);
static
void
solid_kde
(
char
*
color
);
...
...
@@ -113,11 +113,11 @@ static char *cmd_output(char *cmd) {
return
(
output
);
}
static
void
solid_root
(
char
*
color
)
{
XImage
*
solid_root
(
char
*
color
)
{
#if NO_X11
RAWFB_RET_VOID
if
(
!
color
)
{}
return
;
return
NULL
;
#else
Window
expose
;
static
XImage
*
image
=
NULL
;
...
...
@@ -130,11 +130,11 @@ static void solid_root(char *color) {
XColor
cdef
;
Colormap
cmap
;
RAWFB_RET
_VOID
RAWFB_RET
(
NULL
)
if
(
subwin
||
window
!=
rootwin
)
{
rfbLog
(
"cannot set subwin to solid color, must be rootwin
\n
"
);
return
;
return
NULL
;
}
/* create the "clear" window just for generating exposures */
...
...
@@ -155,7 +155,7 @@ static void solid_root(char *color) {
/* whoops */
XDestroyWindow
(
dpy
,
expose
);
rfbLog
(
"no root snapshot available.
\n
"
);
return
;
return
NULL
;
}
...
...
@@ -180,7 +180,7 @@ static void solid_root(char *color) {
XMapWindow
(
dpy
,
expose
);
XSync
(
dpy
,
False
);
XDestroyWindow
(
dpy
,
expose
);
return
;
return
NULL
;
}
if
(
!
image
)
{
...
...
@@ -205,6 +205,13 @@ static void solid_root(char *color) {
ZPixmap
);
XSync
(
dpy
,
False
);
XDestroyWindow
(
dpy
,
iwin
);
rfbLog
(
"done.
\n
"
);
}
if
(
color
==
(
char
*
)
0x1
)
{
/* caller will XDestroyImage it: */
XImage
*
xi
=
image
;
image
=
NULL
;
return
xi
;
}
/* use black for low colors or failure */
...
...
@@ -225,6 +232,7 @@ static void solid_root(char *color) {
XSync
(
dpy
,
False
);
XDestroyWindow
(
dpy
,
expose
);
#endif
/* NO_X11 */
return
NULL
;
}
static
void
solid_cde
(
char
*
color
)
{
...
...
This diff is collapsed.
Click to expand it.
x11vnc/solid.h
View file @
c9e24e5b
...
...
@@ -5,5 +5,6 @@
extern
char
*
guess_desktop
(
void
);
extern
void
solid_bg
(
int
restore
);
extern
XImage
*
solid_root
(
char
*
color
);
#endif
/* _X11VNC_SOLID_H */
This diff is collapsed.
Click to expand it.
x11vnc/userinput.c
View file @
c9e24e5b
...
...
@@ -2096,11 +2096,11 @@ if (db) get_client_regions(&req0, &mod0, &cpy0, &ncli);
if
(
cl
->
sock
>=
0
&&
!
cl
->
onHold
&&
FB_UPDATE_PENDING
(
cl
)
&&
!
sraRgnEmpty
(
cl
->
requestedRegion
))
{
if
(
!
rfbSendFramebufferUpdate
(
cl
,
cl
->
modifiedRegion
))
{
fprintf
(
stderr
,
"*** rfbSendFramebufferUpdate
FAILED
#1
\n
"
);
fprintf
(
stderr
,
"*** rfbSendFramebufferUpdate
*FAILED*
#1
\n
"
);
if
(
cl
->
ublen
)
fprintf
(
stderr
,
"*** fb_push ublen not zero: %d
\n
"
,
cl
->
ublen
);
break
;
}
if
(
cl
->
ublen
)
fprintf
(
stderr
,
"*** fb_push ublen
not zero
: %d
\n
"
,
cl
->
ublen
);
if
(
cl
->
ublen
)
fprintf
(
stderr
,
"*** fb_push ublen
NOT ZERO
: %d
\n
"
,
cl
->
ublen
);
}
}
rfbReleaseClientIterator
(
i
);
...
...
@@ -4006,6 +4006,8 @@ fprintf(stderr, "FB_COPY: %.4f XX did batch 0x%x %3d su: %dx%d+%d+%d bs: %dx%d+
}
cache_list
[
nidx
].
x
=
x
+
np
;
cache_list
[
nidx
].
y
=
y
+
np
;
/* XXX Y */
cache_list
[
nidx
].
bs_time
=
dnow
();
if
(
some_su
)
{
cache_list
[
nidx
].
su_time
=
dnow
();
...
...
@@ -4059,7 +4061,7 @@ void do_copyrect_drag_move(Window orig_frame, Window frame, int *nidx, int try_b
if
(
!
use_batch
)
{
do_copyregion
(
r1
,
dx
,
dy
,
0
);
if
(
!
fb_push_wait
(
0
.
2
,
FB_COPY
))
{
fprintf
(
stderr
,
"FB_COPY: %.4f 3)
FAILED.
\n
"
,
dnow
()
-
ntim
);
fprintf
(
stderr
,
"FB_COPY: %.4f 3)
*FAILED*
\n
"
,
dnow
()
-
ntim
);
fb_push_wait
(
0
.
1
,
FB_COPY
);
}
}
else
{
...
...
@@ -4849,23 +4851,21 @@ if (db || db2) fprintf(stderr, "NO button_mask\n");
ntim
=
dnow
();
/* try to flush the wireframe removal: */
fprintf
(
stderr
,
"
\n
SEND_COPYRECT %.4f %.4f
\n
"
,
dnowx
(),
dnow
()
-
ntim
);
if
(
ncache
)
fprintf
(
stderr
,
"
\n
SEND_COPYRECT %.4f %.4f
\n
"
,
dnowx
(),
dnow
()
-
ntim
);
if
(
!
fb_push_wait
(
0
.
15
,
FB_COPY
|
FB_MOD
))
{
fprintf
(
stderr
,
"FB_COPY failed
, try one more... %.4f"
,
dnow
()
-
ntim
);
if
(
ncache
)
fprintf
(
stderr
,
"FB_COPY *FAILED*
, try one more... %.4f"
,
dnow
()
-
ntim
);
if
(
!
fb_push_wait
(
0
.
15
,
FB_COPY
|
FB_MOD
))
{
fprintf
(
stderr
,
"FB_COPY failed
again! %.4f"
,
dnow
()
-
ntim
);
if
(
ncache
)
fprintf
(
stderr
,
"FB_COPY *FAILED*
again! %.4f"
,
dnow
()
-
ntim
);
}
}
#ifndef NO_NCACHE
ncache_pre_portions
(
orig_frame
,
frame
,
&
nidx
,
try_batch
,
&
use_batch
,
orig_x
,
orig_y
,
orig_w
,
orig_h
,
x
,
y
,
w
,
h
,
ntim
);
#endif
/* 2) try to send a clipped copyrect of translation: */
...
...
@@ -4879,7 +4879,7 @@ fprintf(stderr, "FB_COPY failed again! %.4f", dnow() - ntim);
use_batch
=
1
;
}
if
(
1
||
db
)
fprintf
(
stderr
,
"sent_copyrect: %d - obs: %d frame: 0x%lx
\n
"
,
sent_copyrect
,
obscured
,
frame
);
if
(
ncache
||
db
)
fprintf
(
stderr
,
"sent_copyrect: %d - obs: %d frame: 0x%lx
\n
"
,
sent_copyrect
,
obscured
,
frame
);
if
(
sent_copyrect
)
{
/* try to push the changes to viewers: */
if
(
use_batch
)
{
...
...
@@ -4890,11 +4890,9 @@ if (1 || db) fprintf(stderr, "sent_copyrect: %d - obs: %d frame: 0x%lx\n", sent
/* no diff for now... */
fb_push_wait
(
0
.
1
,
FB_COPY
);
}
#ifndef NO_NCACHE
ncache_post_portions
(
nidx
,
use_batch
,
orig_x
,
orig_y
,
orig_w
,
orig_h
,
x
,
y
,
w
,
h
,
-
1
.
0
,
ntim
);
clear_win_events
(
NPP_nwin
,
0
);
#endif
if
(
scaling
&&
!
use_batch
)
{
static
double
last_time
=
0
.
0
;
...
...
@@ -5570,6 +5568,7 @@ if (debug_scroll && rc > 1) fprintf(stderr, " CXR: check_user_input ret %d\n",
#if defined(NO_NCACHE) || (NO_X11 && !defined(MACOSX))
int
check_ncache
(
int
a
,
int
b
)
{
if
(
!
a
||
!
b
)
{}
ncache
=
0
;
return
0
;
}
int
lookup_win_index
(
Window
win
)
{
...
...
@@ -5580,6 +5579,26 @@ int find_rect(int idx, int x, int y, int w, int h) {
if
(
!
idx
||
!
x
||
!
y
||
!
w
||
!
h
)
{}
return
0
;
}
void
snap_old
(
void
)
{
return
;
}
int
clipped
(
int
idx
)
{
if
(
!
idx
)
{}
return
0
;
}
int
bs_restore
(
int
idx
,
int
*
nbatch
,
sraRegionPtr
rmask
,
XWindowAttributes
*
attr
,
int
clip
,
int
nopad
,
int
*
valid
,
int
verb
)
{
if
(
!
idx
||
!
nbatch
||
!
rmask
||
!
attr
||
!
clip
||
!
nopad
||
!
valid
||
!
verb
)
{}
return
0
;
}
int
try_to_fix_su
(
Window
win
,
int
idx
,
Window
above
,
int
*
nbatch
,
char
*
mode
)
{
if
(
!
win
||
!
idx
||
!
above
||
!
nbatch
||
!
mode
)
{}
return
0
;
}
int
try_to_fix_resize_su
(
Window
orig_frame
,
int
orig_x
,
int
orig_y
,
int
orig_w
,
int
orig_h
,
int
x
,
int
y
,
int
w
,
int
h
,
int
try_batch
)
{
if
(
!
orig_frame
||
!
orig_x
||
!
orig_y
||
!
orig_w
||
!
orig_h
||
!
x
||
!
y
||
!
w
||
!
h
||
!
try_batch
)
{}
return
0
;
}
#else
/* maybe ncache.c it if works */
...
...
@@ -5800,7 +5819,7 @@ int lookup_win_index(Window win) {
fprintf
(
stderr
,
"recentC(fail): %d 0x%x
\n
"
,
idx
,
(
unsigned
int
)
win
);
s3
++
;
}
if
(
s1
+
s2
+
s3
>=
100
)
{
if
(
s1
+
s2
+
s3
>=
100
0
)
{
fprintf
(
stderr
,
"lookup_win_index recent hit stats: %d/%d/%d
\n
"
,
s1
,
s2
,
s3
);
s1
=
s2
=
s3
=
0
;
}
...
...
@@ -5874,6 +5893,17 @@ void snap_old(void) {
int
i
;
old_stack_n
=
STACKMAX
;
quick_snap
(
old_stack
,
&
old_stack_n
);
fprintf
(
stderr
,
"snap_old: %d %.4f
\n
"
,
old_stack_n
,
dnowx
());
#if 0
for (i= old_stack_n - 1; i >= 0; i--) {
int idx = lookup_win_index(old_stack[i]);
if (idx >= 0) {
if (cache_list[idx].map_state == IsViewable) {
fprintf(stderr, " %03d 0x%x\n", i, old_stack[i]);
}
}
}
#endif
for
(
i
=
0
;
i
<
old_stack_n
;
i
++
)
{
old_stack_mapped
[
i
]
=
-
1
;
}
...
...
@@ -6547,6 +6577,7 @@ int find_rect(int idx, int x, int y, int w, int h) {
double
fac1
=
0
.
1
,
fac2
=
0
.
25
;
double
last_clean
=
0
.
0
;
double
now
=
dnow
();
static
int
nobigs
=
-
1
;
if
(
rect_reg
[
1
]
==
NULL
)
{
for
(
n
=
1
;
n
<=
ncache
;
n
++
)
{
...
...
@@ -6637,6 +6668,17 @@ fprintf(stderr, "free_rect: bad index: %d\n", idx);
if
(
w
*
h
>
fac2
*
(
dpy_x
*
dpy_y
))
{
big2
=
1
;
}
/* XXX Y */
if
(
nobigs
<
0
)
{
if
(
getenv
(
"NOBIGS"
))
{
nobigs
=
1
;
}
else
{
nobigs
=
0
;
}
}
if
(
nobigs
)
{
big1
=
big2
=
0
;
}
if
(
w
>
dpy_x
||
h
>
dpy_y
)
{
fprintf
(
stderr
,
">>**--**>> BIG1 rect: %dx%d+%d+%d -- %d %d
\n
"
,
w
,
h
,
x
,
y
,
x_hit
,
y_hit
);
...
...
@@ -6986,9 +7028,6 @@ fprintf(stderr, "bs_save: not a valid X window: 0x%x\n", (unsigned int) win);
h
=
cache_list
[
idx
].
bs_h
;
if
(
x
<
0
||
!
rc
)
{
// if (!novalidate) {
// STORE(idx, win, attr);
// }
fprintf
(
stderr
,
"BS_save: FAIL FOR: %d
\n
"
,
idx
);
return
0
;
}
...
...
@@ -7029,9 +7068,6 @@ if (verb) fprintf(stderr, "BS_save: %.4f %.2f %d done. %dx%d+%d+%d %dx%d+%d+%d
sraRgnDestroy
(
r0
);
sraRgnDestroy
(
r
);
// if (!novalidate) {
// STORE(idx, win, attr);
// }
last_bs_save
=
cache_list
[
idx
].
bs_time
=
dnow
();
return
1
;
...
...
@@ -7086,9 +7122,6 @@ fprintf(stderr, "su_save: not a valid X window: 0x%x\n", (unsigned int) win);
h
=
cache_list
[
idx
].
su_h
;
if
(
x
<
0
||
!
rc
)
{
// if (!novalidate) {
// STORE(idx, win, attr);
// }
fprintf
(
stderr
,
"SU_save: FAIL FOR: %d
\n
"
,
idx
);
return
0
;
}
...
...
@@ -7129,9 +7162,6 @@ if (verb) fprintf(stderr, "SU_save: %.4f %.2f %d done. %dx%d+%d+%d %dx%d+%d+%d
sraRgnDestroy
(
r0
);
sraRgnDestroy
(
r
);
// if (!novalidate) {
// STORE(idx, win, attr);
// }
last_su_save
=
cache_list
[
idx
].
su_time
=
dnow
();
return
1
;
...
...
@@ -7179,9 +7209,6 @@ fprintf(stderr, "BS_restore: not a valid X window: 0x%x\n", (unsigned int) win);
h
=
cache_list
[
idx
].
bs_h
;
if
(
x
<
0
||
cache_list
[
idx
].
bs_time
==
0
.
0
)
{
// if (!novalidate) {
// STORE(idx, win, attr);
// }
return
0
;
}
...
...
@@ -7238,10 +7265,6 @@ if (verb) fprintf(stderr, "BS_rest: %.4f %.2f %d done. %dx%d+%d+%d %dx%d+%d+%d
sraRgnDestroy
(
r0
);
sraRgnDestroy
(
r
);
// if (!novalidate) {
// STORE(idx, win, attr);
// }
last_bs_restore
=
dnow
();
return
1
;
...
...
@@ -7291,9 +7314,6 @@ fprintf(stderr, "SU_restore: not a valid X window: 0x%x\n", (unsigned int) win);
if
(
x
<
0
||
cache_list
[
idx
].
bs_x
<
0
||
cache_list
[
idx
].
su_time
==
0
.
0
)
{
fprintf
(
stderr
,
"SU_rest: su_x/bs_x/su_time: %d %d %.3f
\n
"
,
x
,
cache_list
[
idx
].
bs_x
,
cache_list
[
idx
].
su_time
);
// if (invalid) {
// DELETE(idx);
// }
return
0
;
}
...
...
@@ -7350,12 +7370,6 @@ if (verb) fprintf(stderr, "SU_rest: %.4f %.2f %d done. %dx%d+%d+%d %dx%d+%d+%d
sraRgnDestroy
(
r0
);
sraRgnDestroy
(
r
);
// if (invalid) {
// DELETE(idx);
// } else if (!novalidate) {
// STORE(idx, win, attr);
// }
last_su_restore
=
dnow
();
return
1
;
...
...
@@ -7583,8 +7597,8 @@ sraRegionPtr tmp_reg[STACKMAX];
for (i=0; i < n; i++) { \
sraRgnDestroy(tmp_reg[i]); \
} \
sraRgnDestroy(r1); \
sraRgnDestroy(r0);
if (r1)
sraRgnDestroy(r1); \
if (r0)
sraRgnDestroy(r0);
int
try_to_fix_resize_su
(
Window
orig_frame
,
int
orig_x
,
int
orig_y
,
int
orig_w
,
int
orig_h
,
int
x
,
int
y
,
int
w
,
int
h
,
int
try_batch
)
{
...
...
@@ -7661,7 +7675,8 @@ fprintf(stderr, "Shrinking resize %d %dx%d+%d+%d -> %dx%d+%d+%d\n", idx, orig_w
cache_list
[
idx
].
su_h
=
h
;
cache_list
[
idx
].
bs_time
=
0
.
0
;
cache_list
[
idx
].
su_time
=
dnow
();
/* XXX Y */
if
(
0
)
cache_list
[
idx
].
su_time
=
dnow
();
}
else
{
fprintf
(
stderr
,
"Growing resize %d %dx%d+%d+%d -> %dx%d+%d+%d
\n
"
,
idx
,
orig_w
,
orig_h
,
orig_x
,
orig_y
,
w
,
h
,
x
,
y
);
...
...
@@ -7706,7 +7721,8 @@ fprintf(stderr, "Growing resize %d %dx%d+%d+%d -> %dx%d+%d+%d\n", idx, orig_w,
}
cache_list
[
idx
].
bs_time
=
0
.
0
;
cache_list
[
idx
].
su_time
=
dnow
();
/* XXX Y */
if
(
0
)
cache_list
[
idx
].
su_time
=
dnow
();
}
}
...
...
@@ -7716,7 +7732,7 @@ fprintf(stderr, "Growing resize %d %dx%d+%d+%d -> %dx%d+%d+%d\n", idx, orig_w,
}
int
try_to_fix_su
(
Window
win
,
int
idx
,
Window
above
,
int
*
nbatch
,
char
*
mode
)
{
int
i
,
idx2
,
n
=
0
,
found
=
0
;
int
i
,
idx2
,
n
=
0
,
found
=
0
,
found_above
=
0
;
sraRegionPtr
r0
,
r1
,
r2
,
r3
;
Window
win2
;
int
x
,
y
,
w
,
h
,
on
=
0
;
...
...
@@ -7732,11 +7748,11 @@ int try_to_fix_su(Window win, int idx, Window above, int *nbatch, char *mode) {
}
else
if
(
mode
&&
!
strcmp
(
mode
,
"moved"
))
{
moved
=
1
;
}
fprintf
(
stderr
,
"TRY_TO_FIX_SU(%d) 0x%x 0x%x unmapped=%d
\n
"
,
idx
,
win
,
above
,
unmapped
);
if
(
idx
<
0
)
{
return
0
;
}
fprintf
(
stderr
,
"TRY_TO_FIX_SU(%d) 0x%x 0x%x was_unmapped=%d map_state=%s
\n
"
,
idx
,
win
,
above
,
unmapped
,
MState
(
cache_list
[
idx
].
map_state
));
if
(
cache_list
[
idx
].
map_state
!=
IsViewable
&&
!
unmapped
)
{
return
0
;
}
...
...
@@ -7772,11 +7788,12 @@ fprintf(stderr, "TRY_TO_FIX_SU(%d) 0x%x 0x%x unmapped=%d\n", idx, win, above,
for
(
i
=
old_stack_n
-
1
;
i
>=
0
;
i
--
)
{
win2
=
old_stack
[
i
];
if
(
win2
==
above
)
{
fprintf
(
stderr
,
"0x%x turn on: 0x%x
\n
"
,
win
,
win2
);
fprintf
(
stderr
,
"0x%x turn on: 0x%x
i=%d
\n
"
,
win
,
win2
,
i
);
on
=
1
;
found_above
=
1
;
}
if
(
win2
==
win
)
{
fprintf
(
stderr
,
"0x%x turn off: 0x%x
\n
"
,
win
,
win2
);
fprintf
(
stderr
,
"0x%x turn off: 0x%x
i=%d
\n
"
,
win
,
win2
,
i
);
found
=
1
;
on
=
0
;
break
;
...
...
@@ -7858,7 +7875,7 @@ fprintf(stderr, "0x%x turn off: 0x%x\n", win, win2);
if
(
unmapped
)
{
CLEAN_OUT
return
1
;
return
found_above
;
}
for
(
i
=
n
-
1
;
i
>=
0
;
i
--
)
{
...
...
@@ -7897,7 +7914,7 @@ fprintf(stderr, "0x%x turn off: 0x%x\n", win, win2);
}
CLEAN_OUT
return
1
;
return
found_above
;
}
void
idx_add_rgn
(
sraRegionPtr
r
,
sraRegionPtr
r0
,
int
idx
)
{
...
...
@@ -7939,28 +7956,86 @@ sraRegionPtr idx_create_rgn(sraRegionPtr r0, int idx) {
return
rtmp
;
}
void
set_ncache_xrootpmap
(
void
)
{
Atom
pmap
,
type
;
int
done
=
0
,
format
;
unsigned
long
length
,
after
;
XImage
*
image
=
NULL
;
RAWFB_RET_VOID
#if !NO_X11
if
(
!
ncache
)
{
return
;
}
X_LOCK
;
pmap
=
XInternAtom
(
dpy
,
"_XROOTPMAP_ID"
,
True
);
if
(
pmap
!=
None
)
{
Pixmap
pixmap
;
char
*
data
;
unsigned
char
*
d_pmap
;
XGetWindowProperty
(
dpy
,
rootwin
,
pmap
,
0L
,
1L
,
False
,
AnyPropertyType
,
&
type
,
&
format
,
&
length
,
&
after
,
&
d_pmap
);
if
(
length
!=
0
)
{
pixmap
=
*
((
Pixmap
*
)
d_pmap
);
if
(
pixmap
!=
None
)
{
image
=
XGetImage
(
dpy
,
pixmap
,
0
,
0
,
dpy_x
,
dpy_y
,
AllPlanes
,
ZPixmap
);
}
}
}
if
(
image
==
NULL
)
{
image
=
solid_root
((
char
*
)
0x1
);
}
if
(
image
!=
NULL
)
{
char
*
src
,
*
dst
;
unsigned
int
line
;
int
pixelsize
=
bpp
/
8
;
int
y1
=
dpy_y
*
(
ncache
+
1
);
src
=
image
->
data
;
dst
=
main_fb
+
y1
*
main_bytes_per_line
;
line
=
0
;
while
(
line
++
<
dpy_y
)
{
memcpy
(
dst
,
src
,
dpy_x
*
pixelsize
);
src
+=
image
->
bytes_per_line
;
dst
+=
main_bytes_per_line
;
}
XDestroyImage
(
image
);
}
else
{
int
yn
=
(
ncache
+
1
)
*
dpy_y
;
zero_fb
(
0
,
yn
,
dpy_x
,
yn
+
dpy_y
);
}
X_UNLOCK
;
#endif
}
#define EVLISTMAX 256
#define EV_RESET 0
#define EV_CREATE 1
#define EV_DESTROY 2
#define EV_UNMAP 3
#define EV_MAP 4
#define EV_REPARENT 5
#define EV_CONFIGURE 6
#define EV_VISIBILITY_UNOBS 7
#define EV_VISIBILITY_OBS 8
#define EV_PROPERTY 9
#define EV_RESET 0
#define EV_CREATE 1
#define EV_DESTROY 2
#define EV_UNMAP 3
#define EV_MAP 4
#define EV_REPARENT 5
#define EV_CONFIGURE 6
#define EV_CONFIGURE_SIZE 7
#define EV_CONFIGURE_POS 8
#define EV_CONFIGURE_STACK 9
#define EV_VISIBILITY_UNOBS 10
#define EV_VISIBILITY_OBS 11
#define EV_PROPERTY 12
Window
_ev_list
[
EVLISTMAX
];
int
_ev_case
[
EVLISTMAX
];
int
_ev_list_cnt
;
int
n_CN
=
0
,
n_RN
=
0
,
n_DN
=
0
,
n_ON
=
0
,
n_MN
=
0
,
n_UN
=
0
;
int
n_VN
=
0
,
n_VN_p
=
0
,
n_VN_u
=
0
,
n_ST
=
0
,
n_PN
=
0
;
int
n_VN
=
0
,
n_VN_p
=
0
,
n_VN_u
=
0
,
n_ST
=
0
,
n_PN
=
0
,
n_DC
=
0
;
int
ev_store
(
Window
win
,
int
type
)
{
if
(
type
==
EV_RESET
)
{
n_CN
=
0
;
n_RN
=
0
;
n_DN
=
0
;
n_ON
=
0
;
n_MN
=
0
;
n_UN
=
0
;
n_VN
=
0
;
n_VN_p
=
0
;
n_VN_u
=
0
;
n_ST
=
0
;
n_PN
=
0
;
n_VN
=
0
;
n_VN_p
=
0
;
n_VN_u
=
0
;
n_ST
=
0
;
n_PN
=
0
;
n_DC
=
0
;
_ev_list_cnt
=
0
;
return
1
;
}
...
...
@@ -7999,50 +8074,59 @@ void read_events(int *n_in) {
Ev_map
[
n
]
=
None
;
Ev_unmap
[
n
]
=
None
;
Ev_order
[
n
]
=
n
;
int
cfg_size
=
0
;
int
cfg_pos
=
0
;
int
cfg_stack
=
0
;
ev
=
Ev
[
n
];
if
(
type
==
DestroyNotify
)
w
=
Ev
[
n
].
xcreatewindow
.
window
;
if
(
type
==
CreateNotify
)
w
=
Ev
[
n
].
xdestroywindow
.
window
;
if
(
type
==
ReparentNotify
)
w
=
Ev
[
n
].
xreparent
.
window
;
if
(
type
==
UnmapNotify
)
w
=
Ev
[
n
].
xunmap
.
window
;
if
(
type
==
MapNotify
)
w
=
Ev
[
n
].
xmap
.
window
;
if
(
type
==
Expose
)
w
=
Ev
[
n
].
xexpose
.
window
;
if
(
type
==
ConfigureNotify
)
w
=
Ev
[
n
].
xconfigure
.
window
;
if
(
type
==
VisibilityNotify
)
w
=
win
;
if
(
n
==
*
n_in
)
fprintf
(
stderr
,
"
\n
"
);
if
(
1
)
{
char
*
msg
=
""
;
int
idx
=
-
1
,
x
=
0
,
y
=
0
,
wd
=
0
,
ht
=
0
;
if
(
w
!=
None
)
{
idx
=
lookup_win_index
(
w
);
if
(
idx
>=
0
)
{
x
=
cache_list
[
idx
].
x
;
y
=
cache_list
[
idx
].
y
;
wd
=
cache_list
[
idx
].
width
;
ht
=
cache_list
[
idx
].
height
;
}
}
if
(
type
==
VisibilityNotify
)
{
msg
=
VState
(
Ev
[
n
].
xvisibility
.
state
);
}
else
if
(
type
==
ConfigureNotify
)
{
int
x_new
=
Ev
[
n
].
xconfigure
.
x
;
int
y_new
=
Ev
[
n
].
xconfigure
.
y
;
int
w_new
=
Ev
[
n
].
xconfigure
.
width
;
int
h_new
=
Ev
[
n
].
xconfigure
.
height
;
if
(
idx
>=
0
)
{
if
(
w_new
!=
wd
||
h_new
!=
ht
)
{
msg
=
"change size"
;
}
else
if
(
x_new
!=
x
||
y_new
!=
y
)
{
msg
=
"change position"
;
}
else
{
msg
=
"change stacking"
;
if
(
type
==
DestroyNotify
)
w
=
Ev
[
n
].
xcreatewindow
.
window
;
if
(
type
==
CreateNotify
)
w
=
Ev
[
n
].
xdestroywindow
.
window
;
if
(
type
==
ReparentNotify
)
w
=
Ev
[
n
].
xreparent
.
window
;
if
(
type
==
UnmapNotify
)
w
=
Ev
[
n
].
xunmap
.
window
;
if
(
type
==
MapNotify
)
w
=
Ev
[
n
].
xmap
.
window
;
if
(
type
==
Expose
)
w
=
Ev
[
n
].
xexpose
.
window
;
if
(
type
==
ConfigureNotify
)
w
=
Ev
[
n
].
xconfigure
.
window
;
if
(
type
==
VisibilityNotify
)
w
=
win
;
if
(
n
==
*
n_in
)
fprintf
(
stderr
,
"
\n
"
);
if
(
1
)
{
char
*
msg
=
""
;
int
idx
=
-
1
,
x
=
0
,
y
=
0
,
wd
=
0
,
ht
=
0
;
if
(
w
!=
None
)
{
idx
=
lookup_win_index
(
w
);
if
(
idx
>=
0
)
{
x
=
cache_list
[
idx
].
x
;
y
=
cache_list
[
idx
].
y
;
wd
=
cache_list
[
idx
].
width
;
ht
=
cache_list
[
idx
].
height
;
}
}
if
(
type
==
VisibilityNotify
)
{
msg
=
VState
(
Ev
[
n
].
xvisibility
.
state
);
}
else
if
(
type
==
ConfigureNotify
)
{
int
x_new
=
Ev
[
n
].
xconfigure
.
x
;
int
y_new
=
Ev
[
n
].
xconfigure
.
y
;
int
w_new
=
Ev
[
n
].
xconfigure
.
width
;
int
h_new
=
Ev
[
n
].
xconfigure
.
height
;
if
(
idx
>=
0
)
{
if
(
w_new
!=
wd
||
h_new
!=
ht
)
{
msg
=
"change size"
;
cfg_size
=
1
;
}
if
(
x_new
!=
x
||
y_new
!=
y
)
{
if
(
!
strcmp
(
msg
,
""
))
{
msg
=
"change position"
;
}
cfg_pos
=
1
;
}
else
if
(
!
cfg_size
)
{
msg
=
"change stacking"
;
cfg_stack
=
1
;
}
}
}
fprintf
(
stderr
,
"----- %02d inputev 0x%08x w: 0x%08x %04dx%04d+%04d+%04d %s %s
\n
"
,
n
,
win
,
w
,
wd
,
ht
,
x
,
y
,
Etype
(
type
),
msg
);
}
}
fprintf
(
stderr
,
"----- %d inputev 0x%08x w: 0x%08x %04dx%04d+%04d+%04d %s %s
\n
"
,
n
,
win
,
w
,
wd
,
ht
,
x
,
y
,
Etype
(
type
),
msg
);
}
if
(
win
==
rootwin
)
{
if
(
type
==
CreateNotify
)
{
...
...
@@ -8092,6 +8176,15 @@ if (type != ConfigureNotify) fprintf(stderr, "root: skip %s for 0x%x\n", Etype(
n_DN
++
;
}
else
if
(
type
==
ConfigureNotify
)
{
ev_store
(
win
,
EV_CONFIGURE
);
if
(
cfg_size
)
{
ev_store
(
win
,
EV_CONFIGURE_SIZE
);
}
if
(
cfg_pos
)
{
ev_store
(
win
,
EV_CONFIGURE_POS
);
}
if
(
cfg_stack
)
{
ev_store
(
win
,
EV_CONFIGURE_STACK
);
}
n
++
;
n_ON
++
;
}
else
if
(
type
==
VisibilityNotify
)
{
...
...
@@ -8126,6 +8219,159 @@ fprintf(stderr, "----- skip %s\n", Etype(type));
*
n_in
=
n
;
}
int
try_to_synthesize_su
(
int
force
,
int
*
nbatch
)
{
int
i
,
j
,
idx
,
idx2
,
n
=
0
;
sraRegionPtr
r0
,
r1
,
r2
,
r3
;
Window
win
,
win2
;
int
x
,
y
,
w
,
h
,
on
=
0
;
int
x0
,
y0
,
w0
,
h0
;
int
x1
,
y1
,
w1
,
h1
;
int
x2
,
y2
,
w2
,
h2
;
int
x3
,
y3
,
w3
,
h3
;
XWindowAttributes
attr
;
r0
=
sraRgnCreateRect
(
0
,
0
,
dpy_x
,
dpy_y
);
snap_old
();
X_LOCK
;
for
(
i
=
old_stack_n
-
1
;
i
>=
0
;
i
--
)
{
win
=
old_stack
[
i
];
if
(
!
valid_window
(
win
,
&
attr
,
1
))
{
continue
;
}
idx
=
lookup_win_index
(
win
);
if
(
idx
>=
0
)
{
STORE
(
idx
,
win
,
attr
);
}
if
(
attr
.
map_state
!=
IsViewable
)
{
continue
;
}
//fprintf(stderr, "win: 0x%x %d idx=%d\n", win, i, idx);
x2
=
attr
.
x
;
y2
=
attr
.
y
;
w2
=
attr
.
width
;
h2
=
attr
.
height
;
r2
=
sraRgnCreateRect
(
x2
,
y2
,
x2
+
w2
,
y2
+
h2
);
sraRgnAnd
(
r2
,
r0
);
tmp_reg
[
n
]
=
r2
;
tmp_stack
[
n
++
]
=
idx
;
}
X_UNLOCK
;
if
(
!
n
)
{
r1
=
NULL
;
CLEAN_OUT
return
0
;
}
for
(
i
=
0
;
i
<
n
;
i
++
)
{
int
i2
,
ok
=
1
,
cnt
=
0
;
idx
=
tmp_stack
[
i
];
if
(
idx
<
0
||
cache_list
[
idx
].
bs_x
<
0
)
{
continue
;
}
r1
=
tmp_reg
[
i
];
if
(
r1
==
NULL
||
sraRgnEmpty
(
r1
))
{
continue
;
}
if
(
cache_list
[
idx
].
su_time
>
0
.
0
)
{
if
(
force
)
{
fprintf
(
stderr
,
"forcing synth: 0x%x %d
\n
"
,
cache_list
[
idx
].
win
,
idx
);
}
else
{
continue
;
}
}
if
(
ncache_xrootpmap
)
{
int
dx
,
dy
;
int
dx2
,
dy2
;
x0
=
cache_list
[
idx
].
x
;
y0
=
cache_list
[
idx
].
y
;
w0
=
cache_list
[
idx
].
width
;
h0
=
cache_list
[
idx
].
height
;
x1
=
cache_list
[
idx
].
su_x
;
y1
=
cache_list
[
idx
].
su_y
;
w1
=
cache_list
[
idx
].
su_w
;
h1
=
cache_list
[
idx
].
su_h
;
r2
=
sraRgnCreateRgn
(
tmp_reg
[
i
]);
dx
=
x1
-
x0
;
dy
=
y1
-
y0
;
sraRgnOffset
(
r2
,
dx
,
dy
);
x2
=
x0
;
y2
=
y0
+
(
ncache
+
1
)
*
dpy_y
;
dx
=
x1
-
x2
;
dy
=
y1
-
y2
;
cache_cr
(
r2
,
dx
,
dy
,
save_delay0
,
save_delay1
,
nbatch
);
cnt
++
;
sraRgnDestroy
(
r2
);
}
for
(
i2
=
n
-
1
;
i2
>
i
;
i2
--
)
{
r2
=
sraRgnCreateRgn
(
tmp_reg
[
i2
]);
if
(
sraRgnAnd
(
r2
,
r1
))
{
int
dx
,
dy
;
int
dx2
,
dy2
;
idx2
=
tmp_stack
[
i2
];
/* XXX Y */
if
(
idx2
<
0
||
cache_list
[
idx2
].
bs_x
<
0
||
cache_list
[
idx2
].
bs_time
==
0
.
0
)
{
continue
;
}
x0
=
cache_list
[
idx
].
x
;
y0
=
cache_list
[
idx
].
y
;
w0
=
cache_list
[
idx
].
width
;
h0
=
cache_list
[
idx
].
height
;
x1
=
cache_list
[
idx
].
su_x
;
y1
=
cache_list
[
idx
].
su_y
;
w1
=
cache_list
[
idx
].
su_w
;
h1
=
cache_list
[
idx
].
su_h
;
x2
=
cache_list
[
idx2
].
x
;
y2
=
cache_list
[
idx2
].
y
;
w2
=
cache_list
[
idx2
].
width
;
h2
=
cache_list
[
idx2
].
height
;
x3
=
cache_list
[
idx2
].
bs_x
;
y3
=
cache_list
[
idx2
].
bs_y
;
w3
=
cache_list
[
idx2
].
bs_w
;
h3
=
cache_list
[
idx2
].
bs_h
;
dx
=
x1
-
x0
;
dy
=
y1
-
y0
;
sraRgnOffset
(
r2
,
dx
,
dy
);
dx2
=
x3
-
x2
;
dy2
=
y3
-
y2
;
dx
=
dx
-
dx2
;
dy
=
dy
-
dy2
;
cache_cr
(
r2
,
dx
,
dy
,
save_delay0
,
save_delay1
,
nbatch
);
cnt
++
;
}
sraRgnDestroy
(
r2
);
}
if
(
cnt
)
{
cache_list
[
idx
].
su_time
=
dnow
();
}
fprintf
(
stderr
,
" try_to_synth_su: 0x%x %d idx=%d cnt=%d
\n
"
,
win
,
i
,
idx
,
cnt
);
}
r1
=
NULL
;
CLEAN_OUT
return
1
;
}
static
int
saw_desktop_change
=
0
;
void
check_sched
(
int
try_batch
,
int
*
did_sched
)
{
...
...
@@ -8155,8 +8401,6 @@ fprintf(stderr, "\n**** checking cache_list[%d]\n\n", cache_list_num);
xselectinput
(
win
,
win_ev
,
0
);
CLEAR
(
k
);
cache_list
[
k
].
selectinput
=
1
;
}
else
{
;
}
valid
=
1
;
}
else
{
...
...
@@ -8213,6 +8457,10 @@ fprintf(stderr, "Created window never mapped: freeing(%d) 0x%x\n", k, (unsigned
if
(
now
<
sched_tm
[
i
]
+
0
.
55
)
{
continue
;
}
if
(
n_MN
||
n_UN
||
n_ST
||
n_DC
)
{
sched_tm
[
i
]
=
now
;
continue
;
}
idx
=
lookup_win_index
(
win
);
if
(
idx
>=
0
)
{
int
aw
=
cache_list
[
idx
].
width
;
...
...
@@ -8241,14 +8489,17 @@ fprintf(stderr, "*SCHED LOOKUP FAIL: i=%d 0x%x\n", i, win);
}
*
did_sched
=
1
;
if
(
now
>
last_sched_vis
+
3
.
0
&&
now
>
last_wireframe
+
2
.
0
)
{
if
(
n_MN
||
n_UN
||
n_ST
||
n_DC
)
{
if
(
last_sched_vis
<
now
)
{
last_sched_vis
+=
1
.
0
;
}
}
else
if
(
now
>
last_sched_vis
+
3
.
0
&&
now
>
last_wireframe
+
2
.
0
)
{
static
double
last_vis
=
0
.
0
;
int
vis_now
[
32
],
top_now
[
32
];
static
int
vis_prev
[
32
];
int
diff
,
nv
=
32
,
vis_now_n
=
0
;
Window
win
;
if
(
1
)
fprintf
(
stderr
,
"VIS snapshot all %.4f
\n
"
,
dnowx
());
for
(
i
=
0
;
i
<
cache_list_num
;
i
++
)
{
int
ok
=
0
;
int
top_only
=
1
;
...
...
@@ -8275,6 +8526,9 @@ if (1) fprintf(stderr, "VIS snapshot all %.4f\n", dnowx());
if
(
cache_list
[
i
].
map_state
!=
IsViewable
)
{
continue
;
}
if
(
cache_list
[
i
].
vis_state
==
VisibilityFullyObscured
)
{
continue
;
}
if
(
map_prev
!=
IsViewable
)
{
/* we hope to catch it below in the normal event processing */
continue
;
...
...
@@ -8304,7 +8558,13 @@ if (1) fprintf(stderr, "VIS snapshot all %.4f\n", dnowx());
diff
=
1
;
}
}
if
(
diff
||
now
>
last_vis
+
45
.
0
)
{
if
(
diff
==
0
)
{
if
(
now
>
last_vis
+
45
.
0
)
{
diff
=
1
;
}
}
if
(
diff
)
{
if
(
vis_now_n
)
fprintf
(
stderr
,
"*VIS snapshot all %.4f
\n
"
,
dnowx
());
for
(
k
=
0
;
k
<
vis_now_n
;
k
++
)
{
i
=
vis_now
[
k
];
win
=
cache_list
[
i
].
win
;
...
...
@@ -8324,7 +8584,11 @@ fprintf(stderr, "*VIS BS_save: 0x%x %d %d %d\n", win, cache_list[i].width, cach
last_vis
=
dnow
();
}
last_sched_vis
=
dnow
();
saw_desktop_change
=
0
;
if
(
!
n_DC
)
{
saw_desktop_change
=
0
;
}
/* XXX Y */
try_to_synthesize_su
(
0
,
bat
);
}
if
(
nr
)
{
...
...
@@ -8347,6 +8611,7 @@ int check_ncache(int reset, int mode) {
int
use_batch
=
0
;
int
nreg
=
0
,
*
nbatch
;
int
create_cnt
;
int
su_fix_cnt
;
int
pixels
=
0
,
ttot
;
int
desktop_change
=
0
,
n1
,
n2
;
int
missed_su_restore
=
0
;
...
...
@@ -8380,6 +8645,10 @@ int check_ncache(int reset, int mode) {
now
=
dnow
();
#ifdef NO_NCACHE
ncache
=
0
;
#endif
if
(
ncache0
)
{
if
(
reset
)
{
;
...
...
@@ -8437,6 +8706,10 @@ if (c) fprintf(stderr, "check_ncache purged %d events\n", c);
zero_fb
(
0
,
dpy_y
,
dpy_x
,
(
ncache
+
1
)
*
dpy_y
);
mark_rect_as_modified
(
0
,
dpy_y
,
dpy_x
,
(
ncache
+
1
)
*
dpy_y
,
0
);
if
(
ncache_xrootpmap
)
{
set_ncache_xrootpmap
();
}
snap_old
();
return
-
1
;
}
...
...
@@ -8480,10 +8753,13 @@ if (c) fprintf(stderr, "check_ncache purged %d events\n", c);
"To disable run the server with: x11vnc -ncache 0 ..."
,
white_pixel
());
rfbDrawString
(
screen
,
&
default8x16Font
,
dx
,
ds
+
Dy
+
4
*
dy
,
"If there are painting errors you can press 3 Alt_L's (Left
\"
Alt
\"
key) in a row to repaint the screen."
,
white_pixel
());
rfbDrawString
(
screen
,
&
default8x16Font
,
dx
,
ds
+
Dy
+
5
*
dy
,
"More info: http://www.karlrunge.com/x11vnc/#faq-client-caching"
,
white_pixel
());
ds
+=
8
*
dy
;
ds
+=
9
*
dy
;
}
snapshot_cache_list
(
0
,
100
.
0
);
...
...
@@ -8525,7 +8801,6 @@ if (hack_val == 2) {
ev_store
(
None
,
EV_RESET
);
X_LOCK
;
for
(
k
=
1
;
k
<=
3
;
k
++
)
{
...
...
@@ -8599,6 +8874,7 @@ fprintf(stderr, "PRELOOP: RepartNotify: 0x%x %d idx=%d\n", win2, n1, idx);
if
(
dnow
()
<
got_NET_CURRENT_DESKTOP
+
0
.
25
)
{
fprintf
(
stderr
,
"***got_NET_CURRENT_DESKTOP n=%d
\n
"
,
n
);
desktop_change
=
1
;
n_DC
++
;
}
else
{
fprintf
(
stderr
,
"***got_NET_CURRENT_DESKTOP n=%d STALE
\n
"
,
n
);
}
...
...
@@ -8650,10 +8926,12 @@ fprintf(stderr, "SKIPWINS: Ev_unmap/map: 0x%x %d\n", twin, n2);
if
(
skipwins_n
)
{
if
(
n_MN
+
n_UN
>=
2
+
2
*
skipwins_n
)
{
desktop_change
=
1
;
n_DC
++
;
}
}
else
{
if
(
n_MN
+
n_UN
>=
4
)
{
desktop_change
=
1
;
n_DC
++
;
}
}
}
...
...
@@ -8764,6 +9042,7 @@ fprintf(stderr, "SKIPWINS: Ev_unmap/map: 0x%x %d\n", twin, n2);
missed_bs_restore_rgn
=
sraRgnCreate
();
r0
=
sraRgnCreateRect
(
0
,
0
,
dpy_x
,
dpy_y
);
unmapped_rgn
=
sraRgnCreate
();
su_fix_cnt
=
0
;
for
(
k
=
0
;
k
<
skipwins_n
;
k
++
)
{
fprintf
(
stderr
,
"skipwins[%d] 0x%x
\n
"
,
k
,
skipwins
[
k
]);
...
...
@@ -8895,8 +9174,23 @@ fprintf(stderr, " INVALIDATE bs: 0x%x wh: %dx%d %dx%d \n", (unsigned
}
}
if
(
ok
)
{
try_to_fix_su
(
win
,
idx
,
ev
.
xconfigure
.
above
,
nbatch
,
NULL
);
if
(
n_MN
==
0
&&
n_UN
==
0
)
{
if
(
su_fix_cnt
>
0
)
{
ok
=
0
;
fprintf
(
stderr
,
" CONF_IGNORE: Too many stacking changes: 0x%x
\n
"
,
(
unsigned
int
)
win
);
}
}
}
if
(
ok
)
{
int
rc
=
try_to_fix_su
(
win
,
idx
,
ev
.
xconfigure
.
above
,
nbatch
,
NULL
);
if
(
rc
==
0
&&
su_fix_cnt
==
0
&&
n_MN
==
0
&&
n_UN
==
0
)
{
X_UNLOCK
;
try_to_synthesize_su
(
1
,
nbatch
);
X_LOCK
;
}
n_ST
++
;
su_fix_cnt
++
;
}
}
...
...
@@ -8934,7 +9228,6 @@ fprintf(stderr, "----%02d: VisibilityNotify 0x%x %3d state: %s U/P %d/%d\n", i
if
(
ok
)
{
int
x2
,
y2
,
w2
,
h2
;
sraRegionPtr
rmask
=
NULL
;
X_UNLOCK
;
valid
=
0
;
if
(
dnow
()
<
cache_list
[
idx
].
vis_unobs_time
+
3
.
00
&&
!
sraRgnEmpty
(
unmapped_rgn
))
{
x2
=
cache_list
[
idx
].
x
;
...
...
@@ -8948,11 +9241,16 @@ fprintf(stderr, "----%02d: VisibilityNotify 0x%x %3d state: %s U/P %d/%d\n", i
rmask
=
NULL
;
}
}
bs_restore
(
idx
,
nbatch
,
rmask
,
&
attr
,
0
,
1
,
&
valid
,
1
);
if
(
ev_lookup
(
win
,
EV_CONFIGURE_SIZE
))
{
valid
=
valid_window
(
win
,
&
attr
,
1
);
}
else
{
X_UNLOCK
;
bs_restore
(
idx
,
nbatch
,
rmask
,
&
attr
,
0
,
1
,
&
valid
,
1
);
X_LOCK
;
}
if
(
rmask
!=
NULL
)
{
sraRgnDestroy
(
rmask
);
}
X_LOCK
;
if
(
valid
)
{
STORE
(
idx
,
win
,
attr
);
...
...
@@ -9023,7 +9321,13 @@ fprintf(stderr, "----%02d: MapNotify 0x%x %3d\n", ik, (unsigned int) win
}
}
valid
=
0
;
if
(
bs_restore
(
idx
,
nbatch
,
NULL
,
&
attr
,
0
,
0
,
&
valid
,
1
))
{
/* XXX clip? */
if
(
ev_lookup
(
win
,
EV_CONFIGURE_SIZE
))
{
X_LOCK
;
valid
=
valid_window
(
win
,
&
attr
,
1
);
X_UNLOCK
;
idx_add_rgn
(
missed_bs_restore_rgn
,
r0
,
idx
);
missed_bs_restore
++
;
}
else
if
(
bs_restore
(
idx
,
nbatch
,
NULL
,
&
attr
,
0
,
0
,
&
valid
,
1
))
{
/* XXX clip? */
;
}
else
{
idx_add_rgn
(
missed_bs_restore_rgn
,
r0
,
idx
);
...
...
@@ -9179,7 +9483,7 @@ fprintf(stderr, "igno%02d: ** Ignoring 0x%x type: %s\n", ik, (unsigned int)
check_sched
(
try_batch
,
&
did_sched
);
if
(
n_CN
||
n_RN
||
n_DN
||
n_MN
||
n_UN
||
n_ST
||
did_sched
)
{
if
(
n_CN
||
n_RN
||
n_DN
||
n_MN
||
n_UN
||
n_ST
||
n_DC
||
did_sched
)
{
snap_old
();
}
...
...
@@ -9188,6 +9492,7 @@ fprintf(stderr, "igno%02d: ** Ignoring 0x%x type: %s\n", ik, (unsigned int)
sraRgnDestroy
(
missed_bs_restore_rgn
);
rfbLog
(
"OUT check_ncache(): %.4f %.6f events: %d pixels: %d
\n
"
,
dnowx
(),
dnow
()
-
now
,
n
,
pixels
);
fprintf
(
stderr
,
"
\n
"
);
return
pixels
;
}
#endif
...
...
This diff is collapsed.
Click to expand it.
x11vnc/x11vnc.1
View file @
c9e24e5b
...
...
@@ -2,7 +2,7 @@
.TH X11VNC "1" "January 2007" "x11vnc " "User Commands"
.SH NAME
x11vnc - allow VNC connections to real X11 displays
version: 0.8.4, lastmod: 2007-01-0
7
version: 0.8.4, lastmod: 2007-01-0
8
.SH SYNOPSIS
.B x11vnc
[OPTION]...
...
...
@@ -2428,6 +2428,10 @@ Some VNC Viewers provide better response than others
with this option. On Unix, realvnc viewer gives
smoother drags than tightvnc viewer. Response may also
be choppy if the server side machine is too slow.
.IP
Sometimes on very slow modem connections, this actually
gives an improvement because no pixel data at all
(not even the box animation) is sent during the drag.
.PP
\fB-ncache_no_moveraise\fR
.IP
...
...
This diff is collapsed.
Click to expand it.
x11vnc/x11vnc.c
View file @
c9e24e5b
...
...
@@ -1463,6 +1463,8 @@ char msg[] =
"
\n
"
" x11vnc -ncache 0 ...
\n
"
"
\n
"
"Your current setting is: -ncache %d
\n
"
"
\n
"
"The feature needs additional testing because we want to have x11vnc
\n
"
"performance enhancements on by default. Otherwise, only a relative few
\n
"
"would notice and use the -ncache option (e.g. the wireframe and scroll
\n
"
...
...
@@ -1483,8 +1485,11 @@ char msg[] =
if
(
nofb
)
{
return
;
}
#ifdef NO_NCACHE
return
;
#endif
fprintf
(
stderr
,
"%s"
,
msg
);
fprintf
(
stderr
,
msg
,
ncache
);
}
...
...
This diff is collapsed.
Click to expand it.
x11vnc/x11vnc_defs.c
View file @
c9e24e5b
...
...
@@ -15,7 +15,7 @@ int xtrap_base_event_type = 0;
int
xdamage_base_event_type
=
0
;
/* date +'lastmod: %Y-%m-%d' */
char
lastmod
[]
=
"0.8.4 lastmod: 2007-01-0
7
"
;
char
lastmod
[]
=
"0.8.4 lastmod: 2007-01-0
8
"
;
/* X display info */
...
...
This diff is collapsed.
Click to expand it.
x11vnc/xdamage.c
View file @
c9e24e5b
...
...
@@ -546,6 +546,7 @@ int xdamage_hint_skip(int y) {
int
ret
,
i
,
n
,
nreg
;
static
int
ncache_no_skip
=
0
;
static
double
last_ncache_no_skip
=
0
.
0
;
static
double
last_ncache_no_skip_long
=
0
.
0
,
ncache_fac
=
0
.
25
;
if
(
!
xdamage_present
||
!
use_xdamage
)
{
return
0
;
/* cannot skip */
...
...
@@ -561,6 +562,7 @@ int xdamage_hint_skip(int y) {
nreg
=
(
xdamage_memory
*
NSCAN
)
+
1
;
#ifndef NO_NCACHE
if
(
ncache
>
0
)
{
if
(
ncache_no_skip
==
0
)
{
double
now
=
dnow
();
...
...
@@ -575,16 +577,23 @@ int xdamage_hint_skip(int y) {
}
if
(
ncache_no_skip
)
{
last_ncache_no_skip
=
dnow
();
if
(
now
>
last_ncache_no_skip_long
+
60
.
0
)
{
ncache_fac
=
2
.
0
;
last_ncache_no_skip_long
=
now
;
}
else
{
ncache_fac
=
0
.
25
;
}
return
0
;
}
}
else
{
if
(
ncache_no_skip
++
>=
1
*
nreg
+
4
)
{
if
(
ncache_no_skip
++
>=
ncache_fac
*
nreg
+
4
)
{
ncache_no_skip
=
0
;
}
else
{
return
0
;
}
}
}
#endif
tmpl
=
sraRgnCreateRect
(
0
,
y
,
dpy_x
,
y
+
1
);
...
...
This diff is collapsed.
Click to expand it.
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