Commit 5e726096 authored by runge's avatar runge

x11vnc: do CLIPBOARD, reverse conn require passwds, -usepw, -debug_sel, -storepasswd homedir.

parent c997e901
2006-03-08 Karl Runge <runge@karlrunge.com>
* x11vnc: manage CLIPBOARD in addition to PRIMARY. -debug_sel
Make reverse connections require passwords. -usepw option.
-storepasswd w/o args prompts and writes ~/.vnc/passwd.
2006-03-06 Karl Runge <runge@karlrunge.com> 2006-03-06 Karl Runge <runge@karlrunge.com>
* x11vnc: switch remote control to X11VNC_REMOTE property. Put * x11vnc: switch remote control to X11VNC_REMOTE property. Put
in -unixpw constraints for reverse connections under -inetd. in -unixpw constraints for reverse connections under -inetd.
......
x11vnc README file Date: Mon Mar 6 10:24:41 EST 2006 x11vnc README file Date: Wed Mar 8 10:57:30 EST 2006
The following information is taken from these URLs: The following information is taken from these URLs:
...@@ -1746,24 +1746,53 @@ display :0 ...@@ -1746,24 +1746,53 @@ display :0
Q-12: Are there any build-time customizations possible, e.g. change Q-12: Are there any build-time customizations possible, e.g. change
defaults, create a smaller binary, etc? defaults, create a smaller binary, etc?
As of Mar/2004 in the libvncserver cvs there are a few such options. There are some options. They are enabled by adding something like
They are enabled by adding something like -Dxxxx=1 to the CPPFLAGS -Dxxxx=1 to the CPPFLAGS environment variable before running configure
environment variable before running configure (see the [213]build (see the [213]build notes for general background).
notes for general background). /*
* -DVNCSHARED=1 make -shared the default. * Mar/2006
* -DFOREVER=1 make -forever the default. * Build-time customization via CPPFLAGS.
* -DREMOTE_CONTROL=0 disable the remote control mechanism. *
* -DPASSWD_REQUIRED=1 require a password be supplied (-rfbauth, * Summary of options to include in CPPFLAGS for custom builds:
-passwdfile, ...) *
* -DPASSWD_UNLESS_NOPW=1 require a password unless -nopw is * -DVNCSHARED to have the vnc display shared by default.
explicitly supplied. * -DFOREVER to have -forever on by default.
* -DSMALL_FOOTPRINT=1 strip out help text, gui, etc to make a * -DNOREPEAT=0 to have -repeat on by default.
smaller binary (e.g. for PDA or embedded system with low disk * -DADDKEYSYMS=0 to have -noadd_keysyms the default.
space). Also be sure to strip(1) the binary. Set to 2 or 3 to cut *
out even more. * -DREMOTE_DEFAULT=0 to disable remote-control on by default (-yesremote).
* -DREMOTE_CONTROL=0 to disable remote-control mechanism completely.
For example: * -DEXTERNAL_COMMANDS=0 to disable the running of all external commands.
env CPPFLAGS="-DFOREVER=1" ./configure; make * -DFILEXFER=0 disable filexfer.
*
* -DHARDWIRE_PASSWD=... hardwired passwords, quoting necessary.
* -DHARDWIRE_VIEWPASSWD=...
* -DNOPW=1 make -nopw the default (skip warning)
* -DPASSWD_REQUIRED=1 exit unless a password is supplied.
* -DPASSWD_UNLESS_NOPW=1 exit unless a password is supplied and no -nopw.
*
* -DWIREFRAME=0 to have -nowireframe as the default.
* -DWIREFRAME_COPYRECT=0 to have -nowirecopyrect as the default.
* -DWIREFRAME_PARMS=... set default -wirecopyrect parameters.
* -DSCROLL_COPYRECT=0 to have -noscrollcopyrect as the default.
* -DSCROLL_COPYRECT_PARMS=... set default -scrollcopyrect parameters.
* -DSCALING_COPYRECT=0
* -DXDAMAGE=0 to have -noxdamage as the default.
* -DSKIPDUPS=0 to have -noskip_dups as the default or vice versa.
*
* -DPOINTER_MODE_DEFAULT={0,1,2,3,4} set default -pointer_mode.
* -DBOLDLY_CLOSE_DISPLAY=0 to not close X DISPLAY under -rawfb.
* -DSMALL_FOOTPRINT=1 for smaller binary size (no help, no gui, etc)
* use 2 or 3 for even smaller footprint.
* -DNOGUI do not include the gui tkx11vnc.
* -DPOLL_8TO24_DELAY=N
* -DDEBUG_XEVENTS=1 enable printout for X events.
*
* Set these in CPPFLAGS before running configure. E.g.:
*
* % env CPPFLAGS="-DFOREVER -DREMOTE_CONTROL=0" ./configure
* % make
*/
If other things (e.g. "-I ...") are needed in CPPFLAGS add them as If other things (e.g. "-I ...") are needed in CPPFLAGS add them as
well. well.
...@@ -1779,15 +1808,7 @@ display :0 ...@@ -1779,15 +1808,7 @@ display :0
unintendeds. Perhaps this is of use in remote access for an embedded unintendeds. Perhaps this is of use in remote access for an embedded
application, etc... application, etc...
Let us know if more build-time customizations would be useful. Look Let us know if more build-time customizations would be useful.
near the top of the source file for any additional customization
macros. Here is the current (Jul/2005) list: REMOTE_CONTROL, NOPW,
SMALL_FOOTPRINT, NOGUI, XDAMAGE, VNCSHARED, FOREVER, REMOTE_DEFAULT,
EXTERNAL_COMMANDS, VIEWONLY, WIREFRAME, WIREFRAME_PARMS,
WIREFRAME_COPYRECT, SCROLL_COPYRECT_PARMS, SCROLL_COPYRECT,
SCALING_COPYRECT, NOREPEAT, SKIPDUPS, ADDKEYSYMS,
POINTER_MODE_DEFAULT, DEBUG_XEVENTS, BOLDLY_CLOSE_DISPLAY, NOPW,
PASSWD_REQUIRED, PASSWD_UNLESS_NOPW
[Win2VNC Related] [Win2VNC Related]
...@@ -2204,9 +2225,9 @@ TrueColor defdepth 24 ...@@ -2204,9 +2225,9 @@ TrueColor defdepth 24
scale:3/4", "x11vnc -Q modtweak", "x11vnc -R stop", "x11vnc -R scale:3/4", "x11vnc -Q modtweak", "x11vnc -R stop", "x11vnc -R
disconnect:all", etc.. These commands do not start a x11vnc server, disconnect:all", etc.. These commands do not start a x11vnc server,
but rather communicate with one that is already running. The X display but rather communicate with one that is already running. The X display
(VNC_CONNECT property) is used as the communication channel, so the X (X11VNC_REMOTE property) is used as the communication channel, so the
permissions and DISPLAY must be set up correctly for communication to X permissions and DISPLAY must be set up correctly for communication
be possible. to be possible.
There is also a simple Tcl/Tk gui based on this remote control There is also a simple Tcl/Tk gui based on this remote control
mechanism. See the [257]-gui option for more info. You will need to mechanism. See the [257]-gui option for more info. You will need to
...@@ -2744,9 +2765,11 @@ exit 1 ...@@ -2744,9 +2765,11 @@ exit 1
There is also the [308]-unixpw_nis option for non-shadow-password There is also the [308]-unixpw_nis option for non-shadow-password
(typically NIS environments, hence the name) systems where the (typically NIS environments, hence the name) systems where the
traditional getpwnam() and crypt() functions are used. The encrypted traditional getpwnam() and crypt() functions are used instead of
user passwords must be accessible to the user running x11vnc in su(1). The encrypted user passwords must be accessible to the user
-unixpw_nis mode. See ypcat(1) and shadow(5). running x11vnc in -unixpw_nis mode, otherwise the logins will always
fail even when the correct password is supplied. See ypcat(1) and
shadow(5).
Two settings are enforced in the -unixpw and -unixpw_nis modes to Two settings are enforced in the -unixpw and -unixpw_nis modes to
provide extra security: the 1) [309]-localhost and 2) [310]-stunnel provide extra security: the 1) [309]-localhost and 2) [310]-stunnel
...@@ -2761,8 +2784,9 @@ exit 1 ...@@ -2761,8 +2784,9 @@ exit 1
Tru64, FreeBSD, OpenBSD, and NetBSD. Additional testing is Tru64, FreeBSD, OpenBSD, and NetBSD. Additional testing is
appreciated. For the last 4 it appears that su(1) will not prompt for appreciated. For the last 4 it appears that su(1) will not prompt for
a password if su-ing to oneself. Since x11vnc requires a password a password if su-ing to oneself. Since x11vnc requires a password
prompt from su, those logins will fail. On *BSD it appears this can be prompt from su, those logins will fail even when the correct password
corrected by commenting out the pam_self.so entry in /etc/pam.d/su. is supplied. On *BSD it appears this can be corrected by commenting
out the pam_self.so entry in /etc/pam.d/su.
Previous discussion: One approximate method involves starting x11vnc Previous discussion: One approximate method involves starting x11vnc
...@@ -3234,12 +3258,25 @@ service x11vncservice ...@@ -3234,12 +3258,25 @@ service x11vncservice
starts up x11vnc with the [335]-connect option. To connect immediately starts up x11vnc with the [335]-connect option. To connect immediately
at x11vnc startup time use the "-connect host:port" option (use commas at x11vnc startup time use the "-connect host:port" option (use commas
for a list of hosts to connect to). The ":port" is optional (default for a list of hosts to connect to). The ":port" is optional (default
is 5500). If a file is specified instead: -connect /path/to/some/file is 5500).
then that file is checked periodically (about once a second) for new
hosts to connect to. If a file is specified instead: -connect /path/to/some/file then that
file is checked periodically (about once a second) for new hosts to
connect to.
The [336]-remote control option (aka -R) can also be used to do this
during an active x11vnc session, e.g.:
x11vnc -display :0 -R connect:hostname.domain
Note that as of Mar/2006 x11vnc requires password authentication for
reverse connections as well as for forward ones (assuming password
auth has been enabled, e.g. via -rfbauth, -passwdfile, etc). Many VNC
servers do not require any password for reverse connections. To regain
the old behavior set: X11VNC_REVERSE_CONNECTION_NO_AUTH=1 before
starting x11vnc.
To use the vncconnect(1) program (from the core VNC package at To use the vncconnect(1) program (from the core VNC package at
www.realvnc.com) specify the [336]-vncconnect option to x11vnc (Note: www.realvnc.com) specify the [337]-vncconnect option to x11vnc (Note:
as of Dec/2004 -vncconnect is now the default). vncconnect(1) must be as of Dec/2004 -vncconnect is now the default). vncconnect(1) must be
pointed to the same X11 DISPLAY as x11vnc (since it uses X properties pointed to the same X11 DISPLAY as x11vnc (since it uses X properties
to communicate with x11vnc). If you do not have or do not want to get to communicate with x11vnc). If you do not have or do not want to get
...@@ -3257,18 +3294,19 @@ xprop -root -f VNC_CONNECT 8s -set VNC_CONNECT "$1" ...@@ -3257,18 +3294,19 @@ xprop -root -f VNC_CONNECT 8s -set VNC_CONNECT "$1"
display, but for a virtual one I keep around). display, but for a virtual one I keep around).
You can, but you would not be doing this for performance reasons (for You can, but you would not be doing this for performance reasons (for
virtual X sessions, Xvnc will give the fastest response). You may want virtual X sessions via VNC, Xvnc will give the fastest response). You
to do this because Xvnc does not support an X server extension you may want to do this because Xvnc does not support an X server
desire, or you want to take advantage of one of x11vnc's unending extension you desire, or you want to take advantage of one of x11vnc's
number of options and features. unending number of options and features.
One way to acheive this is to have a Xvfb(1) virtual framebuffer X One way to acheive this is to have a Xvfb(1) virtual framebuffer X
server running in the background and have x11vnc attached to it. server running in the background and have x11vnc attached to it.
Another method, faster and more accurate is to use the "dummy" Device Another method, faster and more accurate is to use the "dummy" Device
Driver in XFree86/Xorg (see below). One could view this desktop both Driver in XFree86/Xorg (see below). One could view this desktop both
remotely and locally using vncviewer. Make sure vncviewer's remotely and also locally using vncviewer. Make sure vncviewer's
"-encodings raw" is in effect for local viewing (compression seems to "-encodings raw" is in effect for local viewing (compression seems to
slow things down locally). slow things down locally). For local viewing you set up a "bare"
window manager that just starts up vncviewer and nothing else.
Here is one way to start up Xvfb: Here is one way to start up Xvfb:
xinit -- /usr/X11R6/bin/Xvfb :1 -screen 0 1024x768x16 xinit -- /usr/X11R6/bin/Xvfb :1 -screen 0 1024x768x16
...@@ -3283,7 +3321,7 @@ xprop -root -f VNC_CONNECT 8s -set VNC_CONNECT "$1" ...@@ -3283,7 +3321,7 @@ xprop -root -f VNC_CONNECT 8s -set VNC_CONNECT "$1"
There are some annoyances WRT Xvfb though. The default keyboard There are some annoyances WRT Xvfb though. The default keyboard
mapping seems to be very poor. One should run x11vnc with mapping seems to be very poor. One should run x11vnc with
[337]-add_keysyms option to have keysyms added automatically. Also, to [338]-add_keysyms option to have keysyms added automatically. Also, to
add the Shift_R and Control_R modifiers something like this is needed: add the Shift_R and Control_R modifiers something like this is needed:
#!/bin/sh #!/bin/sh
xmodmap -e "keycode any = Shift_R" xmodmap -e "keycode any = Shift_R"
...@@ -3305,11 +3343,11 @@ xmodmap -e "add Control = Control_L Control_R" ...@@ -3305,11 +3343,11 @@ xmodmap -e "add Control = Control_L Control_R"
The main drawback to this method (besides requiring extra The main drawback to this method (besides requiring extra
configuration and possibly root permission) is that it also does the configuration and possibly root permission) is that it also does the
Linux Virtual Console/Terminal (VC/VT) [338]switching even though it Linux Virtual Console/Terminal (VC/VT) [339]switching even though it
does not need to (since it doesn't use a real framebuffer). There are does not need to (since it doesn't use a real framebuffer). There are
some "dual headed" (actually multi-headed/multi-user) patches to the X some "dual headed" (actually multi-headed/multi-user) patches to the X
server that turn off the VT usage in the X server. Update: As of server that turn off the VT usage in the X server. Update: As of
Jul/2005 we have an LD_PRELOAD script [339]Xdummy that allows you to Jul/2005 we have an LD_PRELOAD script [340]Xdummy that allows you to
use a stock (i.e. unpatched) Xorg or XFree86 server with the "dummy" use a stock (i.e. unpatched) Xorg or XFree86 server with the "dummy"
driver and not have any VT switching problems! Currently Xdummy needs driver and not have any VT switching problems! Currently Xdummy needs
to be run as root, but with some luck that may be relaxed in the to be run as root, but with some luck that may be relaxed in the
...@@ -3341,7 +3379,7 @@ startx -- /path/to/Xdummy :1 ...@@ -3341,7 +3379,7 @@ startx -- /path/to/Xdummy :1
An X server can be started on the headless machine (sometimes this An X server can be started on the headless machine (sometimes this
requires configuring the X server to not fail if it cannot detect a requires configuring the X server to not fail if it cannot detect a
keyboard or mouse, see the next paragraph). Then you can export that X keyboard or mouse, see the next paragraph). Then you can export that X
display via x11vnc (e.g. see [340]this FAQ) and access it from display via x11vnc (e.g. see [341]this FAQ) and access it from
anywhere on the network via a VNC viewer. anywhere on the network via a VNC viewer.
Some tips on getting X servers to start on machines without keyboard Some tips on getting X servers to start on machines without keyboard
...@@ -3384,7 +3422,7 @@ startx -- /path/to/Xdummy :1 ...@@ -3384,7 +3422,7 @@ startx -- /path/to/Xdummy :1
19/03/2004 10:10:58 error creating tile-row shm for len=4 19/03/2004 10:10:58 error creating tile-row shm for len=4
19/03/2004 10:10:58 reverting to single_copytile mode 19/03/2004 10:10:58 reverting to single_copytile mode
Here is a shell script [341]shm_clear to list and prompt for removal Here is a shell script [342]shm_clear to list and prompt for removal
of your unattached shm segments (attached ones are skipped). I use it of your unattached shm segments (attached ones are skipped). I use it
while debugging x11vnc (I use "shm_clear -y" to assume "yes" for each while debugging x11vnc (I use "shm_clear -y" to assume "yes" for each
prompt). If x11vnc is regularly not cleaning up its shm segments, prompt). If x11vnc is regularly not cleaning up its shm segments,
...@@ -3418,36 +3456,36 @@ ied) ...@@ -3418,36 +3456,36 @@ ied)
in /etc/system. See the next paragraph for more workarounds. in /etc/system. See the next paragraph for more workarounds.
To minimize the number of shm segments used by x11vnc try using the To minimize the number of shm segments used by x11vnc try using the
[342]-onetile option (corresponds to only 3 shm segments used, and [343]-onetile option (corresponds to only 3 shm segments used, and
adding -fs 1.0 knocks it down to 2). If you are having much trouble adding -fs 1.0 knocks it down to 2). If you are having much trouble
with shm segments, consider disabling shm completely via the with shm segments, consider disabling shm completely via the
[343]-noshm option. Performance will be somewhat degraded but when [344]-noshm option. Performance will be somewhat degraded but when
done over local machine sockets it should be acceptable (see an done over local machine sockets it should be acceptable (see an
[344]earlier question discussing -noshm). [345]earlier question discussing -noshm).
Q-52: How can I make x11vnc use less system resources? Q-52: How can I make x11vnc use less system resources?
The [345]-nap and "[346]-wait n" (where n is the sleep between polls The [346]-nap and "[347]-wait n" (where n is the sleep between polls
in milliseconds, the default is 30 or so) option are good places to in milliseconds, the default is 30 or so) option are good places to
start. Reducing the X server bits per pixel depth (e.g. to 16bpp or start. Reducing the X server bits per pixel depth (e.g. to 16bpp or
even 8bpp) will further decrease memory I/O and network I/O. The even 8bpp) will further decrease memory I/O and network I/O. The
ShadowFB will make x11vnc's screen polling less severe. Using the ShadowFB will make x11vnc's screen polling less severe. Using the
[347]-onetile option will use less memory and use fewer shared memory [348]-onetile option will use less memory and use fewer shared memory
slots (add [348]-fs 1.0 for one less slot). slots (add [349]-fs 1.0 for one less slot).
Q-53: How can I make x11vnc use MORE system resources? Q-53: How can I make x11vnc use MORE system resources?
You can try [349]-threads and dial down the wait time (e.g. -wait 1) You can try [350]-threads and dial down the wait time (e.g. -wait 1)
and possibly dial down [350]-defer as well. Note that if you try to and possibly dial down [351]-defer as well. Note that if you try to
increase the "frame rate" too much you can bog down the server end increase the "frame rate" too much you can bog down the server end
with the extra work it needs to do compressing the framebuffer data, with the extra work it needs to do compressing the framebuffer data,
etc. etc.
That said, it is possible to "stream" video via x11vnc if the video That said, it is possible to "stream" video via x11vnc if the video
window is small enough. E.g. a 256x192 xawtv TV capture window (using window is small enough. E.g. a 256x192 xawtv TV capture window (using
the x11vnc [351]-id option) can be streamed over a LAN or wireless at the x11vnc [352]-id option) can be streamed over a LAN or wireless at
a reasonable frame rate. a reasonable frame rate.
...@@ -3463,16 +3501,16 @@ ied) ...@@ -3463,16 +3501,16 @@ ied)
* Use a smaller desktop size (e.g. 1024x768 instead of 1280x1024) * Use a smaller desktop size (e.g. 1024x768 instead of 1280x1024)
* Make sure the desktop background is a solid color (the background * Make sure the desktop background is a solid color (the background
is resent every time it is re-exposed). Consider using the is resent every time it is re-exposed). Consider using the
[352]-solid [color] option to try to do this automatically. [353]-solid [color] option to try to do this automatically.
* Configure your window manager or desktop "theme" to not use fancy * Configure your window manager or desktop "theme" to not use fancy
images, shading, and gradients for the window decorations, etc. images, shading, and gradients for the window decorations, etc.
Disable window animations, etc. Maybe your desktop has a "low Disable window animations, etc. Maybe your desktop has a "low
bandwidth" theme you can easily switch into and out of. bandwidth" theme you can easily switch into and out of.
* Avoid small scrolls of large windows using the Arrow keys or * Avoid small scrolls of large windows using the Arrow keys or
scrollbar. Try to use PageUp/PageDown instead. (not so much of a scrollbar. Try to use PageUp/PageDown instead. (not so much of a
problem in x11vnc 0.7.2 if [353]-scrollcopyrect is active and problem in x11vnc 0.7.2 if [354]-scrollcopyrect is active and
detecting scrolls for the application). detecting scrolls for the application).
* If the [354]-wireframe option is not available (earlier than * If the [355]-wireframe option is not available (earlier than
x11vnc 0.7.2 or you have disabled it via -nowireframe) then x11vnc 0.7.2 or you have disabled it via -nowireframe) then
Disable Opaque Moves and Resizes in the window manager/desktop. Disable Opaque Moves and Resizes in the window manager/desktop.
* However if -wireframe is active (on by default in x11vnc 0.7.2) * However if -wireframe is active (on by default in x11vnc 0.7.2)
...@@ -3492,7 +3530,7 @@ ied) ...@@ -3492,7 +3530,7 @@ ied)
noticed. noticed.
VNC viewer parameters: VNC viewer parameters:
* Use a [355]TightVNC enabled viewer! (Actually, RealVNC 4.x viewer * Use a [356]TightVNC enabled viewer! (Actually, RealVNC 4.x viewer
with ZRLE encoding is not too bad either; some claim it is with ZRLE encoding is not too bad either; some claim it is
faster). faster).
* Make sure the tight (or zrle) encoding is being used (look at * Make sure the tight (or zrle) encoding is being used (look at
...@@ -3515,28 +3553,28 @@ ied) ...@@ -3515,28 +3553,28 @@ ied)
file. file.
x11vnc parameters: x11vnc parameters:
* Try using [356]-nodragging (no screen updates when dragging mouse, * Try using [357]-nodragging (no screen updates when dragging mouse,
but sometimes you miss visual feedback) but sometimes you miss visual feedback)
* Make sure the [357]-wireframe option is active (it should be on by * Make sure the [358]-wireframe option is active (it should be on by
default) and you have Opaque Moves/Resizes Enabled in the window default) and you have Opaque Moves/Resizes Enabled in the window
manager. manager.
* Make sure the [358]-scrollcopyrect option is active (it should be * Make sure the [359]-scrollcopyrect option is active (it should be
on by default). This detects scrolls in many (but not all) on by default). This detects scrolls in many (but not all)
applications an applies the CopyRect encoding for a big speedup. applications an applies the CopyRect encoding for a big speedup.
* Set [359]-fs 1.0 (disables fullscreen updates) * Set [360]-fs 1.0 (disables fullscreen updates)
* Try increasing [360]-wait or [361]-defer (reduces the maximum * Try increasing [361]-wait or [362]-defer (reduces the maximum
"frame rate", but won't help much for large screen changes) "frame rate", but won't help much for large screen changes)
* Try the [362]-progressive pixelheight mode with the block * Try the [363]-progressive pixelheight mode with the block
pixelheight 100 or so (delays sending vertical blocks since they pixelheight 100 or so (delays sending vertical blocks since they
may change while viewer is receiving earlier ones) may change while viewer is receiving earlier ones)
* If you just want to watch one (simple) window use [363]-id (cuts * If you just want to watch one (simple) window use [364]-id (cuts
down extraneous polling and updates, but can be buggy or down extraneous polling and updates, but can be buggy or
insufficient) insufficient)
* Set [364]-nosel (disables all clipboard selection exchange) * Set [365]-nosel (disables all clipboard selection exchange)
* Use [365]-nocursor and [366]-nocursorpos (repainting the remote * Use [366]-nocursor and [367]-nocursorpos (repainting the remote
cursor position and shape takes resources and round trips) cursor position and shape takes resources and round trips)
* On very slow links (e.g. <= 28.8) you may need to increase the * On very slow links (e.g. <= 28.8) you may need to increase the
[367]-readtimeout n setting if it sometimes takes more than 20sec [368]-readtimeout n setting if it sometimes takes more than 20sec
to paint the full screen, etc. to paint the full screen, etc.
...@@ -3558,7 +3596,7 @@ ied) ...@@ -3558,7 +3596,7 @@ ied)
Note that the DAMAGE extension does not speed up the actual reading of Note that the DAMAGE extension does not speed up the actual reading of
pixels from the video card framebuffer memory, by, say, mirroring them pixels from the video card framebuffer memory, by, say, mirroring them
in main memory. So reading the fb is still painfully [368]slow (e.g. in main memory. So reading the fb is still painfully [369]slow (e.g.
5MB/sec), and so even using X DAMAGE when large changes occur on the 5MB/sec), and so even using X DAMAGE when large changes occur on the
screen the bulk of the time is still spent retrieving them. Not ideal, screen the bulk of the time is still spent retrieving them. Not ideal,
but use of the ShadowFB XFree86/Xorg option speeds up the reading but use of the ShadowFB XFree86/Xorg option speeds up the reading
...@@ -3576,27 +3614,27 @@ ied) ...@@ -3576,27 +3614,27 @@ ied)
DAMAGE rectangles to contain real damage. The larger rectangles are DAMAGE rectangles to contain real damage. The larger rectangles are
only used as hints to focus the traditional scanline polling (i.e. if only used as hints to focus the traditional scanline polling (i.e. if
a scanline doesn't intersect a recent DAMAGE rectangle, the scan is a scanline doesn't intersect a recent DAMAGE rectangle, the scan is
skipped). You can use the "[369]-xd_area A" option to adjust the size skipped). You can use the "[370]-xd_area A" option to adjust the size
of the trusted DAMAGE rectangles. The default is 20000 pixels (e.g. a of the trusted DAMAGE rectangles. The default is 20000 pixels (e.g. a
140x140 square, etc). Use "-xd_area 0" to disable the cutoff and trust 140x140 square, etc). Use "-xd_area 0" to disable the cutoff and trust
all DAMAGE rectangles. all DAMAGE rectangles.
The option "[370]-xd_mem f" may also be of use in tuning the The option "[371]-xd_mem f" may also be of use in tuning the
algorithm. To disable using DAMAGE entirely use "[371]-noxdamage". algorithm. To disable using DAMAGE entirely use "[372]-noxdamage".
Q-56: When I drag windows around with the mouse or scroll up and down Q-56: When I drag windows around with the mouse or scroll up and down
things really bog down (unless I do the drag in a single, quick things really bog down (unless I do the drag in a single, quick
motion). Is there anything to do to improve things? motion). Is there anything to do to improve things?
This problem is primarily due to [372]slow hardware read rates from This problem is primarily due to [373]slow hardware read rates from
video cards: as you scroll or move a large window around the screen video cards: as you scroll or move a large window around the screen
changes are much too rapid for x11vnc to keep up them (it can usually changes are much too rapid for x11vnc to keep up them (it can usually
only read the video card at about 5-10 MB/sec, so it can take a good only read the video card at about 5-10 MB/sec, so it can take a good
fraction of a second to read the changes induce from moving a large fraction of a second to read the changes induce from moving a large
window, if this to be done a number of times in succession the window window, if this to be done a number of times in succession the window
or scroll appears to "lurch" forward). See the description in the or scroll appears to "lurch" forward). See the description in the
[373]-pointer_mode option for more info. The next bottleneck is [374]-pointer_mode option for more info. The next bottleneck is
compressing all of these changes and sending them out to connected compressing all of these changes and sending them out to connected
viewers, however the VNC protocol is pretty much self-adapting with viewers, however the VNC protocol is pretty much self-adapting with
respect to that (updates are only packaged and sent when viewers ask respect to that (updates are only packaged and sent when viewers ask
...@@ -3606,26 +3644,26 @@ ied) ...@@ -3606,26 +3644,26 @@ ied)
tree. The default should now be much better than before and dragging tree. The default should now be much better than before and dragging
small windows around should no longer be a huge pain. If for some small windows around should no longer be a huge pain. If for some
reason these changes make matters worse, you can go back to the old reason these changes make matters worse, you can go back to the old
way via the "[374]-pointer_mode 1" option. way via the "[375]-pointer_mode 1" option.
Also added was the [375]-nodragging option that disables all screen Also added was the [376]-nodragging option that disables all screen
updates while dragging with the mouse (i.e. mouse motion with a button updates while dragging with the mouse (i.e. mouse motion with a button
held down). This gives the snappiest response, but might be undesired held down). This gives the snappiest response, but might be undesired
in some circumstances when you want to see the visual feedback while in some circumstances when you want to see the visual feedback while
dragging (e.g. menu traversal or text selection). dragging (e.g. menu traversal or text selection).
As of Dec/2004 in the libvncserver CVS the [376]-pointer_mode n option As of Dec/2004 in the libvncserver CVS the [377]-pointer_mode n option
was introduced. n=1 is the original mode, n=2 an improvement, etc.. was introduced. n=1 is the original mode, n=2 an improvement, etc..
See the -pointer_mode n help for more info. See the -pointer_mode n help for more info.
Also, in some circumstances the [377]-threads option can improve Also, in some circumstances the [378]-threads option can improve
response considerably. Be forewarned that if more than one vncviewer response considerably. Be forewarned that if more than one vncviewer
is connected at the same time then libvncserver may not be thread safe is connected at the same time then libvncserver may not be thread safe
(try to get the viewers to use different VNC encodings, e.g. tight and (try to get the viewers to use different VNC encodings, e.g. tight and
ZRLE). ZRLE).
As of Apr/2005 in the libvncserver CVS two new options (see the As of Apr/2005 in the libvncserver CVS two new options (see the
[378]wireframe FAQ and [379]scrollcopyrect FAQ below) provide schemes [379]wireframe FAQ and [380]scrollcopyrect FAQ below) provide schemes
to sweep this problem under the rug for window moves or resizes and to sweep this problem under the rug for window moves or resizes and
for some (but not all) window scrolls. for some (but not all) window scrolls.
...@@ -3641,8 +3679,8 @@ ied) ...@@ -3641,8 +3679,8 @@ ied)
shown. When the window move/resize stops, it returns to normal shown. When the window move/resize stops, it returns to normal
processing: you should only see the window appear in the new position. processing: you should only see the window appear in the new position.
This spares you from interacting with a "lurching" window between all This spares you from interacting with a "lurching" window between all
of the intermediate steps. BTW the lurching is due to [380]slow video of the intermediate steps. BTW the lurching is due to [381]slow video
card read rates (see [381]here too). A displacement, even a small one, card read rates (see [382]here too). A displacement, even a small one,
of a large window requires a non-negligible amount of time, a good of a large window requires a non-negligible amount of time, a good
fraction of a second, to read in from the hardware framebuffer. fraction of a second, to read in from the hardware framebuffer.
...@@ -3650,7 +3688,7 @@ ied) ...@@ -3650,7 +3688,7 @@ ied)
for -wireframe to do any good. for -wireframe to do any good.
The mode is currently on by default because most people are inflicted The mode is currently on by default because most people are inflicted
with the problem. It can be disabled with the [382]-nowireframe option with the problem. It can be disabled with the [383]-nowireframe option
(aka -nowf). Why might one want to turn off the wireframing? Since (aka -nowf). Why might one want to turn off the wireframing? Since
x11vnc is merely guessing when windows are being moved/resized, it may x11vnc is merely guessing when windows are being moved/resized, it may
guess poorly for your window-manager or desktop, or even for the way guess poorly for your window-manager or desktop, or even for the way
...@@ -3695,13 +3733,13 @@ ied) ...@@ -3695,13 +3733,13 @@ ied)
* Maximum time to show a wireframe animation. * Maximum time to show a wireframe animation.
* Minimum time between sending wireframe outlines. * Minimum time between sending wireframe outlines.
See the [383]"-wireframe tweaks" option for more details. On a slow See the [384]"-wireframe tweaks" option for more details. On a slow
link, e.g. dialup modem, the parameters may be automatically adjusted link, e.g. dialup modem, the parameters may be automatically adjusted
for better response. for better response.
CopyRect encoding: In addition to the above there is the CopyRect encoding: In addition to the above there is the
[384]"-wirecopyrect mode" option. It is also on by default. This [385]"-wirecopyrect mode" option. It is also on by default. This
instructs x11vnc to not only show the wireframe animation, but to also instructs x11vnc to not only show the wireframe animation, but to also
instruct all connected VNC viewers to locally translate the window instruct all connected VNC viewers to locally translate the window
image data from the original position to the new position on the image data from the original position to the new position on the
...@@ -3749,7 +3787,7 @@ ied) ...@@ -3749,7 +3787,7 @@ ied)
requiring the image data to be transmitted over the network. For fast requiring the image data to be transmitted over the network. For fast
links the speedup is primarily due to x11vnc not having to read the links the speedup is primarily due to x11vnc not having to read the
scrolled framebuffer data from the X server (recall that reading from scrolled framebuffer data from the X server (recall that reading from
the hardware framebuffer is [385]slow). the hardware framebuffer is [386]slow).
To do this x11vnc uses the RECORD X extension to snoop the X11 To do this x11vnc uses the RECORD X extension to snoop the X11
protocol between the X client with the focus window and the X server. protocol between the X client with the focus window and the X server.
...@@ -3771,10 +3809,10 @@ ied) ...@@ -3771,10 +3809,10 @@ ied)
the X server display: if one falls too far behind it could become a the X server display: if one falls too far behind it could become a
mess... mess...
The initial implementation of [386]-scrollcopyrect option is useful in The initial implementation of [387]-scrollcopyrect option is useful in
that it detects many scrolls and thus gives a much nicer working that it detects many scrolls and thus gives a much nicer working
environment (especially when combined with the [387]-wireframe environment (especially when combined with the [388]-wireframe
[388]-wirecopyrect [389]options, which are also on by default; and if [389]-wirecopyrect [390]options, which are also on by default; and if
you are willing to enable the ShadowFB things are very fast). The fact you are willing to enable the ShadowFB things are very fast). The fact
that there aren't long delays or lurches during scrolling is the that there aren't long delays or lurches during scrolling is the
primary improvement. primary improvement.
...@@ -3807,10 +3845,10 @@ ied) ...@@ -3807,10 +3845,10 @@ ied)
One can tap the Alt_L key (Left "Alt" key) 3 times in a row to One can tap the Alt_L key (Left "Alt" key) 3 times in a row to
signal x11vnc to refresh the screen to all viewers. Your signal x11vnc to refresh the screen to all viewers. Your
VNC-viewer may have its own screen refresh hot-key or button. See VNC-viewer may have its own screen refresh hot-key or button. See
also: [390]-fixscreen also: [391]-fixscreen
* Some applications, notably OpenOffice, do XCopyArea scrolls in * Some applications, notably OpenOffice, do XCopyArea scrolls in
weird ways that assume ancestor window clipping is taking place. weird ways that assume ancestor window clipping is taking place.
See the [391]-scr_skip option for ways to tweak this on a See the [392]-scr_skip option for ways to tweak this on a
per-application basis. per-application basis.
* Selecting text while dragging the mouse may be slower, especially * Selecting text while dragging the mouse may be slower, especially
if the Button-down event happens near the window's edge. This is if the Button-down event happens near the window's edge. This is
...@@ -3827,7 +3865,7 @@ ied) ...@@ -3827,7 +3865,7 @@ ied)
because it fails to detect scrolls in it. Sometimes clicking because it fails to detect scrolls in it. Sometimes clicking
inside the application window or selecting some text in it to inside the application window or selecting some text in it to
force the focus helps. force the focus helps.
* When using the [392]-scale option there will be a quick CopyRect * When using the [393]-scale option there will be a quick CopyRect
scroll, but it needs to be followed by a slower "cleanup" update. scroll, but it needs to be followed by a slower "cleanup" update.
This is because for a fixed finite screen resolution (e.g. 75 dpi) This is because for a fixed finite screen resolution (e.g. 75 dpi)
scaling and copyrect-ing are not exactly independent. Scaling scaling and copyrect-ing are not exactly independent. Scaling
...@@ -3840,7 +3878,7 @@ ied) ...@@ -3840,7 +3878,7 @@ ied)
If you find the -scrollcopyrect behavior too approximate or If you find the -scrollcopyrect behavior too approximate or
distracting you can go back to the standard polling-only update method distracting you can go back to the standard polling-only update method
with the [393]-noscrollcopyrect (or -noscr for short). If you find with the [394]-noscrollcopyrect (or -noscr for short). If you find
some extremely bad and repeatable behavior for -scrollcopyrect please some extremely bad and repeatable behavior for -scrollcopyrect please
report a bug. report a bug.
...@@ -3879,16 +3917,16 @@ ied) ...@@ -3879,16 +3917,16 @@ ied)
this is because the cursor shape is often downloaded to the graphics this is because the cursor shape is often downloaded to the graphics
hardware (video card), but I could be mistaken. hardware (video card), but I could be mistaken.
A simple kludge is provided by the "[394]-cursor X" option that A simple kludge is provided by the "[395]-cursor X" option that
changes the cursor when the mouse is on the root background (or any 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 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 like GNOME or KDE often cover up the root background, so this won't
work for those cases. Also see the "[395]-cursor some" option for work for those cases. Also see the "[396]-cursor some" option for
additional kludges. additional kludges.
Note that as of Aug/2004 in the libvncserver CVS, on Solaris using the Note that as of Aug/2004 in the libvncserver CVS, on Solaris using the
SUN_OVL overlay extension and IRIX, x11vnc can show the correct mouse SUN_OVL overlay extension and IRIX, x11vnc can show the correct mouse
cursor when the [396]-overlay option is supplied. See [397]this FAQ cursor when the [397]-overlay option is supplied. See [398]this FAQ
for more info. for more info.
Also as of Dec/2004 in the libvncserver CVS XFIXES X extension support Also as of Dec/2004 in the libvncserver CVS XFIXES X extension support
...@@ -3896,7 +3934,7 @@ ied) ...@@ -3896,7 +3934,7 @@ ied)
XFIXES fixes the problem of the cursor-shape being write-only: x11vnc 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 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 the connected viewers. XFIXES is available on recent Linux Xorg based
distros and [398]Solaris 10. distros and [399]Solaris 10.
The only XFIXES issue is the handling of alpha channel transparency in 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 cursors. If a cursor has any translucency then in general it must be
...@@ -3904,7 +3942,7 @@ ied) ...@@ -3904,7 +3942,7 @@ ied)
situations where the cursor transparency can also handled exactly: situations where the cursor transparency can also handled exactly:
when the VNC Viewer requires the cursor shape be drawn into the VNC 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 framebuffer or if you apply a patch to your VNC Viewer to extract
hidden alpha channel data under 32bpp. [399]Details can be found here. hidden alpha channel data under 32bpp. [400]Details can be found here.
Q-60: When using XFIXES cursorshape mode, some of the cursors look Q-60: When using XFIXES cursorshape mode, some of the cursors look
...@@ -3937,17 +3975,17 @@ ied) ...@@ -3937,17 +3975,17 @@ ied)
for most cursor themes and you don't have to worry about it. 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 In case it still looks bad for your cursor theme, there are (of
course!) some tunable parameters. The "[400]-alphacut n" option lets course!) some tunable parameters. The "[401]-alphacut n" option lets
you set the threshold "n" (between 0 and 255): cursor pixels with you set the threshold "n" (between 0 and 255): cursor pixels with
alpha values below n will be considered completely transparent while alpha values below n will be considered completely transparent while
values equal to or above n will be completely opaque. The default is values equal to or above n will be completely opaque. The default is
240. The "[401]-alphafrac f" option tries to correct individual 240. The "[402]-alphafrac f" option tries to correct individual
cursors that did not fare well with the default -alphacut value: if a 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 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 selected by the default -alphacut, the threshold is lowered until f of
its pixels are selected. The default fraction is 0.33. its pixels are selected. The default fraction is 0.33.
Finally, there is an option [402]-alpharemove that is useful for Finally, there is an option [403]-alpharemove that is useful for
themes where many cursors are light colored (e.g. "whiteglass"). themes where many cursors are light colored (e.g. "whiteglass").
XFIXES returns the cursor data with the RGB values pre-multiplied by XFIXES returns the cursor data with the RGB values pre-multiplied by
the alpha value. If the white cursors look too grey, specify the alpha value. If the white cursors look too grey, specify
...@@ -3973,11 +4011,11 @@ ied) ...@@ -3973,11 +4011,11 @@ ied)
send the alpha channel data to libvncserver. However, this data will send the alpha channel data to libvncserver. However, this data will
only be used for VNC clients that do not support the only be used for VNC clients that do not support the
CursorShapeUpdates VNC extension (or have disabled it). It can be CursorShapeUpdates VNC extension (or have disabled it). It can be
disabled for all clients with the [403]-nocursorshape x11vnc option. disabled for all clients with the [404]-nocursorshape x11vnc option.
In this case the cursor is drawn, correctly blended with the In this case the cursor is drawn, correctly blended with the
background, into the VNC framebuffer before being sent out to 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 client. So the alpha blending is done on the x11vnc side. Use the
[404]-noalphablend option to disable this behavior (always approximate [405]-noalphablend option to disable this behavior (always approximate
transparent cursors with opaque RGB values). transparent cursors with opaque RGB values).
The CursorShapeUpdates VNC extension complicates matters because the The CursorShapeUpdates VNC extension complicates matters because the
...@@ -4005,9 +4043,9 @@ ied) ...@@ -4005,9 +4043,9 @@ ied)
Q-62: Why does the mouse arrow just stay in one corner in my Q-62: Why does the mouse arrow just stay in one corner in my
vncviewer, whereas my cursor (that does move) is just a dot? vncviewer, whereas my cursor (that does move) is just a dot?
This default takes advantage of a [405]tightvnc extension This default takes advantage of a [406]tightvnc extension
(CursorShapeUpdates) that allows specifying a cursor image shape for (CursorShapeUpdates) that allows specifying a cursor image shape for
the local VNC viewer. You may disable it with the [406]-nocursor the local VNC viewer. You may disable it with the [407]-nocursor
option to x11vnc if your viewer does not have this extension. option to x11vnc if your viewer does not have this extension.
Note: as of Aug/2004 in the libvncserver CVS this should be fixed: the Note: as of Aug/2004 in the libvncserver CVS this should be fixed: the
...@@ -4021,18 +4059,18 @@ ied) ...@@ -4021,18 +4059,18 @@ ied)
clients (i.e. passive viewers can see the mouse cursor being moved clients (i.e. passive viewers can see the mouse cursor being moved
around by another viewer)? around by another viewer)?
Use the [407]-cursorpos option when starting x11vnc. A VNC viewer must Use the [408]-cursorpos option when starting x11vnc. A VNC viewer must
support the Cursor Positions Updates for the user to see the mouse support the Cursor Positions Updates for the user to see the mouse
motions (the TightVNC viewers support this). As of Aug/2004 in the motions (the TightVNC viewers support this). As of Aug/2004 in the
libvncserver CVS -cursorpos is the default. See also [408]-nocursorpos libvncserver CVS -cursorpos is the default. See also [409]-nocursorpos
and [409]-nocursorshape. and [410]-nocursorshape.
Q-64: Is it possible to swap the mouse buttons (e.g. left-handed Q-64: Is it possible to swap the mouse buttons (e.g. left-handed
operation), or arbitrarily remap them? How about mapping button clicks operation), or arbitrarily remap them? How about mapping button clicks
to keystrokes, e.g. to partially emulate Mouse wheel scrolling? to keystrokes, e.g. to partially emulate Mouse wheel scrolling?
You can remap the mouse buttons via something like: [410]-buttonmap You can remap the mouse buttons via something like: [411]-buttonmap
13-31 (or perhaps 12-21). Also, note that xmodmap(1) lets you directly 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 adjust the X server's button mappings, but in some circumstances it
might be more desirable to have x11vnc do it. might be more desirable to have x11vnc do it.
...@@ -4040,7 +4078,7 @@ ied) ...@@ -4040,7 +4078,7 @@ ied)
One user had an X server with only one mouse button(!) and was able to 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. map all of the VNC client mouse buttons to it via: -buttonmap 123-111.
Note that the [411]-debug_pointer option prints out much info for Note that the [412]-debug_pointer option prints out much info for
every mouse/pointer event and is handy in solving problems. every mouse/pointer event and is handy in solving problems.
To map mouse button clicks to keystrokes you can use the alternate To map mouse button clicks to keystrokes you can use the alternate
...@@ -4062,7 +4100,7 @@ ied) ...@@ -4062,7 +4100,7 @@ ied)
Exactly what keystroke "scrolling" events they should be bound to Exactly what keystroke "scrolling" events they should be bound to
depends on one's taste. If this method is too approximate, one could depends on one's taste. If this method is too approximate, one could
consider not using [412]-buttonmap but rather configuring the X server consider not using [413]-buttonmap but rather configuring the X server
to think it has a mouse with 5 buttons even though the physical mouse to think it has a mouse with 5 buttons even though the physical mouse
does not. (e.g. 'Option "ZAxisMapping" "4 5"'). does not. (e.g. 'Option "ZAxisMapping" "4 5"').
...@@ -4092,7 +4130,7 @@ ied) ...@@ -4092,7 +4130,7 @@ ied)
Q-65: How can I get my AltGr and Shift modifiers to work between Q-65: How can I get my AltGr and Shift modifiers to work between
keyboards for different languages? keyboards for different languages?
The option [413]-modtweak should help here. It is a mode that monitors The option [414]-modtweak should help here. It is a mode that monitors
the state of the Shift and AltGr Modifiers and tries to deduce the the state of the Shift and AltGr Modifiers and tries to deduce the
correct keycode to send, possibly by sending fake modifier key presses correct keycode to send, possibly by sending fake modifier key presses
and releases in addition to the actual keystroke. and releases in addition to the actual keystroke.
...@@ -4101,17 +4139,17 @@ ied) ...@@ -4101,17 +4139,17 @@ ied)
default (use -nomodtweak to get the old behavior). This was done default (use -nomodtweak to get the old behavior). This was done
because it was noticed on newer XFree86 setups even on bland "us" because it was noticed on newer XFree86 setups even on bland "us"
keyboards like "pc104 us" XFree86 included a "ghost" key with both "<" keyboards like "pc104 us" XFree86 included a "ghost" key with both "<"
and ">" it. This key does not exist on the keyboard (see [414]this FAQ and ">" it. This key does not exist on the keyboard (see [415]this FAQ
for more info). Without -modtweak there was then an ambiguity in the for more info). Without -modtweak there was then an ambiguity in the
reverse map keysym => keycode, making it so the "<" symbol could not reverse map keysym => keycode, making it so the "<" symbol could not
be typed. be typed.
Also see the [415]FAQ about the -xkb option for a more powerful method Also see the [416]FAQ about the -xkb option for a more powerful method
of modifier tweaking for use on X servers with the XKEYBOARD of modifier tweaking for use on X servers with the XKEYBOARD
extension. extension.
When trying to resolve keyboard mapping problems, note that the When trying to resolve keyboard mapping problems, note that the
[416]-debug_keyboard option prints out much info for every keystroke [417]-debug_keyboard option prints out much info for every keystroke
and so can be useful debugging things. and so can be useful debugging things.
...@@ -4123,9 +4161,9 @@ ied) ...@@ -4123,9 +4161,9 @@ ied)
(e.g. pc105 in the XF86Config file when it should be something else, (e.g. pc105 in the XF86Config file when it should be something else,
say pc104). say pc104).
Short Cut: Try the [417]-xkb or [418]-sloppy_keys options and see if Short Cut: Try the [418]-xkb or [419]-sloppy_keys options and see if
that helps the situation. The discussion below is a bit outdated (e.g. that helps the situation. The discussion below is a bit outdated (e.g.
[419]-modtweak is now the default) but is useful reference for various [420]-modtweak is now the default) but is useful reference for various
tricks and so is kept. tricks and so is kept.
...@@ -4168,17 +4206,17 @@ ied) ...@@ -4168,17 +4206,17 @@ ied)
-remap less-comma -remap less-comma
These are convenient in that they do not modify the actual X server These are convenient in that they do not modify the actual X server
settings. The former ([420]-modtweak) is a mode that monitors the settings. The former ([421]-modtweak) is a mode that monitors the
state of the Shift and AltGr modifiers and tries to deduce the correct 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. keycode sequence to send. Since Jul/2004 -modtweak is now the default.
The latter ([421]-remap less-comma) is an immediate remapping of the The latter ([422]-remap less-comma) is an immediate remapping of the
keysym less to the keysym comma when it comes in from a client (so keysym less to the keysym comma when it comes in from a client (so
when Shift is down the comma press will yield "<"). when Shift is down the comma press will yield "<").
See also the [422]FAQ about the -xkb option as a possible workaround See also the [423]FAQ about the -xkb option as a possible workaround
using the XKEYBOARD extension. using the XKEYBOARD extension.
Note that the [423]-debug_keyboard option prints out much info for Note that the [424]-debug_keyboard option prints out much info for
every keystroke to aid debugging keyboard problems. every keystroke to aid debugging keyboard problems.
...@@ -4186,13 +4224,13 @@ ied) ...@@ -4186,13 +4224,13 @@ ied)
(i.e. an extra comma). (i.e. an extra comma).
This is likely because you press "Shift" then "<" but then released This is likely because you press "Shift" then "<" but then released
the Shift key before releasing the "<". Because of a [424]keymapping the Shift key before releasing the "<". Because of a [425]keymapping
ambiguity the last event "< up" is interpreted as "," because that key ambiguity the last event "< up" is interpreted as "," because that key
unshifted is the comma. unshifted is the comma.
This should not happen in [425]-xkb mode, because it works hard to This should not happen in [426]-xkb mode, because it works hard to
resolve the ambiguities. If you do not want to use -xkb, try the resolve the ambiguities. If you do not want to use -xkb, try the
option [426]-sloppy_keys to attempt a similar type of algorithm. option [427]-sloppy_keys to attempt a similar type of algorithm.
Q-68: I'm using an "international" keyboard (e.g. German "de", or Q-68: I'm using an "international" keyboard (e.g. German "de", or
...@@ -4216,7 +4254,7 @@ ied) ...@@ -4216,7 +4254,7 @@ ied)
In both cases no AltGr is sent to the VNC server, but we know AltGr is 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 "@". needed on the physical international keyboard to type a "@".
This all worked fine with x11vnc running with the [427]-modtweak This all worked fine with x11vnc running with the [428]-modtweak
option (it figures out how to adjust the Modifier keys (Shift or option (it figures out how to adjust the Modifier keys (Shift or
AltGr) to get the "@"). However it fails under recent versions of AltGr) to get the "@"). However it fails under recent versions of
XFree86 (and the X.org fork). These run the XKEYBOARD extension by XFree86 (and the X.org fork). These run the XKEYBOARD extension by
...@@ -4234,7 +4272,7 @@ ied) ...@@ -4234,7 +4272,7 @@ ied)
* there is a new option -xkb to use the XKEYBOARD extension API to * there is a new option -xkb to use the XKEYBOARD extension API to
do the Modifier key tweaking. do the Modifier key tweaking.
The [428]-xkb option seems to fix all of the missing keys: "@", "<", The [429]-xkb option seems to fix all of the missing keys: "@", "<",
">", etc.: it is recommended that you try it if you have this sort of ">", 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 problem. Let us know if there are any remaining problems (see the next
paragraph for some known problems). If you specify the -debug_keyboard paragraph for some known problems). If you specify the -debug_keyboard
...@@ -4242,7 +4280,7 @@ ied) ...@@ -4242,7 +4280,7 @@ ied)
debugging output (send it along with any problems you report). debugging output (send it along with any problems you report).
Update: as of Jun/2005 x11vnc will try to automatically enable Update: as of Jun/2005 x11vnc will try to automatically enable
[429]-xkb if it appears that would be beneficial (e.g. if it sees any [430]-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 of "@", "<", ">", "[" and similar keys are mapped in a way that needs
the -xkb to access them). To disable this automatic check use -noxkb. the -xkb to access them). To disable this automatic check use -noxkb.
...@@ -4257,7 +4295,7 @@ ied) ...@@ -4257,7 +4295,7 @@ ied)
was attached to keycode 93 (no physical key generates this was attached to keycode 93 (no physical key generates this
keycode) while ISO_Level3_Shift was attached to keycode 113. The keycode) while ISO_Level3_Shift was attached to keycode 113. The
keycode skipping option was used to disable the ghost key: keycode skipping option was used to disable the ghost key:
[430]-skip_keycodes 93 [431]-skip_keycodes 93
* In implementing -xkb we noticed that some characters were still * In implementing -xkb we noticed that some characters were still
not getting through, e.g. "~" and "^". This is not really an not getting through, e.g. "~" and "^". This is not really an
XKEYBOARD problem. What was happening was the VNC viewer was XKEYBOARD problem. What was happening was the VNC viewer was
...@@ -4274,16 +4312,16 @@ ied) ...@@ -4274,16 +4312,16 @@ ied)
What to do? In general the VNC protocol has not really solved this 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 problem: what should be done if the VNC viewer sends a keysym not
recognized by the VNC server side? Workarounds can possibly be recognized by the VNC server side? Workarounds can possibly be
created using the [431]-remap x11vnc option: created using the [432]-remap x11vnc option:
-remap asciitilde-dead_tilde,asciicircum-dead_circumflex -remap asciitilde-dead_tilde,asciicircum-dead_circumflex
etc. Use -remap filename if the list is long. Please send us your etc. Use -remap filename if the list is long. Please send us your
workarounds for this problem on your keyboard. Perhaps we can have workarounds for this problem on your keyboard. Perhaps we can have
x11vnc adjust automatically at some point. Also see the x11vnc adjust automatically at some point. Also see the
[432]-add_keysyms option in the next paragraph. [433]-add_keysyms option in the next paragraph.
Update: for convenience "[433]-remap DEAD" does many of these Update: for convenience "[434]-remap DEAD" does many of these
mappings at once. mappings at once.
* To complement the above workaround using the [434]-remap, an * To complement the above workaround using the [435]-remap, an
option [435]-add_keysyms was added. This option instructs x11vnc option [436]-add_keysyms was added. This option instructs x11vnc
to bind any unknown Keysyms coming in from VNC viewers to unused 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 Keycodes in the X server. This modifies the global state of the X
server. When x11vnc exits it removes the extra keymappings it server. When x11vnc exits it removes the extra keymappings it
...@@ -4302,7 +4340,7 @@ ied) ...@@ -4302,7 +4340,7 @@ ied)
Short answer: disable key autorepeating by running the command "xset r 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 off" on the Xserver where x11vnc is run (restore via "xset r on") or
use the new (Jul/2004) [436]-norepeat x11vnc option. You will still use the new (Jul/2004) [437]-norepeat x11vnc option. You will still
have autorepeating because that is taken care of on your VNC viewer have autorepeating because that is taken care of on your VNC viewer
side. side.
...@@ -4326,7 +4364,7 @@ ied) ...@@ -4326,7 +4364,7 @@ ied)
off", does the problem go away? off", does the problem go away?
The workaround is to manually apply "xset r off" and "xset r on" as The workaround is to manually apply "xset r off" and "xset r on" as
needed, or to use the [437]-norepeat (which has since Dec/2004 been needed, or to use the [438]-norepeat (which has since Dec/2004 been
made the default). Note that with X server autorepeat turned off the made the default). Note that with X server autorepeat turned off the
VNC viewer side of the connection will (nearly always) do its own VNC viewer side of the connection will (nearly always) do its own
autorepeating so there is no big loss here, unless someone is also autorepeating so there is no big loss here, unless someone is also
...@@ -4337,7 +4375,7 @@ ied) ...@@ -4337,7 +4375,7 @@ ied)
keystrokes!! keystrokes!!
Are you using x11vnc to log in to an X session? (as described in Are you using x11vnc to log in to an X session? (as described in
[438]this FAQ) If so, x11vnc is starting before your session and it [439]this FAQ) If so, x11vnc is starting before your session and it
disables autorepeat when you connect, but then after you log in your disables autorepeat when you connect, but then after you log in your
session startup (GNOME, KDE, ...) could be resetting the autorepeat to session startup (GNOME, KDE, ...) could be resetting the autorepeat to
be on. Or it could be something inside your desktop trying to be be on. Or it could be something inside your desktop trying to be
...@@ -4361,7 +4399,7 @@ ied) ...@@ -4361,7 +4399,7 @@ ied)
machine where I run the VNC viewer does not. Is there a way I can map 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? a local unused key to send an AltGr? How about a Compose key as well?
Something like "[439]-remap Super_R-Mode_switch" x11vnc option may Something like "[440]-remap Super_R-Mode_switch" x11vnc option may
work. Note that Super_R is the "Right Windoze(tm) Flaggie" key; you 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 may want to choose another. The -debug_keyboard option comes in handy
in finding keysym names (so does xev(1)). in finding keysym names (so does xev(1)).
...@@ -4384,7 +4422,7 @@ ied) ...@@ -4384,7 +4422,7 @@ ied)
Since xmodmap(1) modifies the X server mappings you may not want to do 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 this (because it affects local work on that machine). Something like
the [440]-remap Alt_L-Meta_L to x11vnc may be sufficient for ones the [441]-remap Alt_L-Meta_L to x11vnc may be sufficient for ones
needs, and does not modify the X server environment. Note that you 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 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. better choice if the Super_L key is typically unused in Unix.
...@@ -4395,7 +4433,7 @@ ied) ...@@ -4395,7 +4433,7 @@ ied)
This can be done directly in some X servers using AccessX and 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 Pointer_EnableKeys, but is a bit awkward. It may be more convenient to
have x11vnc do the remapping. This can be done via the [441]-remap have x11vnc do the remapping. This can be done via the [442]-remap
option using the fake "keysyms" Button1, Button2, etc. as the "to" option using the fake "keysyms" Button1, Button2, etc. as the "to"
keys (i.e. the ones after the "-") keys (i.e. the ones after the "-")
...@@ -4404,7 +4442,7 @@ ied) ...@@ -4404,7 +4442,7 @@ ied)
button "paste" because (using XFree86/Xorg Emulate3Buttons) you have button "paste" because (using XFree86/Xorg Emulate3Buttons) you have
to click both buttons on the touch pad at the same time. This to click both buttons on the touch pad at the same time. This
remapping: remapping:
[442]-remap Super_R-Button2 [443]-remap Super_R-Button2
maps the Super_R "flag" key press to the Button2 click, thereby making maps the Super_R "flag" key press to the Button2 click, thereby making
X pasting a bit easier. X pasting a bit easier.
...@@ -4434,7 +4472,7 @@ ied) ...@@ -4434,7 +4472,7 @@ ied)
There may also be scaling viewers out there (e.g. TightVNC or UltraVNC There may also be scaling viewers out there (e.g. TightVNC or UltraVNC
on Windows) that automatically shrink or expand the remote framebuffer on Windows) that automatically shrink or expand the remote framebuffer
to fit the local display. Especially for hand-held devices. See also to fit the local display. Especially for hand-held devices. See also
[443]this FAQ on x11vnc scaling. [444]this FAQ on x11vnc scaling.
Q-75: Does x11vnc support server-side framebuffer scaling? (E.g. to Q-75: Does x11vnc support server-side framebuffer scaling? (E.g. to
...@@ -4442,7 +4480,7 @@ ied) ...@@ -4442,7 +4480,7 @@ ied)
As of Jun/2004 in the libvncserver CVS x11vnc provides basic As of Jun/2004 in the libvncserver CVS x11vnc provides basic
server-side scaling. It is a global scaling of the desktop, not a server-side scaling. It is a global scaling of the desktop, not a
per-client setting. To enable it use the "[444]-scale fraction" per-client setting. To enable it use the "[445]-scale fraction"
option. "fraction" can either be a floating point number (e.g. -scale option. "fraction" can either be a floating point number (e.g. -scale
0.5) or the alternative m/n fraction notation (e.g. -scale 2/3). Note 0.5) or the alternative m/n fraction notation (e.g. -scale 2/3). Note
that if fraction is greater than one the display is magnified. that if fraction is greater than one the display is magnified.
...@@ -4463,7 +4501,7 @@ ied) ...@@ -4463,7 +4501,7 @@ ied)
One can also use the ":nb" with an integer scale factor (say "-scale 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 2:nb") to use x11vnc as a screen magnifier for vision impaired
[445]applications. Since with integer scale factors the framebuffers [446]applications. Since with integer scale factors the framebuffers
become huge and scaling operations time consuming, be sure to use become huge and scaling operations time consuming, be sure to use
":nb" for the fastest response. ":nb" for the fastest response.
...@@ -4489,21 +4527,21 @@ ied) ...@@ -4489,21 +4527,21 @@ ied)
If one desires per-client scaling for something like 1:1 from a 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 workstation and 1:2 from a smaller device (e.g. handheld), currently
the only option is to run two (or more) x11vnc processes with the only option is to run two (or more) x11vnc processes with
different scalings listening on separate ports ([446]-rfbport option, different scalings listening on separate ports ([447]-rfbport option,
etc.). etc.).
BTW, whenever you run two or more x11vnc's on the same X display and BTW, whenever you run two or more x11vnc's on the same X display and
use the [447]GUI, then to avoid all of the x11vnc's simultaneously use the [448]GUI, then to avoid all of the x11vnc's simultaneously
answering the gui you will need to use something like [448]"-connect answering the gui you will need to use something like [449]"-connect
file1 -gui ..." with different connect files for each x11vnc you want file1 -gui ..." with different connect files for each x11vnc you want
to control via the gui (or remote-control). The "-connect file1" usage to control via the gui (or remote-control). The "-connect file1" usage
gives separate communication channels between a x11vnc proces and the gives separate communication channels between a x11vnc proces and the
gui process. Otherwise they all share the same X property channel: gui process. Otherwise they all share the same X property channels:
VNC_CONNECT. VNC_CONNECT and X11VNC_REMOTE.
Update: As of Mar/2005 in the libvncserver CVS x11vnc now scales the Update: As of Mar/2005 in the libvncserver CVS x11vnc now scales the
mouse cursor with the same scale factor as the screen. If you don't mouse cursor with the same scale factor as the screen. If you don't
want that, use the [449]"-scale_cursor frac" option to set the cursor want that, use the [450]"-scale_cursor frac" option to set the cursor
scaling to a different factor (e.g. use "-scale_cursor 1" to keep the scaling to a different factor (e.g. use "-scale_cursor 1" to keep the
cursor at its natural unscaled size). cursor at its natural unscaled size).
...@@ -4525,16 +4563,16 @@ ied) ...@@ -4525,16 +4563,16 @@ ied)
screen is not rectangular (e.g. 1280x1024 and 1024x768 monitors joined screen is not rectangular (e.g. 1280x1024 and 1024x768 monitors joined
together), then there will be "non-existent" areas on the screen. The 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 X server will return "garbage" image data for these areas and so they
may be distracting to the viewer. The [450]-blackout x11vnc option may be distracting to the viewer. The [451]-blackout x11vnc option
allows you to blacken-out rectangles by manually specifying their allows you to blacken-out rectangles by manually specifying their
WxH+X+Y geometries. If your system has the libXinerama library, the WxH+X+Y geometries. If your system has the libXinerama library, the
[451]-xinerama x11vnc option can be used to have it automatically [452]-xinerama x11vnc option can be used to have it automatically
determine the rectangles to be blackened out. (Note on 8bpp determine the rectangles to be blackened out. (Note on 8bpp
PseudoColor displays the fill color may not be black). PseudoColor displays the fill color may not be black).
Some users have reported that the mouse does not behave properly for 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 their Xinerama display: i.e. the mouse cannot be moved to all regions
of the large display. If this happens try using the [452]-xwarppointer of the large display. If this happens try using the [453]-xwarppointer
option. This instructs x11vnc to fake mouse pointer motions using the option. This instructs x11vnc to fake mouse pointer motions using the
XWarpPointer function instead of the XTestFakeMotionEvent XTEST XWarpPointer function instead of the XTestFakeMotionEvent XTEST
function. (This may be due to a bug in the X server for XTEST when function. (This may be due to a bug in the X server for XTEST when
...@@ -4559,23 +4597,23 @@ ied) ...@@ -4559,23 +4597,23 @@ ied)
Note: if you are running on Solaris 8 or earlier you can easily hit up 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 against the maximum of 6 shm segments per process (for Xsun in this
case) from running multiple x11vnc processes. You should modify case) from running multiple x11vnc processes. You should modify
/etc/system as mentioned in another [453]FAQ to increase the limit. It /etc/system as mentioned in another [454]FAQ to increase the limit. It
is probably also a good idea to run with the [454]-onetile option in is probably also a good idea to run with the [455]-onetile option in
this case (to limit each x11vnc to 3 shm segments), or even this case (to limit each x11vnc to 3 shm segments), or even
[455]-noshm to use no shm segments. [456]-noshm to use no shm segments.
Q-78: Can x11vnc show only a portion of the display? (E.g. for a Q-78: Can x11vnc show only a portion of the display? (E.g. for a
special purpose rfb application). special purpose rfb application).
As of Mar/2005 in the libvncserver CVS x11vnc has the "[456]-clip As of Mar/2005 in the libvncserver CVS x11vnc has the "[457]-clip
WxH+X+Y" option to select a rectangle of width W, height H and offset 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 (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 display and be only WxH in size. One user used -clip to split up a
large [457]Xinerama screen into two more managable smaller screens. large [458]Xinerama screen into two more managable smaller screens.
This also works to view a sub-region of a single application window if This also works to view a sub-region of a single application window if
the [458]-id or [459]-sid options are used. The offset is measured the [459]-id or [460]-sid options are used. The offset is measured
from the upper left corner of the selected window. from the upper left corner of the selected window.
...@@ -4584,7 +4622,7 @@ ied) ...@@ -4584,7 +4622,7 @@ ied)
crash. crash.
As of Dec/2004 in the libvncserver CVS x11vnc supports XRANDR. You As of Dec/2004 in the libvncserver CVS x11vnc supports XRANDR. You
enable it with the [460]-xrandr option to make x11vnc monitor XRANDR enable it with the [461]-xrandr option to make x11vnc monitor XRANDR
events and also trap X server errors if the screen change occurred in 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 the middle of an X call like XGetImage. Once it traps the screen
change it will create a new framebuffer using the new screen. change it will create a new framebuffer using the new screen.
...@@ -4594,7 +4632,7 @@ ied) ...@@ -4594,7 +4632,7 @@ ied)
then the viewer will automatically resize. Otherwise, the new then the viewer will automatically resize. Otherwise, the new
framebuffer is fit as best as possible into the original viewer size framebuffer is fit as best as possible into the original viewer size
(portions of the screen may be clipped, unused, etc). For these (portions of the screen may be clipped, unused, etc). For these
viewers you can try the [461]-padgeom option to make the region big viewers you can try the [462]-padgeom option to make the region big
enough to hold all resizes and rotations. enough to hold all resizes and rotations.
If you specify "-xrandr newfbsize" then vnc viewers that do not If you specify "-xrandr newfbsize" then vnc viewers that do not
...@@ -4618,12 +4656,13 @@ ied) ...@@ -4618,12 +4656,13 @@ ied)
in the active VC? in the active VC?
This seems to have to do with how applications (the X server processes This seems to have to do with how applications (the X server processes
in this case) must "play nicely" if they are not on the active VC. in this case) must "play nicely" if they are not on the active VC
That is, they should not read from the keyboard or mouse or manage the (sometimes called VT for virtual terminal). That is, they should not
video display unless they have the active VC. Given that it appears read from the keyboard or mouse or manage the video display unless
the XGetImage() call must ultimately retrieve the framebuffer data they have the active VC. Given that it appears the XGetImage() call
from the video hardware itself, it would make sense x11vnc's polling must ultimately retrieve the framebuffer data from the video hardware
wouldn't work unless the X session had active control of the VC. itself, it would make sense x11vnc's polling wouldn't work unless the
X session had active control of the VC.
There does not seem to be an easy way to work around this. Even xwd(1) There does not seem to be an easy way to work around this. Even xwd(1)
doesn't work in this case (try it). Something would need to be done at doesn't work in this case (try it). Something would need to be done at
...@@ -4648,9 +4687,9 @@ ied) ...@@ -4648,9 +4687,9 @@ ied)
* Fullscreen mode * Fullscreen mode
The way VMWare does Fullscreen mode on Linux is to display the Guest The way VMWare does Fullscreen mode on Linux is to display the Guest
desktop in a separate Virtual Console (e.g. VC 8) (see [462]this FAQ desktop in a separate Virtual Console (e.g. VC 8) (see [463]this FAQ
on VC's for background). Unfortunately, this Fullscreen VC is not an X on VC's for background). Unfortunately, this Fullscreen VC is not an X
server. So x11vnc cannot access it (however, [463]see this for a server. So x11vnc cannot access it (however, [464]see this for a
possible partial workaround). x11vnc works fine with "Normal X possible partial workaround). x11vnc works fine with "Normal X
application window" and "Quick-Switch mode" because these use X. application window" and "Quick-Switch mode" because these use X.
...@@ -4667,13 +4706,13 @@ ied) ...@@ -4667,13 +4706,13 @@ ied)
response. One can also cut the display depth (e.g. to 16bpp) in this response. One can also cut the display depth (e.g. to 16bpp) in this
2nd X session to improve video performance. This 2nd X session 2nd X session to improve video performance. This 2nd X session
emulates Fullscreen mode to some degree and can be viewed via x11vnc emulates Fullscreen mode to some degree and can be viewed via x11vnc
as long as the VMWare X session [464]is in the active VC. as long as the VMWare X session [465]is in the active VC.
Also note that with a little bit of playing with "xwininfo -all Also note that with a little bit of playing with "xwininfo -all
-children" output one can extract the (non-toplevel) windowid of the -children" output one can extract the (non-toplevel) windowid of the
of the Guest desktop only when VMWare is running as a normal X 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 application. Then one can export just the guest desktop (i.e. without
the VMWare menu buttons) by use of the [465]-id windowid option. The the VMWare menu buttons) by use of the [466]-id windowid option. The
caveats are the X session VMWare is in must be in the active VC and 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 the window must be fully visible, so this mode is not terribly
convenient, but could be useful in some circumstances (e.g. running convenient, but could be useful in some circumstances (e.g. running
...@@ -4754,7 +4793,7 @@ ied) ...@@ -4754,7 +4793,7 @@ ied)
screen to either shm or a mapped file. The format of these is XWD and 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 so the initial header should be skipped. BTW, since XWD is not
strictly RGB the view will only be approximate. Of course for the case strictly RGB the view will only be approximate. Of course for the case
of Xvfb x11vnc can poll it much better via the [466]X API, but you get of Xvfb x11vnc can poll it much better via the [467]X API, but you get
the idea. the idea.
By default in -rawfb mode x11vnc will actually close any X display it By default in -rawfb mode x11vnc will actually close any X display it
...@@ -4807,7 +4846,7 @@ ied) ...@@ -4807,7 +4846,7 @@ ied)
keystrokes into the Linux console (e.g. the virtual consoles: keystrokes into the Linux console (e.g. the virtual consoles:
/dev/tty1, /dev/tty2, etc) in x11vnc/misc/vcinject.pl. It is based on /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 the vncterm/LinuxVNC.c program also in the libvncserver CVS. So to
view and interact with VC #2 (assuming it is the [467]active VC) one view and interact with VC #2 (assuming it is the [468]active VC) one
can run something like: can run something like:
x11vnc -rawfb map:/dev/fb0@1024x768x16 -pipeinput './vcinject.pl 2' x11vnc -rawfb map:/dev/fb0@1024x768x16 -pipeinput './vcinject.pl 2'
...@@ -4820,7 +4859,7 @@ ied) ...@@ -4820,7 +4859,7 @@ ied)
more accurate and faster LinuxVNC program. The only advantage x11vnc more accurate and faster LinuxVNC program. The only advantage x11vnc
-rawfb might have is that it can presumably allow interaction with a -rawfb might have is that it can presumably allow interaction with a
non-text application, e.g. one based on svgalib. For example the non-text application, e.g. one based on svgalib. For example the
[468]VMWare Fullscreen mode is actually viewable under -rawfb. But [469]VMWare Fullscreen mode is actually viewable under -rawfb. But
this isn't much use until one figures out how to inject keystrokes and this isn't much use until one figures out how to inject keystrokes and
mouse events... mouse events...
...@@ -4852,10 +4891,10 @@ ied) ...@@ -4852,10 +4891,10 @@ ied)
As of Jan/2004 in the libvncserver CVS x11vnc supports the "CutText" As of Jan/2004 in the libvncserver CVS x11vnc supports the "CutText"
part of the rfb protocol. Furthermore, x11vnc is able to hold the part of the rfb protocol. Furthermore, x11vnc is able to hold the
PRIMARY selection (Xvnc does not seem to do this). If you don't want PRIMARY selection (Xvnc does not seem to do this). If you don't want
the Clipboard/Selection exchanged use the [469]-nosel option. If you the Clipboard/Selection exchanged use the [470]-nosel option. If you
don't want the PRIMARY selection to be polled for changes use the don't want the PRIMARY selection to be polled for changes use the
[470]-noprimary option. You can also fine-tune it a bit with the [471]-noprimary option. You can also fine-tune it a bit with the
[471]-seldir dir option. [472]-seldir dir option.
You may need to watch out for desktop utilities such as KDE's You may need to watch out for desktop utilities such as KDE's
"Klipper" that do odd things with the selection, clipboard, and "Klipper" that do odd things with the selection, clipboard, and
...@@ -4867,7 +4906,7 @@ ied) ...@@ -4867,7 +4906,7 @@ ied)
As of Oct/2005 x11vnc enables the TightVNC file transfer As of Oct/2005 x11vnc enables the TightVNC file transfer
implementation that was added to libvncserver. This currently only implementation that was added to libvncserver. This currently only
works with TightVNC viewers (and Windows only it appears). It is on by works with TightVNC viewers (and Windows only it appears). It is on by
default, to disable it use the [472]-nofilexfer option. default, to disable it use the [473]-nofilexfer option.
Q-87: Why don't I hear the "Beeps" in my X session (e.g. when typing Q-87: Why don't I hear the "Beeps" in my X session (e.g. when typing
...@@ -4878,7 +4917,7 @@ ied) ...@@ -4878,7 +4917,7 @@ ied)
not on by default in Solaris, see Xserver(1) for how to turn it on via not on by default 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. +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 [473]-nobell option. If If you don't want to hear the beeps use the [474]-nobell option. If
you want to hear the audio from the remote applications, consider you want to hear the audio from the remote applications, consider
trying a redirector such as esd. trying a redirector such as esd.
...@@ -5232,144 +5271,145 @@ References ...@@ -5232,144 +5271,145 @@ References
333. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-httpdir 333. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-httpdir
334. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-http 334. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-http
335. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-connect 335. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-connect
336. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-vncconnect 336. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-remote
337. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-add_keysyms 337. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-vncconnect
338. http://www.karlrunge.com/x11vnc/index.html#faq-linuxvc 338. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-add_keysyms
339. http://www.karlrunge.com/x11vnc/Xdummy 339. http://www.karlrunge.com/x11vnc/index.html#faq-linuxvc
340. http://www.karlrunge.com/x11vnc/index.html#display-manager-continuously 340. http://www.karlrunge.com/x11vnc/Xdummy
341. http://www.karlrunge.com/x11vnc/shm_clear 341. http://www.karlrunge.com/x11vnc/index.html#display-manager-continuously
342. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-onetile 342. http://www.karlrunge.com/x11vnc/shm_clear
343. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-noshm 343. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-onetile
344. http://www.karlrunge.com/x11vnc/index.html#faq-noshm 344. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-noshm
345. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-nap 345. http://www.karlrunge.com/x11vnc/index.html#faq-noshm
346. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-wait 346. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-nap
347. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-onetile 347. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-wait
348. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-fs 348. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-onetile
349. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-threads 349. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-fs
350. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-defer 350. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-threads
351. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-id 351. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-defer
352. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-solid 352. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-id
353. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-scrollcopyrect 353. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-solid
354. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-wireframe 354. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-scrollcopyrect
355. http://www.tightvnc.com/ 355. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-wireframe
356. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-nodragging 356. http://www.tightvnc.com/
357. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-wireframe 357. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-nodragging
358. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-scrollcopyrect 358. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-wireframe
359. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-fs 359. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-scrollcopyrect
360. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-wait 360. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-fs
361. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-defer 361. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-wait
362. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-progressive 362. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-defer
363. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-id 363. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-progressive
364. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-nosel 364. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-id
365. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-nocursor 365. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-nosel
366. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-nocursorpos 366. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-nocursor
367. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-readtimeout 367. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-nocursorpos
368. http://www.karlrunge.com/x11vnc/index.html#fb_read_slow 368. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-readtimeout
369. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-xd_area 369. http://www.karlrunge.com/x11vnc/index.html#fb_read_slow
370. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-xd_mem 370. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-xd_area
371. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-noxdamage 371. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-xd_mem
372. http://www.karlrunge.com/x11vnc/index.html#fb_read_slow 372. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-noxdamage
373. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-pointer_mode 373. http://www.karlrunge.com/x11vnc/index.html#fb_read_slow
374. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-pointer_mode 374. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-pointer_mode
375. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-nodragging 375. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-pointer_mode
376. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-pointer_mode 376. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-nodragging
377. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-threads 377. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-pointer_mode
378. http://www.karlrunge.com/x11vnc/index.html#faq-wireframe 378. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-threads
379. http://www.karlrunge.com/x11vnc/index.html#faq-scrollcopyrect 379. http://www.karlrunge.com/x11vnc/index.html#faq-wireframe
380. http://www.karlrunge.com/x11vnc/index.html#faq-pointer-mode 380. http://www.karlrunge.com/x11vnc/index.html#faq-scrollcopyrect
381. http://www.karlrunge.com/x11vnc/index.html#fb_read_slow 381. http://www.karlrunge.com/x11vnc/index.html#faq-pointer-mode
382. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-wireframe 382. http://www.karlrunge.com/x11vnc/index.html#fb_read_slow
383. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-wireframe 383. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-wireframe
384. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-wireframe 384. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-wireframe
385. http://www.karlrunge.com/x11vnc/index.html#fb_read_slow 385. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-wireframe
386. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-scrollcopyrect 386. http://www.karlrunge.com/x11vnc/index.html#fb_read_slow
387. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-wireframe 387. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-scrollcopyrect
388. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-wirecopyrect 388. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-wireframe
389. http://www.karlrunge.com/x11vnc/index.html#faq-wireframe 389. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-wirecopyrect
390. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-fixscreen 390. http://www.karlrunge.com/x11vnc/index.html#faq-wireframe
391. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-scr_skip 391. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-fixscreen
392. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-scale 392. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-scr_skip
393. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-scrollcopyrect 393. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-scale
394. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-cursor 394. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-scrollcopyrect
395. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-cursor 395. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-cursor
396. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-overlay 396. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-cursor
397. http://www.karlrunge.com/x11vnc/index.html#the-overlay-mode 397. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-overlay
398. http://www.karlrunge.com/x11vnc/index.html#solaris10-build 398. http://www.karlrunge.com/x11vnc/index.html#the-overlay-mode
399. http://www.karlrunge.com/x11vnc/index.html#faq-xfixes-alpha-hacks 399. http://www.karlrunge.com/x11vnc/index.html#solaris10-build
400. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-alphacut 400. http://www.karlrunge.com/x11vnc/index.html#faq-xfixes-alpha-hacks
401. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-alphafrac 401. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-alphacut
402. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-alpharemove 402. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-alphafrac
403. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-nocursorshape 403. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-alpharemove
404. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-noalphablend 404. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-nocursorshape
405. http://www.tightvnc.com/ 405. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-noalphablend
406. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-nocursor 406. http://www.tightvnc.com/
407. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-cursorpos 407. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-nocursor
408. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-nocursorpos 408. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-cursorpos
409. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-nocursorshape 409. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-nocursorpos
410. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-buttonmap 410. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-nocursorshape
411. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-debug_pointer 411. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-buttonmap
412. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-buttonmap 412. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-debug_pointer
413. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-modtweak 413. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-buttonmap
414. http://www.karlrunge.com/x11vnc/index.html#faq-greaterless 414. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-modtweak
415. http://www.karlrunge.com/x11vnc/index.html#faq-xkbmodtweak 415. http://www.karlrunge.com/x11vnc/index.html#faq-greaterless
416. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-debug_keyboard 416. http://www.karlrunge.com/x11vnc/index.html#faq-xkbmodtweak
417. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-xkb 417. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-debug_keyboard
418. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-sloppy_keys 418. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-xkb
419. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-modtweak 419. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-sloppy_keys
420. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-modtweak 420. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-modtweak
421. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-remap 421. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-modtweak
422. http://www.karlrunge.com/x11vnc/index.html#faq-xkbmodtweak 422. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-remap
423. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-debug_keyboard 423. http://www.karlrunge.com/x11vnc/index.html#faq-xkbmodtweak
424. http://www.karlrunge.com/x11vnc/index.html#faq-greaterless 424. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-debug_keyboard
425. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-xkb 425. http://www.karlrunge.com/x11vnc/index.html#faq-greaterless
426. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-sloppy_keys 426. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-xkb
427. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-modtweak 427. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-sloppy_keys
428. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-xkb 428. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-modtweak
429. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-xkb 429. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-xkb
430. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-skip_keycodes 430. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-xkb
431. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-remap 431. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-skip_keycodes
432. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-add_keysyms 432. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-remap
433. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-remap 433. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-add_keysyms
434. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-remap 434. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-remap
435. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-add_keysyms 435. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-remap
436. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-norepeat 436. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-add_keysyms
437. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-norepeat 437. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-norepeat
438. http://www.karlrunge.com/x11vnc/index.html#faq-display-manager 438. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-norepeat
439. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-remap 439. http://www.karlrunge.com/x11vnc/index.html#faq-display-manager
440. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-remap 440. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-remap
441. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-remap 441. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-remap
442. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-remap 442. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-remap
443. http://www.karlrunge.com/x11vnc/index.html#faq-scaling 443. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-remap
444. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-scale 444. http://www.karlrunge.com/x11vnc/index.html#faq-scaling
445. http://www.cus.cam.ac.uk/~ssb22/source/vnc-magnification.html 445. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-scale
446. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-rfbport 446. http://www.cus.cam.ac.uk/~ssb22/source/vnc-magnification.html
447. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-gui 447. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-rfbport
448. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-connect 448. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-gui
449. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-scale_cursor 449. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-connect
450. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-blackout 450. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-scale_cursor
451. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-xinerama 451. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-blackout
452. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-xwarppointer 452. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-xinerama
453. http://www.karlrunge.com/x11vnc/index.html#faq-solshm 453. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-xwarppointer
454. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-onetile 454. http://www.karlrunge.com/x11vnc/index.html#faq-solshm
455. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-noshm 455. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-onetile
456. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-clip 456. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-noshm
457. http://www.karlrunge.com/x11vnc/index.html#faq-xinerama 457. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-clip
458. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-id 458. http://www.karlrunge.com/x11vnc/index.html#faq-xinerama
459. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-id 459. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-id
460. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-xrandr 460. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-id
461. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-padgeom 461. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-xrandr
462. http://www.karlrunge.com/x11vnc/index.html#faq-linuxvc 462. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-padgeom
463. http://www.karlrunge.com/x11vnc/index.html#faq-rawfb 463. http://www.karlrunge.com/x11vnc/index.html#faq-linuxvc
464. http://www.karlrunge.com/x11vnc/index.html#faq-linuxvc 464. http://www.karlrunge.com/x11vnc/index.html#faq-rawfb
465. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-id 465. http://www.karlrunge.com/x11vnc/index.html#faq-linuxvc
466. http://www.karlrunge.com/x11vnc/index.html#faq-xvfb 466. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-id
467. http://www.karlrunge.com/x11vnc/index.html#faq-linuxvc 467. http://www.karlrunge.com/x11vnc/index.html#faq-xvfb
468. http://www.karlrunge.com/x11vnc/index.html#faq-vmware 468. http://www.karlrunge.com/x11vnc/index.html#faq-linuxvc
469. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-nosel 469. http://www.karlrunge.com/x11vnc/index.html#faq-vmware
470. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-noprimary 470. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-nosel
471. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-seldir 471. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-noprimary
472. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-nofilexfer 472. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-seldir
473. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-nobell 473. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-nofilexfer
474. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-nobell
======================================================================= =======================================================================
...@@ -5382,7 +5422,7 @@ x11vnc: a VNC server for real X displays ...@@ -5382,7 +5422,7 @@ x11vnc: a VNC server for real X displays
Here are all of x11vnc command line options: Here are all of x11vnc command line options:
% x11vnc -opts (see below for -help long descriptions) % x11vnc -opts (see below for -help long descriptions)
x11vnc: allow VNC connections to real X11 displays. 0.8.1 lastmod: 2006-03-06 x11vnc: allow VNC connections to real X11 displays. 0.8.1 lastmod: 2006-03-08
x11vnc options: x11vnc options:
-display disp -auth file -display disp -auth file
...@@ -5403,28 +5443,30 @@ x11vnc options: ...@@ -5403,28 +5443,30 @@ x11vnc options:
-viewpasswd string -passwdfile filename -viewpasswd string -passwdfile filename
-unixpw [list] -unixpw_nis [list] -unixpw [list] -unixpw_nis [list]
-stunnel [pem] -stunnel3 [pem] -stunnel [pem] -stunnel3 [pem]
-nopw -storepasswd pass file -usepw -storepasswd pass file
-accept string -afteraccept string -nopw -accept string
-gone string -users list -afteraccept string -gone string
-noshm -flipbyteorder -users list -noshm
-onetile -solid [color] -flipbyteorder -onetile
-blackout string -xinerama -solid [color] -blackout string
-xtrap -xrandr [mode] -xinerama -xtrap
-padgeom WxH -o logfile -xrandr [mode] -padgeom WxH
-flag file -rc filename -o logfile -flag file
-norc -h, -help -rc filename -norc
-?, -opts -V, -version -h, -help -?, -opts
-dbg -q -V, -version -dbg
-bg -modtweak -q -bg
-nomodtweak -xkb -modtweak -nomodtweak
-noxkb -skip_keycodes string -xkb -noxkb
-sloppy_keys -skip_dups -skip_keycodes string -sloppy_keys
-noskip_dups -add_keysyms -skip_dups -noskip_dups
-noadd_keysyms -clear_mods -add_keysyms -noadd_keysyms
-clear_keys -remap string -clear_mods -clear_keys
-norepeat -repeat -remap string -norepeat
-nofb -nobell -repeat -nofb
-nosel -noprimary -nobell -nosel
-noprimary -nosetprimary
-noclipboard -nosetclipboard
-seldir string -cursor [mode] -seldir string -cursor [mode]
-nocursor -arrow n -nocursor -arrow n
-noxfixes -alphacut n -noxfixes -alphacut n
...@@ -5442,28 +5484,28 @@ x11vnc options: ...@@ -5442,28 +5484,28 @@ x11vnc options:
-scr_parms string -fixscreen string -scr_parms string -fixscreen string
-debug_scroll -noxrecord -debug_scroll -noxrecord
-grab_buster -nograb_buster -grab_buster -nograb_buster
-debug_grabs -pointer_mode n -debug_grabs -debug_sel
-input_skip n -speeds rd,bw,lat -pointer_mode n -input_skip n
-wmdt string -debug_pointer -speeds rd,bw,lat -wmdt string
-debug_keyboard -defer time -debug_pointer -debug_keyboard
-wait time -wait_ui factor -defer time -wait time
-nowait_bog -slow_fb time -wait_ui factor -nowait_bog
-readtimeout n -nap -slow_fb time -readtimeout n
-nonap -sb time -nap -nonap
-noxdamage -xd_area A -sb time -noxdamage
-xd_mem f -sigpipe string -xd_area A -xd_mem f
-threads -nothreads -sigpipe string -threads
-fs f -gaps n -nothreads -fs f
-grow n -fuzz n -gaps n -grow n
-debug_tiles -snapfb -fuzz n -debug_tiles
-rawfb string -pipeinput cmd -snapfb -rawfb string
-gui [gui-opts] -remote command -pipeinput cmd -gui [gui-opts]
-query variable -QD variable -remote command -query variable
-sync -noremote -QD variable -sync
-yesremote -unsafe -noremote -yesremote
-safer -privremote -unsafe -safer
-nocmds -deny_all -privremote -nocmds
-deny_all
libvncserver options: libvncserver options:
-rfbport port TCP port for RFB protocol -rfbport port TCP port for RFB protocol
...@@ -5495,7 +5537,7 @@ libvncserver-tight-extension options: ...@@ -5495,7 +5537,7 @@ libvncserver-tight-extension options:
% x11vnc -help % x11vnc -help
x11vnc: allow VNC connections to real X11 displays. 0.8.1 lastmod: 2006-03-06 x11vnc: allow VNC connections to real X11 displays. 0.8.1 lastmod: 2006-03-08
Typical usage is: Typical usage is:
...@@ -5784,11 +5826,19 @@ Options: ...@@ -5784,11 +5826,19 @@ Options:
the connection is made once at startup. Use commas the connection is made once at startup. Use commas
for a list of host's and host:port's. for a list of host's and host:port's.
Note that unlike most vnc servers, x11vnc will require a
password for reverse as well as for forward connections.
(provided password auth has been enabled, -rfbauth, etc)
If you do not want to require a password for reverse
connections set X11VNC_REVERSE_CONNECTION_NO_AUTH=1 in
your environment before starting x11vnc.
If "string" contains "/" it is instead interpreted If "string" contains "/" it is instead interpreted
as a file to periodically check for new hosts. as a file to periodically check for new hosts.
The first line is read and then the file is truncated. The first line is read and then the file is truncated.
Be careful for this usage mode if x11vnc is running as Be careful for this usage mode if x11vnc is running as
root (e.g. via gdm(1), etc). root (e.g. via gdm(1), etc).
-vncconnect Monitor the VNC_CONNECT X property set by the standard -vncconnect Monitor the VNC_CONNECT X property set by the standard
-novncconnect VNC program vncconnect(1). When the property is -novncconnect VNC program vncconnect(1). When the property is
set to "host" or "host:port" establish a reverse set to "host" or "host:port" establish a reverse
...@@ -5985,10 +6035,11 @@ Options: ...@@ -5985,10 +6035,11 @@ Options:
be inaccessible unless run as root. This is called be inaccessible unless run as root. This is called
"NIS" mode simply because in most NIS setups the "NIS" mode simply because in most NIS setups the
user encrypted passwords are accessible (e.g. "ypcat user encrypted passwords are accessible (e.g. "ypcat
passwd"). NIS is not required for this mode to passwd"). NIS is not required for this mode to work
work, but it is unlikely it will work for any other (only that getpwnam(3) return the encrpyted password
environment. All of the -unixpw options and contraints is required), but it is unlikely it will work for any
apply. other environment. All of the -unixpw options and
contraints apply.
-stunnel [pem] Use the stunnel(1) (www.stunnel.org) to provide -stunnel [pem] Use the stunnel(1) (www.stunnel.org) to provide
an encrypted SSL tunnel between viewers and x11vnc. an encrypted SSL tunnel between viewers and x11vnc.
...@@ -6029,12 +6080,28 @@ Options: ...@@ -6029,12 +6080,28 @@ Options:
-stunnel3 [pem] Use version 3.x stunnel command line syntax instead of -stunnel3 [pem] Use version 3.x stunnel command line syntax instead of
version 4.x version 4.x
-nopw Disable the big warning message when you use x11vnc -usepw If no other password method was supplied on the command
without some sort of password. line, first look for ~/.vnc/passwd and if found use it
with -rfbauth; next, look for ~/.vnc/passwdfile and
use it with -passwdfile; otherwise, prompt the user
for a password to create ~/.vnc/passwd and use it with
the -rfbauth option. If none of these succeed x11vnc
exits immediately.
Note: -unixpw currently does not count as a password
method by this option.
-storepasswd pass file Store password "pass" as the VNC password in the -storepasswd pass file Store password "pass" as the VNC password in the
file "file". Once the password is stored the file "file". Once the password is stored the
program exits. Use the password via "-rfbauth file" program exits. Use the password via "-rfbauth file"
If called with no arguments, i.e., "-storepasswd",
the user is prompted for a password and it is stored
in the file ~/.vnc/passwd
-nopw Disable the big warning message when you use x11vnc
without some sort of password.
-accept string Run a command (possibly to prompt the user at the -accept string Run a command (possibly to prompt the user at the
X11 display) to decide whether an incoming client X11 display) to decide whether an incoming client
should be allowed to connect or not. "string" is should be allowed to connect or not. "string" is
...@@ -6416,10 +6483,17 @@ Options: ...@@ -6416,10 +6483,17 @@ Options:
-nobell Do not watch for XBell events. (no beeps will be heard) -nobell Do not watch for XBell events. (no beeps will be heard)
Note: XBell monitoring requires the XKEYBOARD extension. Note: XBell monitoring requires the XKEYBOARD extension.
-nosel Do not manage exchange of X selection/cutbuffer between -nosel Do not manage exchange of X selection/cutbuffer between
VNC viewers and the X server. VNC viewers and the X server at all.
-noprimary Do not poll the PRIMARY selection for changes to send -noprimary Do not poll the PRIMARY selection for changes to send
back to clients. (PRIMARY is still set on received back to clients. (PRIMARY is still set on received
changes, however). changes, however).
-nosetprimary Do not set the PRIMARY selection for changes received
from VNC clients.
-noclipboard Do not poll the CLIPBOARD selection for changes to send
back to clients. (CLIPBOARD is still set on received
changes, however).
-nosetclipboard Do not set the CLIPBOARD selection for changes
received from VNC clients.
-seldir string If direction string is "send", only send the selection -seldir string If direction string is "send", only send the selection
to viewers, and if it is "recv" only receive it from to viewers, and if it is "recv" only receive it from
viewers. To work around apps setting the selection viewers. To work around apps setting the selection
...@@ -6899,6 +6973,9 @@ Options: ...@@ -6899,6 +6973,9 @@ Options:
-debug_grabs Turn on debugging info printout with respect to -debug_grabs Turn on debugging info printout with respect to
XGrabServer() deadlock for -scrollcopyrect mode. XGrabServer() deadlock for -scrollcopyrect mode.
-debug_sel Turn on debugging info printout with respect to
PRIMARY, CLIPBOARD, and CUTBUFFER0 selections.
-pointer_mode n Various pointer motion update schemes. "-pm" is -pointer_mode n Various pointer motion update schemes. "-pm" is
an alias. The problem is pointer motion can cause an alias. The problem is pointer motion can cause
rapid changes on the screen: consider the rapid rapid changes on the screen: consider the rapid
...@@ -7320,7 +7397,9 @@ n ...@@ -7320,7 +7397,9 @@ n
nodeny allow new connections, same as "unlock" nodeny allow new connections, same as "unlock"
connect:host do reverse connection to host, "host" connect:host do reverse connection to host, "host"
may be a comma separated list of hosts may be a comma separated list of hosts
or host:ports. See -connect. or host:ports. See -connect. Passwords
required as with fwd connections.
See X11VNC_REVERSE_CONNECTION_NO_AUTH=1
disconnect:host disconnect any clients from "host" disconnect:host disconnect any clients from "host"
same as "close:host". Use host same as "close:host". Use host
"all" to close all current clients. "all" to close all current clients.
...@@ -7406,6 +7485,12 @@ n ...@@ -7406,6 +7485,12 @@ n
sel disable -nosel mode. sel disable -nosel mode.
noprimary enable -noprimary mode. noprimary enable -noprimary mode.
primary disable -noprimary mode. primary disable -noprimary mode.
nosetprimary enable -nosetprimary mode.
setprimary disable -nosetprimary mode.
noclipboard enable -noclipboard mode.
clipboard disable -noclipboard mode.
nosetclipboard enable -nosetclipboard mode.
setclipboard disable -nosetclipboard mode.
seldir:str set -seldir to "str" seldir:str set -seldir to "str"
cursor:mode enable -cursor "mode". cursor:mode enable -cursor "mode".
show_cursor enable showing a cursor. show_cursor enable showing a cursor.
...@@ -7508,6 +7593,8 @@ n ...@@ -7508,6 +7593,8 @@ n
nodebug_tiles disable -debug_tiles nodebug_tiles disable -debug_tiles
debug_grabs enable -debug_grabs debug_grabs enable -debug_grabs
nodebug_grabs disable -debug_grabs nodebug_grabs disable -debug_grabs
debug_sel enable -debug_sel
nodebug_sel disable -debug_sel
dbg enable -dbg crash shell dbg enable -dbg crash shell
nodbg disable -dbg crash shell nodbg disable -dbg crash shell
...@@ -7561,17 +7648,19 @@ n ...@@ -7561,17 +7648,19 @@ n
nofilexfer deny lock nodeny unlock connect allowonce nofilexfer deny lock nodeny unlock connect allowonce
allow localhost nolocalhost listen lookup nolookup allow localhost nolocalhost listen lookup nolookup
accept afteraccept gone shm noshm flipbyteorder accept afteraccept gone shm noshm flipbyteorder
noflipbyteorder onetile noonetile solid_color solid noflipbyteorder onetile noonetile solid_color
nosolid blackout xinerama noxinerama xtrap noxtrap solid nosolid blackout xinerama noxinerama xtrap
xrandr noxrandr xrandr_mode padgeom quiet q noquiet noxtrap xrandr noxrandr xrandr_mode padgeom quiet q
modtweak nomodtweak xkb noxkb skip_keycodes sloppy_keys noquiet modtweak nomodtweak xkb noxkb skip_keycodes
nosloppy_keys skip_dups noskip_dups add_keysyms sloppy_keys nosloppy_keys skip_dups noskip_dups
noadd_keysyms clear_mods noclear_mods clear_keys add_keysyms noadd_keysyms clear_mods noclear_mods
noclear_keys remap repeat norepeat fb nofb bell clear_keys noclear_keys remap repeat norepeat fb nofb
nobell sel nosel primary noprimary seldir cursorshape bell nobell sel nosel primary noprimary setprimary
nocursorshape cursorpos nocursorpos cursor show_cursor nosetprimary clipboard noclipboard setclipboard
noshow_cursor nocursor arrow xfixes noxfixes xdamage nosetclipboard seldir cursorshape nocursorshape
noxdamage xd_area xd_mem alphacut alphafrac alpharemove cursorpos nocursorpos cursor show_cursor noshow_cursor
nocursor arrow xfixes noxfixes xdamage noxdamage
xd_area xd_mem alphacut alphafrac alpharemove
noalpharemove alphablend noalphablend xwarppointer noalpharemove alphablend noalphablend xwarppointer
xwarp noxwarppointer noxwarp buttonmap dragging xwarp noxwarppointer noxwarp buttonmap dragging
nodragging wireframe_mode wireframe wf nowireframe nodragging wireframe_mode wireframe wf nowireframe
......
...@@ -1491,6 +1491,12 @@ static int do_reverse_connect(char *str) { ...@@ -1491,6 +1491,12 @@ static int do_reverse_connect(char *str) {
return 0; return 0;
} else { } else {
rfbLog("reverse_connect: %s/%s OK\n", str, cl->host); rfbLog("reverse_connect: %s/%s OK\n", str, cl->host);
/* let's see if anyone complains: */
if (! getenv("X11VNC_REVERSE_CONNECTION_NO_AUTH")) {
rfbLog("reverse_connect: turning on auth for %s\n",
cl->host);
cl->reverseConnection = FALSE;
}
return 1; return 1;
} }
} }
......
...@@ -306,11 +306,19 @@ void print_help(int mode) { ...@@ -306,11 +306,19 @@ void print_help(int mode) {
" the connection is made once at startup. Use commas\n" " the connection is made once at startup. Use commas\n"
" for a list of host's and host:port's.\n" " for a list of host's and host:port's.\n"
"\n" "\n"
" Note that unlike most vnc servers, x11vnc will require a\n"
" password for reverse as well as for forward connections.\n"
" (provided password auth has been enabled, -rfbauth, etc)\n"
" If you do not want to require a password for reverse\n"
" connections set X11VNC_REVERSE_CONNECTION_NO_AUTH=1 in\n"
" your environment before starting x11vnc.\n"
"\n"
" If \"string\" contains \"/\" it is instead interpreted\n" " If \"string\" contains \"/\" it is instead interpreted\n"
" as a file to periodically check for new hosts.\n" " as a file to periodically check for new hosts.\n"
" The first line is read and then the file is truncated.\n" " The first line is read and then the file is truncated.\n"
" Be careful for this usage mode if x11vnc is running as\n" " Be careful for this usage mode if x11vnc is running as\n"
" root (e.g. via gdm(1), etc).\n" " root (e.g. via gdm(1), etc).\n"
"\n"
"-vncconnect Monitor the VNC_CONNECT X property set by the standard\n" "-vncconnect Monitor the VNC_CONNECT X property set by the standard\n"
"-novncconnect VNC program vncconnect(1). When the property is\n" "-novncconnect VNC program vncconnect(1). When the property is\n"
" set to \"host\" or \"host:port\" establish a reverse\n" " set to \"host\" or \"host:port\" establish a reverse\n"
...@@ -507,10 +515,11 @@ void print_help(int mode) { ...@@ -507,10 +515,11 @@ void print_help(int mode) {
" be inaccessible unless run as root. This is called\n" " be inaccessible unless run as root. This is called\n"
" \"NIS\" mode simply because in most NIS setups the\n" " \"NIS\" mode simply because in most NIS setups the\n"
" user encrypted passwords are accessible (e.g. \"ypcat\n" " user encrypted passwords are accessible (e.g. \"ypcat\n"
" passwd\"). NIS is not required for this mode to\n" " passwd\"). NIS is not required for this mode to work\n"
" work, but it is unlikely it will work for any other\n" " (only that getpwnam(3) return the encrpyted password\n"
" environment. All of the -unixpw options and contraints\n" " is required), but it is unlikely it will work for any\n"
" apply.\n" " other environment. All of the -unixpw options and\n"
" contraints apply.\n"
"\n" "\n"
"-stunnel [pem] Use the stunnel(1) (www.stunnel.org) to provide\n" "-stunnel [pem] Use the stunnel(1) (www.stunnel.org) to provide\n"
" an encrypted SSL tunnel between viewers and x11vnc.\n" " an encrypted SSL tunnel between viewers and x11vnc.\n"
...@@ -551,12 +560,28 @@ void print_help(int mode) { ...@@ -551,12 +560,28 @@ void print_help(int mode) {
"-stunnel3 [pem] Use version 3.x stunnel command line syntax instead of\n" "-stunnel3 [pem] Use version 3.x stunnel command line syntax instead of\n"
" version 4.x\n" " version 4.x\n"
"\n" "\n"
"-nopw Disable the big warning message when you use x11vnc\n" "-usepw If no other password method was supplied on the command\n"
" without some sort of password.\n" " line, first look for ~/.vnc/passwd and if found use it\n"
" with -rfbauth; next, look for ~/.vnc/passwdfile and\n"
" use it with -passwdfile; otherwise, prompt the user\n"
" for a password to create ~/.vnc/passwd and use it with\n"
" the -rfbauth option. If none of these succeed x11vnc\n"
" exits immediately.\n"
"\n"
" Note: -unixpw currently does not count as a password\n"
" method by this option.\n"
"\n"
"-storepasswd pass file Store password \"pass\" as the VNC password in the\n" "-storepasswd pass file Store password \"pass\" as the VNC password in the\n"
" file \"file\". Once the password is stored the\n" " file \"file\". Once the password is stored the\n"
" program exits. Use the password via \"-rfbauth file\"\n" " program exits. Use the password via \"-rfbauth file\"\n"
"\n" "\n"
" If called with no arguments, i.e., \"-storepasswd\",\n"
" the user is prompted for a password and it is stored\n"
" in the file ~/.vnc/passwd\n"
"\n"
"-nopw Disable the big warning message when you use x11vnc\n"
" without some sort of password.\n"
"\n"
"-accept string Run a command (possibly to prompt the user at the\n" "-accept string Run a command (possibly to prompt the user at the\n"
" X11 display) to decide whether an incoming client\n" " X11 display) to decide whether an incoming client\n"
" should be allowed to connect or not. \"string\" is\n" " should be allowed to connect or not. \"string\" is\n"
...@@ -946,10 +971,17 @@ void print_help(int mode) { ...@@ -946,10 +971,17 @@ void print_help(int mode) {
"-nobell Do not watch for XBell events. (no beeps will be heard)\n" "-nobell Do not watch for XBell events. (no beeps will be heard)\n"
" Note: XBell monitoring requires the XKEYBOARD extension.\n" " Note: XBell monitoring requires the XKEYBOARD extension.\n"
"-nosel Do not manage exchange of X selection/cutbuffer between\n" "-nosel Do not manage exchange of X selection/cutbuffer between\n"
" VNC viewers and the X server.\n" " VNC viewers and the X server at all.\n"
"-noprimary Do not poll the PRIMARY selection for changes to send\n" "-noprimary Do not poll the PRIMARY selection for changes to send\n"
" back to clients. (PRIMARY is still set on received\n" " back to clients. (PRIMARY is still set on received\n"
" changes, however).\n" " changes, however).\n"
"-nosetprimary Do not set the PRIMARY selection for changes received\n"
" from VNC clients.\n"
"-noclipboard Do not poll the CLIPBOARD selection for changes to send\n"
" back to clients. (CLIPBOARD is still set on received\n"
" changes, however).\n"
"-nosetclipboard Do not set the CLIPBOARD selection for changes\n"
" received from VNC clients.\n"
"-seldir string If direction string is \"send\", only send the selection\n" "-seldir string If direction string is \"send\", only send the selection\n"
" to viewers, and if it is \"recv\" only receive it from\n" " to viewers, and if it is \"recv\" only receive it from\n"
" viewers. To work around apps setting the selection\n" " viewers. To work around apps setting the selection\n"
...@@ -1429,6 +1461,9 @@ void print_help(int mode) { ...@@ -1429,6 +1461,9 @@ void print_help(int mode) {
"-debug_grabs Turn on debugging info printout with respect to\n" "-debug_grabs Turn on debugging info printout with respect to\n"
" XGrabServer() deadlock for -scrollcopyrect mode.\n" " XGrabServer() deadlock for -scrollcopyrect mode.\n"
"\n" "\n"
"-debug_sel Turn on debugging info printout with respect to\n"
" PRIMARY, CLIPBOARD, and CUTBUFFER0 selections.\n"
"\n"
"-pointer_mode n Various pointer motion update schemes. \"-pm\" is\n" "-pointer_mode n Various pointer motion update schemes. \"-pm\" is\n"
" an alias. The problem is pointer motion can cause\n" " an alias. The problem is pointer motion can cause\n"
" rapid changes on the screen: consider the rapid\n" " rapid changes on the screen: consider the rapid\n"
...@@ -1853,7 +1888,9 @@ void print_help(int mode) { ...@@ -1853,7 +1888,9 @@ void print_help(int mode) {
/* access, filename */ /* access, filename */
" connect:host do reverse connection to host, \"host\"\n" " connect:host do reverse connection to host, \"host\"\n"
" may be a comma separated list of hosts\n" " may be a comma separated list of hosts\n"
" or host:ports. See -connect.\n" " or host:ports. See -connect. Passwords\n"
" required as with fwd connections.\n"
" See X11VNC_REVERSE_CONNECTION_NO_AUTH=1\n"
" disconnect:host disconnect any clients from \"host\"\n" " disconnect:host disconnect any clients from \"host\"\n"
" same as \"close:host\". Use host\n" " same as \"close:host\". Use host\n"
" \"all\" to close all current clients.\n" " \"all\" to close all current clients.\n"
...@@ -1944,6 +1981,12 @@ void print_help(int mode) { ...@@ -1944,6 +1981,12 @@ void print_help(int mode) {
" sel disable -nosel mode.\n" " sel disable -nosel mode.\n"
" noprimary enable -noprimary mode.\n" " noprimary enable -noprimary mode.\n"
" primary disable -noprimary mode.\n" " primary disable -noprimary mode.\n"
" nosetprimary enable -nosetprimary mode.\n"
" setprimary disable -nosetprimary mode.\n"
" noclipboard enable -noclipboard mode.\n"
" clipboard disable -noclipboard mode.\n"
" nosetclipboard enable -nosetclipboard mode.\n"
" setclipboard disable -nosetclipboard mode.\n"
" seldir:str set -seldir to \"str\"\n" " seldir:str set -seldir to \"str\"\n"
" cursor:mode enable -cursor \"mode\".\n" " cursor:mode enable -cursor \"mode\".\n"
" show_cursor enable showing a cursor.\n" " show_cursor enable showing a cursor.\n"
...@@ -2044,6 +2087,8 @@ void print_help(int mode) { ...@@ -2044,6 +2087,8 @@ void print_help(int mode) {
" nodebug_tiles disable -debug_tiles\n" " nodebug_tiles disable -debug_tiles\n"
" debug_grabs enable -debug_grabs\n" " debug_grabs enable -debug_grabs\n"
" nodebug_grabs disable -debug_grabs\n" " nodebug_grabs disable -debug_grabs\n"
" debug_sel enable -debug_sel\n"
" nodebug_sel disable -debug_sel\n"
" dbg enable -dbg crash shell\n" " dbg enable -dbg crash shell\n"
" nodbg disable -dbg crash shell\n" " nodbg disable -dbg crash shell\n"
"\n" "\n"
...@@ -2097,17 +2142,19 @@ void print_help(int mode) { ...@@ -2097,17 +2142,19 @@ void print_help(int mode) {
" nofilexfer deny lock nodeny unlock connect allowonce\n" " nofilexfer deny lock nodeny unlock connect allowonce\n"
" allow localhost nolocalhost listen lookup nolookup\n" " allow localhost nolocalhost listen lookup nolookup\n"
" accept afteraccept gone shm noshm flipbyteorder\n" " accept afteraccept gone shm noshm flipbyteorder\n"
" noflipbyteorder onetile noonetile solid_color solid\n" " noflipbyteorder onetile noonetile solid_color\n"
" nosolid blackout xinerama noxinerama xtrap noxtrap\n" " solid nosolid blackout xinerama noxinerama xtrap\n"
" xrandr noxrandr xrandr_mode padgeom quiet q noquiet\n" " noxtrap xrandr noxrandr xrandr_mode padgeom quiet q\n"
" modtweak nomodtweak xkb noxkb skip_keycodes sloppy_keys\n" " noquiet modtweak nomodtweak xkb noxkb skip_keycodes\n"
" nosloppy_keys skip_dups noskip_dups add_keysyms\n" " sloppy_keys nosloppy_keys skip_dups noskip_dups\n"
" noadd_keysyms clear_mods noclear_mods clear_keys\n" " add_keysyms noadd_keysyms clear_mods noclear_mods\n"
" noclear_keys remap repeat norepeat fb nofb bell\n" " clear_keys noclear_keys remap repeat norepeat fb nofb\n"
" nobell sel nosel primary noprimary seldir cursorshape\n" " bell nobell sel nosel primary noprimary setprimary\n"
" nocursorshape cursorpos nocursorpos cursor show_cursor\n" " nosetprimary clipboard noclipboard setclipboard\n"
" noshow_cursor nocursor arrow xfixes noxfixes xdamage\n" " nosetclipboard seldir cursorshape nocursorshape\n"
" noxdamage xd_area xd_mem alphacut alphafrac alpharemove\n" " cursorpos nocursorpos cursor show_cursor noshow_cursor\n"
" nocursor arrow xfixes noxfixes xdamage noxdamage\n"
" xd_area xd_mem alphacut alphafrac alpharemove\n"
" noalpharemove alphablend noalphablend xwarppointer\n" " noalpharemove alphablend noalphablend xwarppointer\n"
" xwarp noxwarppointer noxwarp buttonmap dragging\n" " xwarp noxwarppointer noxwarp buttonmap dragging\n"
" nodragging wireframe_mode wireframe wf nowireframe\n" " nodragging wireframe_mode wireframe wf nowireframe\n"
......
...@@ -116,6 +116,7 @@ int debug_xdamage = 0; /* -R debug_xdamage:1 or 2 ... */ ...@@ -116,6 +116,7 @@ int debug_xdamage = 0; /* -R debug_xdamage:1 or 2 ... */
int debug_wireframe = 0; int debug_wireframe = 0;
int debug_tiles = 0; int debug_tiles = 0;
int debug_grabs = 0; int debug_grabs = 0;
int debug_sel = 0;
int xtrap_input = 0; /* -xtrap for user input insertion */ int xtrap_input = 0; /* -xtrap for user input insertion */
int xinerama = 0; /* -xinerama */ int xinerama = 0; /* -xinerama */
...@@ -274,6 +275,7 @@ int ui_skip = 10; /* see watchloop. negative means ignore input */ ...@@ -274,6 +275,7 @@ int ui_skip = 10; /* see watchloop. negative means ignore input */
int watch_selection = 1; /* normal selection/cutbuffer maintenance */ int watch_selection = 1; /* normal selection/cutbuffer maintenance */
int watch_primary = 1; /* more dicey, poll for changes in PRIMARY */ int watch_primary = 1; /* more dicey, poll for changes in PRIMARY */
int watch_clipboard = 1;
char *sel_direction = NULL; /* "send" or "recv" for one-way */ char *sel_direction = NULL; /* "send" or "recv" for one-way */
char *sigpipe = NULL; /* skip, ignore, exit */ char *sigpipe = NULL; /* skip, ignore, exit */
......
...@@ -91,6 +91,7 @@ extern int debug_xdamage; ...@@ -91,6 +91,7 @@ extern int debug_xdamage;
extern int debug_wireframe; extern int debug_wireframe;
extern int debug_tiles; extern int debug_tiles;
extern int debug_grabs; extern int debug_grabs;
extern int debug_sel;
extern int xtrap_input; extern int xtrap_input;
extern int xinerama; extern int xinerama;
...@@ -203,6 +204,7 @@ extern int ui_skip; ...@@ -203,6 +204,7 @@ extern int ui_skip;
extern int watch_selection; extern int watch_selection;
extern int watch_primary; extern int watch_primary;
extern int watch_clipboard;
extern char *sel_direction; extern char *sel_direction;
extern char *sigpipe; extern char *sigpipe;
......
...@@ -22,6 +22,7 @@ ...@@ -22,6 +22,7 @@
#include "cursor.h" #include "cursor.h"
#include "userinput.h" #include "userinput.h"
#include "keyboard.h" #include "keyboard.h"
#include "selection.h"
int send_remote_cmd(char *cmd, int query, int wait); int send_remote_cmd(char *cmd, int query, int wait);
int do_remote_query(char *remote_cmd, char *query_cmd, int remote_sync, int do_remote_query(char *remote_cmd, char *query_cmd, int remote_sync,
...@@ -2116,6 +2117,7 @@ char *process_remote_cmd(char *cmd, int stringonly) { ...@@ -2116,6 +2117,7 @@ char *process_remote_cmd(char *cmd, int stringonly) {
rfbLog("remote_cmd: enabling watch selection+primary.\n"); rfbLog("remote_cmd: enabling watch selection+primary.\n");
watch_selection = 1; watch_selection = 1;
watch_primary = 1; watch_primary = 1;
watch_clipboard = 1;
} else if (!strcmp(p, "nosel")) { } else if (!strcmp(p, "nosel")) {
if (query) { if (query) {
...@@ -2125,6 +2127,7 @@ char *process_remote_cmd(char *cmd, int stringonly) { ...@@ -2125,6 +2127,7 @@ char *process_remote_cmd(char *cmd, int stringonly) {
rfbLog("remote_cmd: disabling watch selection+primary.\n"); rfbLog("remote_cmd: disabling watch selection+primary.\n");
watch_selection = 0; watch_selection = 0;
watch_primary = 0; watch_primary = 0;
watch_clipboard = 0;
} else if (!strcmp(p, "primary")) { } else if (!strcmp(p, "primary")) {
if (query) { if (query) {
...@@ -2142,6 +2145,54 @@ char *process_remote_cmd(char *cmd, int stringonly) { ...@@ -2142,6 +2145,54 @@ char *process_remote_cmd(char *cmd, int stringonly) {
rfbLog("remote_cmd: disabling watch_primary.\n"); rfbLog("remote_cmd: disabling watch_primary.\n");
watch_primary = 0; watch_primary = 0;
} else if (!strcmp(p, "setprimary")) {
if (query) {
snprintf(buf, bufn, "ans=%s:%d", p, set_primary);
goto qry;
}
rfbLog("remote_cmd: enabling set_primary.\n");
set_primary = 1;
} else if (!strcmp(p, "nosetprimary")) {
if (query) {
snprintf(buf, bufn, "ans=%s:%d", p, !set_primary);
goto qry;
}
rfbLog("remote_cmd: disabling set_primary.\n");
set_primary = 0;
} else if (!strcmp(p, "clipboard")) {
if (query) {
snprintf(buf, bufn, "ans=%s:%d", p, watch_clipboard);
goto qry;
}
rfbLog("remote_cmd: enabling watch_clipboard.\n");
watch_clipboard = 1;
} else if (!strcmp(p, "noclipboard")) {
if (query) {
snprintf(buf, bufn, "ans=%s:%d", p, !watch_clipboard);
goto qry;
}
rfbLog("remote_cmd: disabling watch_clipboard.\n");
watch_clipboard = 0;
} else if (!strcmp(p, "setclipboard")) {
if (query) {
snprintf(buf, bufn, "ans=%s:%d", p, set_clipboard);
goto qry;
}
rfbLog("remote_cmd: enabling set_clipboard.\n");
set_clipboard = 1;
} else if (!strcmp(p, "nosetclipboard")) {
if (query) {
snprintf(buf, bufn, "ans=%s:%d", p, !set_clipboard);
goto qry;
}
rfbLog("remote_cmd: disabling set_clipboard.\n");
set_clipboard = 0;
} else if (strstr(p, "seldir") == p) { } else if (strstr(p, "seldir") == p) {
COLON_CHECK("seldir:") COLON_CHECK("seldir:")
if (query) { if (query) {
...@@ -3501,6 +3552,21 @@ char *process_remote_cmd(char *cmd, int stringonly) { ...@@ -3501,6 +3552,21 @@ char *process_remote_cmd(char *cmd, int stringonly) {
debug_grabs = 0; debug_grabs = 0;
rfbLog("set debug_grabs to: %d\n", debug_grabs); rfbLog("set debug_grabs to: %d\n", debug_grabs);
} else if (!strcmp(p, "debug_sel")) {
if (query) {
snprintf(buf, bufn, "ans=%s:%d", p, debug_sel);
goto qry;
}
debug_sel = 1;
rfbLog("set debug_sel to: %d\n", debug_sel);
} else if (!strcmp(p, "nodebug_sel")) {
if (query) {
snprintf(buf, bufn, "ans=%s:%d", p, !debug_sel);
goto qry;
}
debug_sel = 0;
rfbLog("set debug_sel to: %d\n", debug_sel);
} else if (!strcmp(p, "dbg")) { } else if (!strcmp(p, "dbg")) {
if (query) { if (query) {
snprintf(buf, bufn, "ans=%s:%d", p, crash_debug); snprintf(buf, bufn, "ans=%s:%d", p, crash_debug);
......
...@@ -407,7 +407,7 @@ static char *raw_fb_orig_dpy = NULL; ...@@ -407,7 +407,7 @@ static char *raw_fb_orig_dpy = NULL;
void set_raw_fb_params(int restore) { void set_raw_fb_params(int restore) {
static int first = 1; static int first = 1;
static int vo0, us0, sm0, ws0, wp0, wb0, na0, tn0; static int vo0, us0, sm0, ws0, wp0, wc0, wb0, na0, tn0;
static int xr0, sb0; static int xr0, sb0;
static char *mc0; static char *mc0;
...@@ -421,6 +421,7 @@ void set_raw_fb_params(int restore) { ...@@ -421,6 +421,7 @@ void set_raw_fb_params(int restore) {
vo0 = view_only; vo0 = view_only;
ws0 = watch_selection; ws0 = watch_selection;
wp0 = watch_primary; wp0 = watch_primary;
wc0 = watch_clipboard;
wb0 = watch_bell; wb0 = watch_bell;
na0 = no_autorepeat; na0 = no_autorepeat;
sb0 = use_solid_bg; sb0 = use_solid_bg;
...@@ -438,6 +439,7 @@ void set_raw_fb_params(int restore) { ...@@ -438,6 +439,7 @@ void set_raw_fb_params(int restore) {
view_only = vo0; view_only = vo0;
watch_selection = ws0; watch_selection = ws0;
watch_primary = wp0; watch_primary = wp0;
watch_clipboard = wc0;
watch_bell = wb0; watch_bell = wb0;
no_autorepeat = na0; no_autorepeat = na0;
use_solid_bg = sb0; use_solid_bg = sb0;
...@@ -493,6 +495,11 @@ void set_raw_fb_params(int restore) { ...@@ -493,6 +495,11 @@ void set_raw_fb_params(int restore) {
"watch_primary\n"); "watch_primary\n");
watch_primary = 0; watch_primary = 0;
} }
if (watch_clipboard) {
if (! quiet) rfbLog("rawfb: turning off "
"watch_clipboard\n");
watch_clipboard = 0;
}
if (watch_bell) { if (watch_bell) {
if (! quiet) rfbLog("rawfb: turning off watch_bell\n"); if (! quiet) rfbLog("rawfb: turning off watch_bell\n");
watch_bell = 0; watch_bell = 0;
......
...@@ -9,19 +9,24 @@ ...@@ -9,19 +9,24 @@
* Selection/Cutbuffer/Clipboard handlers. * Selection/Cutbuffer/Clipboard handlers.
*/ */
int own_selection = 0; /* whether we currently own PRIMARY or not */ int own_primary = 0; /* whether we currently own PRIMARY or not */
int set_primary = 1;
int own_clipboard = 0; /* whether we currently own CLIPBOARD or not */
int set_clipboard = 1;
int set_cutbuffer = 0; /* to avoid bouncing the CutText right back */ int set_cutbuffer = 0; /* to avoid bouncing the CutText right back */
int sel_waittime = 15; /* some seconds to skip before first send */ int sel_waittime = 15; /* some seconds to skip before first send */
Window selwin; /* special window for our selection */ Window selwin; /* special window for our selection */
Atom clipboard_atom = None;
/* /*
* This is where we keep our selection: the string sent TO us from VNC * This is where we keep our selection: the string sent TO us from VNC
* clients, and the string sent BY us to requesting X11 clients. * clients, and the string sent BY us to requesting X11 clients.
*/ */
char *xcut_str = NULL; char *xcut_str_primary = NULL;
char *xcut_str_clipboard = NULL;
void selection_request(XEvent *ev); void selection_request(XEvent *ev, char *type);
int check_sel_direction(char *dir, char *label, char *sel, int len); int check_sel_direction(char *dir, char *label, char *sel, int len);
void cutbuffer_send(void); void cutbuffer_send(void);
void selection_send(XEvent *ev); void selection_send(XEvent *ev);
...@@ -29,14 +34,14 @@ void selection_send(XEvent *ev); ...@@ -29,14 +34,14 @@ void selection_send(XEvent *ev);
/* /*
* Our callbacks instruct us to check for changes in the cutbuffer * Our callbacks instruct us to check for changes in the cutbuffer
* and PRIMARY selection on the local X11 display. * and PRIMARY and CLIPBOARD selection on the local X11 display.
* *
* We store the new cutbuffer and/or PRIMARY selection data in this
* constant sized array selection_str[].
* TODO: check if malloc does not cause performance issues (esp. WRT * TODO: check if malloc does not cause performance issues (esp. WRT
* SelectionNotify handling). * SelectionNotify handling).
*/ */
static char selection_str[PROP_MAX+1]; static char cutbuffer_str[PROP_MAX+1];
static char primary_str[PROP_MAX+1];
static char clipboard_str[PROP_MAX+1];
/* /*
* An X11 (not VNC) client on the local display has requested the selection * An X11 (not VNC) client on the local display has requested the selection
...@@ -44,10 +49,11 @@ static char selection_str[PROP_MAX+1]; ...@@ -44,10 +49,11 @@ static char selection_str[PROP_MAX+1];
* *
* n.b.: our caller already has the X_LOCK. * n.b.: our caller already has the X_LOCK.
*/ */
void selection_request(XEvent *ev) { void selection_request(XEvent *ev, char *type) {
XSelectionEvent notify_event; XSelectionEvent notify_event;
XSelectionRequestEvent *req_event; XSelectionRequestEvent *req_event;
XErrorHandler old_handler; XErrorHandler old_handler;
char *str;
unsigned int length; unsigned int length;
unsigned char *data; unsigned char *data;
#ifndef XA_LENGTH #ifndef XA_LENGTH
...@@ -67,11 +73,24 @@ void selection_request(XEvent *ev) { ...@@ -67,11 +73,24 @@ void selection_request(XEvent *ev) {
} else { } else {
notify_event.property = req_event->property; notify_event.property = req_event->property;
} }
if (xcut_str) {
length = strlen(xcut_str); if (!strcmp(type, "PRIMARY")) {
str = xcut_str_primary;
} else if (!strcmp(type, "CLIPBOARD")) {
str = xcut_str_clipboard;
} else {
return;
}
if (str) {
length = strlen(str);
} else { } else {
length = 0; length = 0;
} }
if (debug_sel) {
rfbLog("%s\trequest event: owner=0x%x requestor=0x%x sel=%03d targ=%d prop=%d\n",
type, req_event->owner, req_event->requestor, req_event->selection,
req_event->target, req_event->property);
}
/* the window may have gone away, so trap errors */ /* the window may have gone away, so trap errors */
trapped_xerror = 0; trapped_xerror = 0;
...@@ -89,7 +108,7 @@ void selection_request(XEvent *ev) { ...@@ -89,7 +108,7 @@ void selection_request(XEvent *ev) {
} else { } else {
/* data request */ /* data request */
data = (unsigned char *)xcut_str; data = (unsigned char *)str;
XChangeProperty(ev->xselectionrequest.display, XChangeProperty(ev->xselectionrequest.display,
ev->xselectionrequest.requestor, ev->xselectionrequest.requestor,
...@@ -104,7 +123,7 @@ void selection_request(XEvent *ev) { ...@@ -104,7 +123,7 @@ void selection_request(XEvent *ev) {
} }
if (trapped_xerror) { if (trapped_xerror) {
rfbLog("selection_request: ignored XError while sending " rfbLog("selection_request: ignored XError while sending "
"PRIMARY selection to 0x%x.\n", req_event->requestor); "%s selection to 0x%x.\n", type, req_event->requestor);
} }
XSetErrorHandler(old_handler); XSetErrorHandler(old_handler);
trapped_xerror = 0; trapped_xerror = 0;
...@@ -114,6 +133,9 @@ void selection_request(XEvent *ev) { ...@@ -114,6 +133,9 @@ void selection_request(XEvent *ev) {
int check_sel_direction(char *dir, char *label, char *sel, int len) { int check_sel_direction(char *dir, char *label, char *sel, int len) {
int db = 0, ok = 1; int db = 0, ok = 1;
if (debug_sel) {
db = 1;
}
if (sel_direction) { if (sel_direction) {
if (strstr(sel_direction, "debug")) { if (strstr(sel_direction, "debug")) {
db = 1; db = 1;
...@@ -132,7 +154,7 @@ int check_sel_direction(char *dir, char *label, char *sel, int len) { ...@@ -132,7 +154,7 @@ int check_sel_direction(char *dir, char *label, char *sel, int len) {
if (len < n) { if (len < n) {
str[len] = '\0'; str[len] = '\0';
} }
rfbLog("%s: %s...\n", label, str); rfbLog("%s: '%s'\n", label, str);
if (ok) { if (ok) {
rfbLog("%s: %s-ing it.\n", label, dir); rfbLog("%s: %s-ing it.\n", label, dir);
} else { } else {
...@@ -154,10 +176,11 @@ void cutbuffer_send(void) { ...@@ -154,10 +176,11 @@ void cutbuffer_send(void) {
unsigned long nitems = 0, bytes_after = 0; unsigned long nitems = 0, bytes_after = 0;
unsigned char* data = NULL; unsigned char* data = NULL;
selection_str[0] = '\0'; cutbuffer_str[0] = '\0';
slen = 0; slen = 0;
/* read the property value into selection_str: */
/* read the property value into cutbuffer_str: */
do { do {
if (XGetWindowProperty(dpy, DefaultRootWindow(dpy), if (XGetWindowProperty(dpy, DefaultRootWindow(dpy),
XA_CUT_BUFFER0, nitems/4, PROP_MAX/16, False, XA_CUT_BUFFER0, nitems/4, PROP_MAX/16, False,
...@@ -172,14 +195,18 @@ void cutbuffer_send(void) { ...@@ -172,14 +195,18 @@ void cutbuffer_send(void) {
XFree(data); XFree(data);
break; break;
} }
memcpy(selection_str+slen, data, dlen); memcpy(cutbuffer_str+slen, data, dlen);
slen += dlen; slen += dlen;
selection_str[slen] = '\0'; cutbuffer_str[slen] = '\0';
XFree(data); XFree(data);
} }
} while (bytes_after > 0); } while (bytes_after > 0);
selection_str[PROP_MAX] = '\0'; cutbuffer_str[PROP_MAX] = '\0';
if (debug_sel) {
rfbLog("cutbuffer_send: '%s'\n", cutbuffer_str);
}
if (! all_clients_initialized()) { if (! all_clients_initialized()) {
rfbLog("cutbuffer_send: no send: uninitialized clients\n"); rfbLog("cutbuffer_send: no send: uninitialized clients\n");
...@@ -193,9 +220,9 @@ void cutbuffer_send(void) { ...@@ -193,9 +220,9 @@ void cutbuffer_send(void) {
if (!screen) { if (!screen) {
return; return;
} }
len = strlen(selection_str); len = strlen(cutbuffer_str);
if (check_sel_direction("send", "cutbuffer_send", selection_str, len)) { if (check_sel_direction("send", "cutbuffer_send", cutbuffer_str, len)) {
rfbSendServerCutText(screen, selection_str, len); rfbSendServerCutText(screen, cutbuffer_str, len);
} }
} }
...@@ -219,18 +246,41 @@ void selection_send(XEvent *ev) { ...@@ -219,18 +246,41 @@ void selection_send(XEvent *ev) {
char before[CHKSZ], after[CHKSZ]; char before[CHKSZ], after[CHKSZ];
unsigned long nitems = 0, bytes_after = 0; unsigned long nitems = 0, bytes_after = 0;
unsigned char* data = NULL; unsigned char* data = NULL;
char *selection_str;
/* /*
* remember info about our last value of PRIMARY (or CUT_BUFFER0) * remember info about our last value of PRIMARY (or CUT_BUFFER0)
* so we can check for any changes below. * so we can check for any changes below.
*/ */
if (ev->xselection.selection == XA_PRIMARY) {
if (! watch_primary) {
return;
}
selection_str = primary_str;
if (debug_sel) {
rfbLog("selection_send: event PRIMARY prop: %d requestor: 0x%x atom: %d\n",
ev->xselection.property, ev->xselection.requestor, ev->xselection.selection);
}
} else if (clipboard_atom && ev->xselection.selection == clipboard_atom) {
if (! watch_clipboard) {
return;
}
selection_str = clipboard_str;
if (debug_sel) {
rfbLog("selection_send: event CLIPBOARD prop: %d requestor: 0x%x atom: %d\n",
ev->xselection.property, ev->xselection.requestor, ev->xselection.selection);
}
} else {
return;
}
oldlen = strlen(selection_str); oldlen = strlen(selection_str);
strncpy(before, selection_str, CHKSZ); strncpy(before, selection_str, CHKSZ);
selection_str[0] = '\0'; selection_str[0] = '\0';
slen = 0; slen = 0;
/* read in the current value of PRIMARY: */ /* read in the current value of PRIMARY or CLIPBOARD: */
do { do {
if (XGetWindowProperty(dpy, ev->xselection.requestor, if (XGetWindowProperty(dpy, ev->xselection.requestor,
ev->xselection.property, nitems/4, PROP_MAX/16, True, ev->xselection.property, nitems/4, PROP_MAX/16, True,
...@@ -248,9 +298,11 @@ void selection_send(XEvent *ev) { ...@@ -248,9 +298,11 @@ void selection_send(XEvent *ev) {
err = 5; err = 5;
} }
rfbLog("warning: truncating large PRIMARY" rfbLog("warning: truncating large PRIMARY"
" selection > %d bytes.\n", PROP_MAX); "/CLIPBOARD selection > %d bytes.\n",
PROP_MAX);
break; break;
} }
if (debug_sel) fprintf(stderr, "selection_send: data: '%s' dlen: %d nitems: %d ba: %d\n", data, dlen, nitems, bytes_after);
memcpy(selection_str+slen, data, dlen); memcpy(selection_str+slen, data, dlen);
slen += dlen; slen += dlen;
selection_str[slen] = '\0'; selection_str[slen] = '\0';
...@@ -269,6 +321,11 @@ void selection_send(XEvent *ev) { ...@@ -269,6 +321,11 @@ void selection_send(XEvent *ev) {
oldlen = -1; oldlen = -1;
sent_one = 1; sent_one = 1;
} }
if (debug_sel) {
rfbLog("selection_send: %s '%s'\n",
ev->xselection.selection == XA_PRIMARY ? "PRIMARY " : "CLIPBOARD",
selection_str);
}
/* look for changes in the new value */ /* look for changes in the new value */
newlen = strlen(selection_str); newlen = strlen(selection_str);
...@@ -276,6 +333,9 @@ void selection_send(XEvent *ev) { ...@@ -276,6 +333,9 @@ void selection_send(XEvent *ev) {
if (oldlen == newlen && strncmp(before, after, CHKSZ) == 0) { if (oldlen == newlen && strncmp(before, after, CHKSZ) == 0) {
/* evidently no change */ /* evidently no change */
if (debug_sel) {
rfbLog("selection_send: no change.\n");
}
return; return;
} }
if (newlen == 0) { if (newlen == 0) {
......
...@@ -3,13 +3,18 @@ ...@@ -3,13 +3,18 @@
/* -- selection.h -- */ /* -- selection.h -- */
extern char *xcut_str; extern char *xcut_str_primary;
extern int own_selection; extern char *xcut_str_clipboard;
extern int own_primary;
extern int set_primary;
extern int own_clipboard;
extern int set_clipboard;
extern int set_cutbuffer; extern int set_cutbuffer;
extern int sel_waittime; extern int sel_waittime;
extern Window selwin; extern Window selwin;
extern Atom clipboard_atom;
extern void selection_request(XEvent *ev); extern void selection_request(XEvent *ev, char *type);
extern int check_sel_direction(char *dir, char *label, char *sel, int len); extern int check_sel_direction(char *dir, char *label, char *sel, int len);
extern void cutbuffer_send(void); extern void cutbuffer_send(void);
extern void selection_send(XEvent *ev); extern void selection_send(XEvent *ev);
......
...@@ -96,6 +96,14 @@ int start_stunnel(int stunnel_port, int x11vnc_port) { ...@@ -96,6 +96,14 @@ int start_stunnel(int stunnel_port, int x11vnc_port) {
return 0; return 0;
} }
if (no_external_cmds) {
rfbLogEnable(1);
rfbLog("start_stunnel: cannot run external commands in -nocmds mode:\n");
rfbLog(" \"%s\"\n", stunnel_path);
rfbLog(" exiting.\n");
clean_up_exit(1);
}
if (! quiet) { if (! quiet) {
rfbLog("\n"); rfbLog("\n");
rfbLog("starting ssl tunnel: %s %d -> %d\n", stunnel_path, rfbLog("starting ssl tunnel: %s %d -> %d\n", stunnel_path,
......
...@@ -95,18 +95,22 @@ Actions ...@@ -95,18 +95,22 @@ Actions
-- --
=RA ping =RA ping
=RA update-all =RA update-all
-- =GAL Settings::
=GA save-settings =GA save-settings
=SFA load-settings: =SFA load-settings:
=SA defaults-all =SA defaults-all
=0SA clear-all =0SA clear-all
--
=F rc:
norc
=GAL LOFF
-- D -- D
=DRA stop+quit =DRA stop+quit
=DGA Quit =DGA Quit
Help Help
=DGA gui =DGA gui
=GA all =DGA all
Clients Clients
=DRQA current: =DRQA current:
...@@ -119,10 +123,12 @@ Clients ...@@ -119,10 +123,12 @@ Clients
vncconnect vncconnect
-- D -- D
filexfer filexfer
=GAL Java-applet::
=D http =D http
httpdir: httpdir:
httpport: httpport:
enablehttpproxy enablehttpproxy
=GAL LOFF
Displays Displays
=D display: =D display:
...@@ -135,7 +141,6 @@ Screen ...@@ -135,7 +141,6 @@ Screen
=DRA refresh =DRA refresh
=RA reset =RA reset
=RA blacken =RA blacken
fixscreen:
-- D -- D
=D scale: =D scale:
scale_cursor: scale_cursor:
...@@ -163,14 +168,17 @@ Screen ...@@ -163,14 +168,17 @@ Screen
=-C:resize,newfbsize,exit xrandr_mode: =-C:resize,newfbsize,exit xrandr_mode:
padgeom: padgeom:
=GAL LOFF =GAL LOFF
-- =GAL Clipping::
=P blackout: =P blackout:
xinerama xinerama
clip: clip:
-- =GAL LOFF
=GAL Misc-Screen::
fixscreen:
visual: visual:
rawfb: rawfb:
pipeinput: pipeinput:
=GAL LOFF
Keyboard Keyboard
=D norepeat =D norepeat
...@@ -212,28 +220,26 @@ Misc ...@@ -212,28 +220,26 @@ Misc
-- D -- D
=GA all-settings =GA all-settings
=RA remote-cmd: =RA remote-cmd:
--
=F rc:
norc
filexfer
--
nofb
=D nobell
nolookup
=GAL Selection:: =GAL Selection::
=D nosel =D nosel
noprimary noprimary
nosetprimary
noclipboard
nosetclipboard
seldir: seldir:
=GAL LOFF =GAL LOFF
-- =GAL X-ext::
xtrap xtrap
xrecord xrecord
=RQA reset_record =RQA reset_record
=GAL LOFF
-- --
nofb
=D nobell
nolookup
bg bg
=-C:ignore,exit sigpipe: =-C:ignore,exit sigpipe:
=0 inetd =0 inetd
rfbwait:
Debugging Debugging
debug_pointer debug_pointer
...@@ -250,6 +256,7 @@ Debugging ...@@ -250,6 +256,7 @@ Debugging
debug_scroll debug_scroll
debug_tiles debug_tiles
debug_grabs debug_grabs
debug_sel
dbg dbg
=GAL LOFF =GAL LOFF
=GA show-start-cmd =GA show-start-cmd
...@@ -258,39 +265,41 @@ Debugging ...@@ -258,39 +265,41 @@ Debugging
Permissions Permissions
=DRQA lock =DRQA lock
=DRQA unlock =DRQA unlock
=D shared
=D forever
-- --
=DFP allow: =DFP allow:
=D localhost =D localhost
=RA allowonce: =RA allowonce:
listen: listen:
-- D -- D
=D shared
=D forever
timeout:
--
=D viewonly =D viewonly
input: input:
-- --
safer
unsafe
=RA noremote
--
=GAL Passwords:: =GAL Passwords::
passwd: passwd:
viewpasswd: viewpasswd:
=F passwdfile: =F passwdfile:
=F rfbauth: =F rfbauth:
usepw
--
unixpw unixpw
unixpw_list: unixpw_list:
unixpw_nis unixpw_nis
unixpw_nis_list: unixpw_nis_list:
=0 storepasswd =0 storepasswd
=GAL LOFF =GAL LOFF
=GAL Safe::
safer
unsafe
=RA noremote
=GAL LOFF
=GAL Misc-Perms:: =GAL Misc-Perms::
=0S alwaysshared =0S alwaysshared
=0S nevershared =0S nevershared
=0S dontdisconnect =0S dontdisconnect
=SQA deny_all =SQA deny_all
timeout:
stunnel stunnel
=F stunnel_pem: =F stunnel_pem:
=GAL LOFF =GAL LOFF
...@@ -344,6 +353,7 @@ Tuning ...@@ -344,6 +353,7 @@ Tuning
snapfb snapfb
threads threads
wmdt: wmdt:
rfbwait:
=GAL LOFF =GAL LOFF
" "
} }
...@@ -786,6 +796,7 @@ should never use them and just use x11vnc's -shared and -forever options ...@@ -786,6 +796,7 @@ should never use them and just use x11vnc's -shared and -forever options
instead (these give basically the same functionality and if you mixed instead (these give basically the same functionality and if you mixed
them too much unexpected things may happen). them too much unexpected things may happen).
" "
#'
set helptext(AlphaBlending:) " set helptext(AlphaBlending:) "
In this sub-menu we provide some tweak parameters for cursors (little In this sub-menu we provide some tweak parameters for cursors (little
...@@ -808,6 +819,7 @@ The items in this sub-menu let you tweak x11vnc's approximation scheme ...@@ -808,6 +819,7 @@ The items in this sub-menu let you tweak x11vnc's approximation scheme
for cursors with transparency. Hopefully you won't have to use them. for cursors with transparency. Hopefully you won't have to use them.
Certain cursor \"themes\" may require adjustment however. Certain cursor \"themes\" may require adjustment however.
" "
#'
set helptext(OverlayVisuals:) " set helptext(OverlayVisuals:) "
In this sub-menu are some options that involve fixing color problems In this sub-menu are some options that involve fixing color problems
for \"Overlay\" or \"Multi-Depth\" visuals. This problem is rare for \"Overlay\" or \"Multi-Depth\" visuals. This problem is rare
...@@ -924,6 +936,48 @@ video hardware was slow at the time. x11vnc tries to use this same trick ...@@ -924,6 +936,48 @@ video hardware was slow at the time. x11vnc tries to use this same trick
as a speedup for its activities (the network is much slower than video as a speedup for its activities (the network is much slower than video
hardware writes, and the video hardware reads that x11vnc uses to poll hardware writes, and the video hardware reads that x11vnc uses to poll
the screen are still slow today). the screen are still slow today).
"
#'"
set helptext(Safe:) "
In this sub-menu are some options for making x11vnc operations
more, or less, safe. E.g. disable the running of external commands, etc.
You can also turn off the Remote control channel (NOTE that doing that
will disable the GUI from being able to communicate with x11vnc).
"
set helptext(X-ext:) "
In this sub-menu are a few rarely used options regarding some X extensions
used by x11vnc.
"
set helptext(Clipping:) "
In this sub-menu are some options regarding clipping or blacking out
portions of the Screen. E.g. under XINERAMA when the multiple monitors
are not the same size.
"
set helptext(Misc-Screen:) "
In this sub-menu are some little used options modifying aspects of
the screen source.
"
set helptext(Settings:) "
In this sub-menu are some options for saving and loading option settings.
The default file to store settings in is ~/.x11vncrc, but you can save
different \"profiles\" in other files for later use.
"
set helptext(Java-applet:) "
In this sub-menu are some options for running the built-in HTTP server
that delivers the TightVNC Java VNC Viewer applet (VncViewer.jar) to
clients. The viewer runs in their Web browser.
The default port listened on is 5800, so the URL is typically:
http://hostname:5800/
but this can be altered by -httpport, etc.
" "
set helptext(ScrollCopyRect:) " set helptext(ScrollCopyRect:) "
......
...@@ -106,18 +106,22 @@ char gui_code[] = ""; ...@@ -106,18 +106,22 @@ char gui_code[] = "";
" --\n" " --\n"
" =RA ping\n" " =RA ping\n"
" =RA update-all\n" " =RA update-all\n"
" --\n" " =GAL Settings::\n"
" =GA save-settings\n" " =GA save-settings\n"
" =SFA load-settings:\n" " =SFA load-settings:\n"
" =SA defaults-all\n" " =SA defaults-all\n"
" =0SA clear-all\n" " =0SA clear-all\n"
" --\n"
" =F rc:\n"
" norc\n"
" =GAL LOFF\n"
" -- D\n" " -- D\n"
" =DRA stop+quit \n" " =DRA stop+quit \n"
" =DGA Quit \n" " =DGA Quit \n"
"\n" "\n"
"Help\n" "Help\n"
" =DGA gui\n" " =DGA gui\n"
" =GA all\n" " =DGA all\n"
"\n" "\n"
"Clients\n" "Clients\n"
" =DRQA current:\n" " =DRQA current:\n"
...@@ -130,10 +134,12 @@ char gui_code[] = ""; ...@@ -130,10 +134,12 @@ char gui_code[] = "";
" vncconnect\n" " vncconnect\n"
" -- D\n" " -- D\n"
" filexfer\n" " filexfer\n"
" =GAL Java-applet::\n"
" =D http\n" " =D http\n"
" httpdir:\n" " httpdir:\n"
" httpport:\n" " httpport:\n"
" enablehttpproxy\n" " enablehttpproxy\n"
" =GAL LOFF\n"
"\n" "\n"
"Displays\n" "Displays\n"
" =D display:\n" " =D display:\n"
...@@ -146,7 +152,6 @@ char gui_code[] = ""; ...@@ -146,7 +152,6 @@ char gui_code[] = "";
" =DRA refresh\n" " =DRA refresh\n"
" =RA reset\n" " =RA reset\n"
" =RA blacken\n" " =RA blacken\n"
" fixscreen:\n"
" -- D\n" " -- D\n"
" =D scale:\n" " =D scale:\n"
" scale_cursor:\n" " scale_cursor:\n"
...@@ -174,14 +179,17 @@ char gui_code[] = ""; ...@@ -174,14 +179,17 @@ char gui_code[] = "";
" =-C:resize,newfbsize,exit xrandr_mode:\n" " =-C:resize,newfbsize,exit xrandr_mode:\n"
" padgeom:\n" " padgeom:\n"
" =GAL LOFF\n" " =GAL LOFF\n"
" --\n" " =GAL Clipping::\n"
" =P blackout:\n" " =P blackout:\n"
" xinerama\n" " xinerama\n"
" clip:\n" " clip:\n"
" --\n" " =GAL LOFF\n"
" =GAL Misc-Screen::\n"
" fixscreen:\n"
" visual:\n" " visual:\n"
" rawfb:\n" " rawfb:\n"
" pipeinput:\n" " pipeinput:\n"
" =GAL LOFF\n"
"\n" "\n"
"Keyboard\n" "Keyboard\n"
" =D norepeat\n" " =D norepeat\n"
...@@ -223,28 +231,26 @@ char gui_code[] = ""; ...@@ -223,28 +231,26 @@ char gui_code[] = "";
" -- D\n" " -- D\n"
" =GA all-settings\n" " =GA all-settings\n"
" =RA remote-cmd:\n" " =RA remote-cmd:\n"
" --\n"
" =F rc:\n"
" norc\n"
" filexfer\n"
" --\n"
" nofb\n"
" =D nobell\n"
" nolookup\n"
" =GAL Selection::\n" " =GAL Selection::\n"
" =D nosel\n" " =D nosel\n"
" noprimary\n" " noprimary\n"
" nosetprimary\n"
" noclipboard\n"
" nosetclipboard\n"
" seldir:\n" " seldir:\n"
" =GAL LOFF\n" " =GAL LOFF\n"
" --\n" " =GAL X-ext::\n"
" xtrap\n" " xtrap\n"
" xrecord\n" " xrecord\n"
" =RQA reset_record\n" " =RQA reset_record\n"
" =GAL LOFF\n"
" --\n" " --\n"
" nofb\n"
" =D nobell\n"
" nolookup\n"
" bg\n" " bg\n"
" =-C:ignore,exit sigpipe:\n" " =-C:ignore,exit sigpipe:\n"
" =0 inetd\n" " =0 inetd\n"
" rfbwait:\n"
"\n" "\n"
"Debugging\n" "Debugging\n"
" debug_pointer\n" " debug_pointer\n"
...@@ -261,6 +267,7 @@ char gui_code[] = ""; ...@@ -261,6 +267,7 @@ char gui_code[] = "";
" debug_scroll\n" " debug_scroll\n"
" debug_tiles\n" " debug_tiles\n"
" debug_grabs\n" " debug_grabs\n"
" debug_sel\n"
" dbg\n" " dbg\n"
" =GAL LOFF\n" " =GAL LOFF\n"
" =GA show-start-cmd\n" " =GA show-start-cmd\n"
...@@ -269,39 +276,41 @@ char gui_code[] = ""; ...@@ -269,39 +276,41 @@ char gui_code[] = "";
"Permissions\n" "Permissions\n"
" =DRQA lock\n" " =DRQA lock\n"
" =DRQA unlock\n" " =DRQA unlock\n"
" =D shared\n"
" =D forever\n"
" --\n" " --\n"
" =DFP allow:\n" " =DFP allow:\n"
" =D localhost\n" " =D localhost\n"
" =RA allowonce:\n" " =RA allowonce:\n"
" listen:\n" " listen:\n"
" -- D\n" " -- D\n"
" =D shared\n"
" =D forever\n"
" timeout:\n"
" --\n"
" =D viewonly\n" " =D viewonly\n"
" input:\n" " input:\n"
" --\n" " --\n"
" safer\n"
" unsafe\n"
" =RA noremote\n"
" --\n"
" =GAL Passwords::\n" " =GAL Passwords::\n"
" passwd:\n" " passwd:\n"
" viewpasswd:\n" " viewpasswd:\n"
" =F passwdfile:\n" " =F passwdfile:\n"
" =F rfbauth:\n" " =F rfbauth:\n"
" usepw\n"
" --\n"
" unixpw\n" " unixpw\n"
" unixpw_list:\n" " unixpw_list:\n"
" unixpw_nis\n" " unixpw_nis\n"
" unixpw_nis_list:\n" " unixpw_nis_list:\n"
" =0 storepasswd\n" " =0 storepasswd\n"
" =GAL LOFF\n" " =GAL LOFF\n"
" =GAL Safe::\n"
" safer\n"
" unsafe\n"
" =RA noremote\n"
" =GAL LOFF\n"
" =GAL Misc-Perms::\n" " =GAL Misc-Perms::\n"
" =0S alwaysshared\n" " =0S alwaysshared\n"
" =0S nevershared\n" " =0S nevershared\n"
" =0S dontdisconnect\n" " =0S dontdisconnect\n"
" =SQA deny_all\n" " =SQA deny_all\n"
" timeout:\n"
" stunnel\n" " stunnel\n"
" =F stunnel_pem:\n" " =F stunnel_pem:\n"
" =GAL LOFF\n" " =GAL LOFF\n"
...@@ -355,6 +364,7 @@ char gui_code[] = ""; ...@@ -355,6 +364,7 @@ char gui_code[] = "";
" snapfb\n" " snapfb\n"
" threads\n" " threads\n"
" wmdt:\n" " wmdt:\n"
" rfbwait:\n"
" =GAL LOFF\n" " =GAL LOFF\n"
"\"\n" "\"\n"
"}\n" "}\n"
...@@ -797,6 +807,7 @@ char gui_code[] = ""; ...@@ -797,6 +807,7 @@ char gui_code[] = "";
"instead (these give basically the same functionality and if you mixed\n" "instead (these give basically the same functionality and if you mixed\n"
"them too much unexpected things may happen).\n" "them too much unexpected things may happen).\n"
"\"\n" "\"\n"
"#'\n"
"\n" "\n"
" set helptext(AlphaBlending:) \"\n" " set helptext(AlphaBlending:) \"\n"
"In this sub-menu we provide some tweak parameters for cursors (little\n" "In this sub-menu we provide some tweak parameters for cursors (little\n"
...@@ -819,6 +830,7 @@ char gui_code[] = ""; ...@@ -819,6 +830,7 @@ char gui_code[] = "";
"for cursors with transparency. Hopefully you won't have to use them.\n" "for cursors with transparency. Hopefully you won't have to use them.\n"
"Certain cursor \\\"themes\\\" may require adjustment however.\n" "Certain cursor \\\"themes\\\" may require adjustment however.\n"
"\"\n" "\"\n"
"#'\n"
" set helptext(OverlayVisuals:) \"\n" " set helptext(OverlayVisuals:) \"\n"
"In this sub-menu are some options that involve fixing color problems\n" "In this sub-menu are some options that involve fixing color problems\n"
"for \\\"Overlay\\\" or \\\"Multi-Depth\\\" visuals. This problem is rare\n" "for \\\"Overlay\\\" or \\\"Multi-Depth\\\" visuals. This problem is rare\n"
...@@ -936,6 +948,48 @@ char gui_code[] = ""; ...@@ -936,6 +948,48 @@ char gui_code[] = "";
"hardware writes, and the video hardware reads that x11vnc uses to poll\n" "hardware writes, and the video hardware reads that x11vnc uses to poll\n"
"the screen are still slow today).\n" "the screen are still slow today).\n"
"\"\n" "\"\n"
"#'\"\n"
"\n"
" set helptext(Safe:) \"\n"
"In this sub-menu are some options for making x11vnc operations\n"
"more, or less, safe. E.g. disable the running of external commands, etc.\n"
"\n"
"You can also turn off the Remote control channel (NOTE that doing that\n"
"will disable the GUI from being able to communicate with x11vnc).\n"
"\"\n"
"\n"
" set helptext(X-ext:) \"\n"
"In this sub-menu are a few rarely used options regarding some X extensions\n"
"used by x11vnc.\n"
"\"\n"
" set helptext(Clipping:) \"\n"
"In this sub-menu are some options regarding clipping or blacking out\n"
"portions of the Screen. E.g. under XINERAMA when the multiple monitors\n"
"are not the same size.\n"
"\n"
"\"\n"
" set helptext(Misc-Screen:) \"\n"
"In this sub-menu are some little used options modifying aspects of\n"
"the screen source.\n"
"\"\n"
"\n"
" set helptext(Settings:) \"\n"
"In this sub-menu are some options for saving and loading option settings.\n"
"The default file to store settings in is ~/.x11vncrc, but you can save\n"
"different \\\"profiles\\\" in other files for later use.\n"
"\n"
"\"\n"
" set helptext(Java-applet:) \"\n"
"In this sub-menu are some options for running the built-in HTTP server\n"
"that delivers the TightVNC Java VNC Viewer applet (VncViewer.jar) to\n"
"clients. The viewer runs in their Web browser.\n"
"\n"
"The default port listened on is 5800, so the URL is typically:\n"
"\n"
" http://hostname:5800/\n"
"\n"
"but this can be altered by -httpport, etc.\n"
"\"\n"
"\n" "\n"
" set helptext(ScrollCopyRect:) \"\n" " set helptext(ScrollCopyRect:) \"\n"
"This sub-menu has some options for the x11vnc Scroll detection and\n" "This sub-menu has some options for the x11vnc Scroll detection and\n"
......
...@@ -371,6 +371,10 @@ int su_verify(char *user, char *pass) { ...@@ -371,6 +371,10 @@ int su_verify(char *user, char *pass) {
return 0; return 0;
} }
} }
if (no_external_cmds) {
rfbLog("su_verify: cannot run external commands.\n");
clean_up_exit(1);
}
#define SU_DEBUG 0 #define SU_DEBUG 0
#if SU_DEBUG #if SU_DEBUG
...@@ -710,6 +714,7 @@ if (db) fprintf(stderr, "unixpw_verify: '%s' '%s'\n", user, db > 1 ? pass : "*** ...@@ -710,6 +714,7 @@ if (db) fprintf(stderr, "unixpw_verify: '%s' '%s'\n", user, db > 1 ? pass : "***
unixpw_accept(user); unixpw_accept(user);
return; return;
} else { } else {
rfbLog("unixpw_verify: crypt_verify login for %s failed.\n", user);
usleep(3000*1000); usleep(3000*1000);
} }
} else { } else {
...@@ -717,6 +722,7 @@ if (db) fprintf(stderr, "unixpw_verify: '%s' '%s'\n", user, db > 1 ? pass : "*** ...@@ -717,6 +722,7 @@ if (db) fprintf(stderr, "unixpw_verify: '%s' '%s'\n", user, db > 1 ? pass : "***
unixpw_accept(user); unixpw_accept(user);
return; return;
} }
rfbLog("unixpw_verify: su_verify login for %s failed.\n", user);
} }
if (tries < 2) { if (tries < 2) {
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
.TH X11VNC "1" "March 2006" "x11vnc " "User Commands" .TH X11VNC "1" "March 2006" "x11vnc " "User Commands"
.SH NAME .SH NAME
x11vnc - allow VNC connections to real X11 displays x11vnc - allow VNC connections to real X11 displays
version: 0.8.1, lastmod: 2006-03-06 version: 0.8.1, lastmod: 2006-03-08
.SH SYNOPSIS .SH SYNOPSIS
.B x11vnc .B x11vnc
[OPTION]... [OPTION]...
...@@ -373,6 +373,13 @@ If \fIstring\fR has the form "host" or "host:port" ...@@ -373,6 +373,13 @@ If \fIstring\fR has the form "host" or "host:port"
the connection is made once at startup. Use commas the connection is made once at startup. Use commas
for a list of host's and host:port's. for a list of host's and host:port's.
.IP .IP
Note that unlike most vnc servers, x11vnc will require a
password for reverse as well as for forward connections.
(provided password auth has been enabled, \fB-rfbauth,\fR etc)
If you do not want to require a password for reverse
connections set X11VNC_REVERSE_CONNECTION_NO_AUTH=1 in
your environment before starting x11vnc.
.IP
If \fIstring\fR contains "/" it is instead interpreted If \fIstring\fR contains "/" it is instead interpreted
as a file to periodically check for new hosts. as a file to periodically check for new hosts.
The first line is read and then the file is truncated. The first line is read and then the file is truncated.
...@@ -620,10 +627,13 @@ be readable. Passwords stored in /etc/shadow will ...@@ -620,10 +627,13 @@ be readable. Passwords stored in /etc/shadow will
be inaccessible unless run as root. This is called be inaccessible unless run as root. This is called
"NIS" mode simply because in most NIS setups the "NIS" mode simply because in most NIS setups the
user encrypted passwords are accessible (e.g. "ypcat user encrypted passwords are accessible (e.g. "ypcat
passwd"). NIS is not required for this mode to passwd"). NIS is not required for this mode to work
work, but it is unlikely it will work for any other (only that
environment. All of the \fB-unixpw\fR options and contraints .IR getpwnam (3)
apply. return the encrpyted password
is required), but it is unlikely it will work for any
other environment. All of the \fB-unixpw\fR options and
contraints apply.
.PP .PP
\fB-stunnel\fR \fI[pem]\fR \fB-stunnel\fR \fI[pem]\fR
.IP .IP
...@@ -670,16 +680,33 @@ for more examples. ...@@ -670,16 +680,33 @@ for more examples.
Use version 3.x stunnel command line syntax instead of Use version 3.x stunnel command line syntax instead of
version 4.x version 4.x
.PP .PP
\fB-nopw\fR \fB-usepw\fR
.IP .IP
Disable the big warning message when you use x11vnc If no other password method was supplied on the command
without some sort of password. line, first look for ~/.vnc/passwd and if found use it
with \fB-rfbauth;\fR next, look for ~/.vnc/passwdfile and
use it with \fB-passwdfile;\fR otherwise, prompt the user
for a password to create ~/.vnc/passwd and use it with
the \fB-rfbauth\fR option. If none of these succeed x11vnc
exits immediately.
.IP
Note: \fB-unixpw\fR currently does not count as a password
method by this option.
.PP .PP
\fB-storepasswd\fR \fIpass\fR \fIfile\fR \fB-storepasswd\fR \fIpass\fR \fIfile\fR
.IP .IP
Store password \fIpass\fR as the VNC password in the Store password \fIpass\fR as the VNC password in the
file \fIfile\fR. Once the password is stored the file \fIfile\fR. Once the password is stored the
program exits. Use the password via "\fB-rfbauth\fR \fIfile\fR" program exits. Use the password via "\fB-rfbauth\fR \fIfile\fR"
.IP
If called with no arguments, i.e., "\fB-storepasswd\fR",
the user is prompted for a password and it is stored
in the file ~/.vnc/passwd
.PP
\fB-nopw\fR
.IP
Disable the big warning message when you use x11vnc
without some sort of password.
.PP .PP
\fB-accept\fR \fIstring\fR \fB-accept\fR \fIstring\fR
.IP .IP
...@@ -1183,7 +1210,7 @@ Note: XBell monitoring requires the XKEYBOARD extension. ...@@ -1183,7 +1210,7 @@ Note: XBell monitoring requires the XKEYBOARD extension.
\fB-nosel\fR \fB-nosel\fR
.IP .IP
Do not manage exchange of X selection/cutbuffer between Do not manage exchange of X selection/cutbuffer between
VNC viewers and the X server. VNC viewers and the X server at all.
.PP .PP
\fB-noprimary\fR \fB-noprimary\fR
.IP .IP
...@@ -1191,6 +1218,22 @@ Do not poll the PRIMARY selection for changes to send ...@@ -1191,6 +1218,22 @@ Do not poll the PRIMARY selection for changes to send
back to clients. (PRIMARY is still set on received back to clients. (PRIMARY is still set on received
changes, however). changes, however).
.PP .PP
\fB-nosetprimary\fR
.IP
Do not set the PRIMARY selection for changes received
from VNC clients.
.PP
\fB-noclipboard\fR
.IP
Do not poll the CLIPBOARD selection for changes to send
back to clients. (CLIPBOARD is still set on received
changes, however).
.PP
\fB-nosetclipboard\fR
.IP
Do not set the CLIPBOARD selection for changes
received from VNC clients.
.PP
\fB-seldir\fR \fIstring\fR \fB-seldir\fR \fIstring\fR
.IP .IP
If direction string is "send", only send the selection If direction string is "send", only send the selection
...@@ -1740,6 +1783,11 @@ experience a lot of grab deadlock, please report a bug. ...@@ -1740,6 +1783,11 @@ experience a lot of grab deadlock, please report a bug.
Turn on debugging info printout with respect to Turn on debugging info printout with respect to
XGrabServer() deadlock for \fB-scrollcopyrect__mode_.\fR XGrabServer() deadlock for \fB-scrollcopyrect__mode_.\fR
.PP .PP
\fB-debug_sel\fR
.IP
Turn on debugging info printout with respect to
PRIMARY, CLIPBOARD, and CUTBUFFER0 selections.
.PP
\fB-pointer_mode\fR \fIn\fR \fB-pointer_mode\fR \fIn\fR
.IP .IP
Various pointer motion update schemes. "\fB-pm\fR" is Various pointer motion update schemes. "\fB-pm\fR" is
...@@ -2288,7 +2336,9 @@ nodeny allow new connections, same as "unlock" ...@@ -2288,7 +2336,9 @@ nodeny allow new connections, same as "unlock"
.IP .IP
connect:host do reverse connection to host, "host" connect:host do reverse connection to host, "host"
may be a comma separated list of hosts may be a comma separated list of hosts
or host:ports. See \fB-connect.\fR or host:ports. See \fB-connect.\fR Passwords
required as with fwd connections.
See X11VNC_REVERSE_CONNECTION_NO_AUTH=1
.IP .IP
disconnect:host disconnect any clients from "host" disconnect:host disconnect any clients from "host"
same as "close:host". Use host same as "close:host". Use host
...@@ -2434,6 +2484,18 @@ noprimary enable \fB-noprimary\fR mode. ...@@ -2434,6 +2484,18 @@ noprimary enable \fB-noprimary\fR mode.
.IP .IP
primary disable \fB-noprimary\fR mode. primary disable \fB-noprimary\fR mode.
.IP .IP
nosetprimary enable \fB-nosetprimary\fR mode.
.IP
setprimary disable \fB-nosetprimary\fR mode.
.IP
noclipboard enable \fB-noclipboard\fR mode.
.IP
clipboard disable \fB-noclipboard\fR mode.
.IP
nosetclipboard enable \fB-nosetclipboard\fR mode.
.IP
setclipboard disable \fB-nosetclipboard\fR mode.
.IP
seldir:str set \fB-seldir\fR to "str" seldir:str set \fB-seldir\fR to "str"
.IP .IP
cursor:mode enable \fB-cursor\fR "mode". cursor:mode enable \fB-cursor\fR "mode".
...@@ -2627,6 +2689,10 @@ debug_grabs enable \fB-debug_grabs\fR ...@@ -2627,6 +2689,10 @@ debug_grabs enable \fB-debug_grabs\fR
.IP .IP
nodebug_grabs disable \fB-debug_grabs\fR nodebug_grabs disable \fB-debug_grabs\fR
.IP .IP
debug_sel enable \fB-debug_sel\fR
.IP
nodebug_sel disable \fB-debug_sel\fR
.IP
dbg enable \fB-dbg\fR crash shell dbg enable \fB-dbg\fR crash shell
.IP .IP
nodbg disable \fB-dbg\fR crash shell nodbg disable \fB-dbg\fR crash shell
...@@ -2700,17 +2766,19 @@ shared noshared forever noforever once timeout filexfer ...@@ -2700,17 +2766,19 @@ shared noshared forever noforever once timeout filexfer
nofilexfer deny lock nodeny unlock connect allowonce nofilexfer deny lock nodeny unlock connect allowonce
allow localhost nolocalhost listen lookup nolookup allow localhost nolocalhost listen lookup nolookup
accept afteraccept gone shm noshm flipbyteorder accept afteraccept gone shm noshm flipbyteorder
noflipbyteorder onetile noonetile solid_color solid noflipbyteorder onetile noonetile solid_color
nosolid blackout xinerama noxinerama xtrap noxtrap solid nosolid blackout xinerama noxinerama xtrap
xrandr noxrandr xrandr_mode padgeom quiet q noquiet noxtrap xrandr noxrandr xrandr_mode padgeom quiet q
modtweak nomodtweak xkb noxkb skip_keycodes sloppy_keys noquiet modtweak nomodtweak xkb noxkb skip_keycodes
nosloppy_keys skip_dups noskip_dups add_keysyms sloppy_keys nosloppy_keys skip_dups noskip_dups
noadd_keysyms clear_mods noclear_mods clear_keys add_keysyms noadd_keysyms clear_mods noclear_mods
noclear_keys remap repeat norepeat fb nofb bell clear_keys noclear_keys remap repeat norepeat fb nofb
nobell sel nosel primary noprimary seldir cursorshape bell nobell sel nosel primary noprimary setprimary
nocursorshape cursorpos nocursorpos cursor show_cursor nosetprimary clipboard noclipboard setclipboard
noshow_cursor nocursor arrow xfixes noxfixes xdamage nosetclipboard seldir cursorshape nocursorshape
noxdamage xd_area xd_mem alphacut alphafrac alpharemove cursorpos nocursorpos cursor show_cursor noshow_cursor
nocursor arrow xfixes noxfixes xdamage noxdamage
xd_area xd_mem alphacut alphafrac alpharemove
noalpharemove alphablend noalphablend xwarppointer noalpharemove alphablend noalphablend xwarppointer
xwarp noxwarppointer noxwarp buttonmap dragging xwarp noxwarppointer noxwarp buttonmap dragging
nodragging wireframe_mode wireframe wf nowireframe nodragging wireframe_mode wireframe wf nowireframe
......
...@@ -140,6 +140,7 @@ ...@@ -140,6 +140,7 @@
#include "unixpw.h" #include "unixpw.h"
#include "inet.h" #include "inet.h"
#include "sslcmds.h" #include "sslcmds.h"
#include "selection.h"
/* /*
* main routine for the x11vnc program * main routine for the x11vnc program
...@@ -950,6 +951,7 @@ static void quick_pw(char *str) { ...@@ -950,6 +951,7 @@ static void quick_pw(char *str) {
} }
fprintf(stdout, "password: "); fprintf(stdout, "password: ");
/* no_external_cmds does not apply */
system("stty -echo"); system("stty -echo");
if(fgets(tmp, 128, stdin) == NULL) { if(fgets(tmp, 128, stdin) == NULL) {
fprintf(stdout, "\n"); fprintf(stdout, "\n");
...@@ -1241,6 +1243,7 @@ static void check_loop_mode(int argc, char* argv[]) { ...@@ -1241,6 +1243,7 @@ static void check_loop_mode(int argc, char* argv[]) {
perror("fork"); perror("fork");
exit(1); exit(1);
} else { } else {
/* no_external_cmds does not apply */
execvp(argv[0], argv2); execvp(argv[0], argv2);
exit(1); exit(1);
} }
...@@ -1262,6 +1265,91 @@ static void check_loop_mode(int argc, char* argv[]) { ...@@ -1262,6 +1265,91 @@ static void check_loop_mode(int argc, char* argv[]) {
#endif #endif
} }
} }
static void store_homedir_passwd(void) {
char str1[32], str2[32], *p, *h, *f;
struct stat sbuf;
str1[0] = '\0';
str2[0] = '\0';
if (no_external_cmds) {
fprintf(stderr, "-nocmds cannot be used with -storepasswd\n");
exit(1);
}
fprintf(stderr, "Enter VNC password: ");
system("stty -echo");
if (fgets(str1, 32, stdin) == NULL) {
system("stty echo");
exit(1);
}
fprintf(stderr, "\n");
fprintf(stderr, "Verify password: ");
if (fgets(str2, 32, stdin) == NULL) {
system("stty echo");
exit(1);
}
fprintf(stderr, "\n");
system("stty echo");
if ((p = strchr(str1, '\n')) != NULL) {
*p = '\0';
}
if ((p = strchr(str2, '\n')) != NULL) {
*p = '\0';
}
if (strcmp(str1, str2)) {
fprintf(stderr, "** passwords differ.\n");
exit(1);
}
if (str1[0] == '\0') {
fprintf(stderr, "** no password supplied.\n");
exit(1);
}
h = getenv("HOME");
if (! h) {
fprintf(stderr, "** $HOME not set.\n");
exit(1);
}
f = (char *) malloc(strlen(h) + strlen("/.vnc/passwd") + 1);
sprintf(f, "%s/.vnc", h);
if (stat(f, &sbuf) != 0) {
if (mkdir(f, 0755) != 0) {
fprintf(stderr, "** could not create directory %s\n", f);
perror("mkdir");
exit(1);
}
} else if (! S_ISDIR(sbuf.st_mode)) {
fprintf(stderr, "** not a directory %s\n", f);
exit(1);
}
sprintf(f, "%s/.vnc/passwd", h);
fprintf(stderr, "Write password to %s? [y]/n ", f);
if (fgets(str2, 32, stdin) == NULL) {
exit(1);
}
if (str2[0] == 'n' || str2[0] == 'N') {
fprintf(stderr, "not creating password.\n");
exit(1);
}
if (rfbEncryptAndStorePasswd(str1, f) != 0) {
fprintf(stderr, "** error creating password.\n");
perror("storepasswd");
exit(1);
}
fprintf(stderr, "Password written to: %s\n", f);
if (stat(f, &sbuf) != 0) {
exit(1);
}
exit(0);
}
#define SHOW_NO_PASSWORD_WARNING \ #define SHOW_NO_PASSWORD_WARNING \
(!got_passwd && !got_rfbauth && (!got_passwdfile || !passwd_list) \ (!got_passwd && !got_rfbauth && (!got_passwdfile || !passwd_list) \
...@@ -1284,6 +1372,7 @@ int main(int argc, char* argv[]) { ...@@ -1284,6 +1372,7 @@ int main(int argc, char* argv[]) {
int dt = 0, bg = 0; int dt = 0, bg = 0;
int got_rfbwait = 0; int got_rfbwait = 0;
int got_httpdir = 0, try_http = 0; int got_httpdir = 0, try_http = 0;
int usepw = 0;
/* used to pass args we do not know about to rfbGetScreen(): */ /* used to pass args we do not know about to rfbGetScreen(): */
int argc_vnc = 1; char *argv_vnc[128]; int argc_vnc = 1; char *argv_vnc[128];
...@@ -1519,7 +1608,13 @@ int main(int argc, char* argv[]) { ...@@ -1519,7 +1608,13 @@ int main(int argc, char* argv[]) {
} }
} else if (!strcmp(arg, "-nopw")) { } else if (!strcmp(arg, "-nopw")) {
nopw = 1; nopw = 1;
} else if (!strcmp(arg, "-usepw")) {
usepw = 1;
} else if (!strcmp(arg, "-storepasswd")) { } else if (!strcmp(arg, "-storepasswd")) {
if (i+1 >= argc) {
store_homedir_passwd();
exit(0);
}
if (i+2 >= argc || rfbEncryptAndStorePasswd(argv[i+1], if (i+2 >= argc || rfbEncryptAndStorePasswd(argv[i+1],
argv[i+2]) != 0) { argv[i+2]) != 0) {
fprintf(stderr, "-storepasswd failed\n"); fprintf(stderr, "-storepasswd failed\n");
...@@ -1667,8 +1762,15 @@ int main(int argc, char* argv[]) { ...@@ -1667,8 +1762,15 @@ int main(int argc, char* argv[]) {
} else if (!strcmp(arg, "-nosel")) { } else if (!strcmp(arg, "-nosel")) {
watch_selection = 0; watch_selection = 0;
watch_primary = 0; watch_primary = 0;
watch_clipboard = 0;
} else if (!strcmp(arg, "-noprimary")) { } else if (!strcmp(arg, "-noprimary")) {
watch_primary = 0; watch_primary = 0;
} else if (!strcmp(arg, "-nosetprimary")) {
set_primary = 0;
} else if (!strcmp(arg, "-noclipboard")) {
watch_clipboard = 0;
} else if (!strcmp(arg, "-nosetclipboard")) {
set_clipboard = 0;
} else if (!strcmp(arg, "-seldir")) { } else if (!strcmp(arg, "-seldir")) {
CHECK_ARGC CHECK_ARGC
sel_direction = strdup(argv[++i]); sel_direction = strdup(argv[++i]);
...@@ -1890,6 +1992,8 @@ int main(int argc, char* argv[]) { ...@@ -1890,6 +1992,8 @@ int main(int argc, char* argv[]) {
debug_tiles++; debug_tiles++;
} else if (!strcmp(arg, "-debug_grabs")) { } else if (!strcmp(arg, "-debug_grabs")) {
debug_grabs++; debug_grabs++;
} else if (!strcmp(arg, "-debug_sel")) {
debug_sel++;
} else if (!strcmp(arg, "-grab_buster")) { } else if (!strcmp(arg, "-grab_buster")) {
grab_buster++; grab_buster++;
} else if (!strcmp(arg, "-nograb_buster")) { } else if (!strcmp(arg, "-nograb_buster")) {
...@@ -2109,6 +2213,83 @@ int main(int argc, char* argv[]) { ...@@ -2109,6 +2213,83 @@ int main(int argc, char* argv[]) {
} }
} }
if (usepw && ! got_rfbauth && ! got_passwd && ! got_passwdfile) {
char *f, *h = getenv("HOME");
struct stat sbuf;
int found = 0, set_rfbauth = 0;
if (!h) {
rfbLog("HOME unset in -usepw mode.\n");
exit(1);
}
f = (char *) malloc(strlen(h)+strlen("/.vnc/passwdfile") + 1);
sprintf(f, "%s/.vnc/passwd", h);
if (stat(f, &sbuf) == 0) {
found = 1;
if (! quiet) {
rfbLog("-usepw: found %s\n", f);
}
got_rfbauth = 1;
set_rfbauth = 1;
}
sprintf(f, "%s/.vnc/passwdfile", h);
if (! found && stat(f, &sbuf) == 0) {
found = 1;
if (! quiet) {
rfbLog("-usepw: found %s\n", f);
}
got_passwdfile = 1;
passwdfile = strdup(f);
}
#if LIBVNCSERVER_HAVE_FORK
#if LIBVNCSERVER_HAVE_SYS_WAIT_H
#if LIBVNCSERVER_HAVE_WAITPID
if (! found) {
pid_t pid = fork();
if (pid < 0) {
;
} else if (pid == 0) {
execlp(argv[0], argv[0], "-storepasswd",
(char *) NULL);
exit(1);
} else {
int s;
waitpid(pid, &s, 0);
if (WIFEXITED(s) && WEXITSTATUS(s) == 0) {
got_rfbauth = 1;
set_rfbauth = 1;
found = 1;
}
}
}
#endif
#endif
#endif
if (set_rfbauth) {
sprintf(f, "%s/.vnc/passwd", h);
if (argc_vnc < 100) {
argv_vnc[argc_vnc++] = strdup("-rfbauth");
} else {
exit(1);
}
if (argc_vnc < 100) {
argv_vnc[argc_vnc++] = strdup(f);
} else {
exit(1);
}
}
if (! found) {
fprintf(stderr, "x11vnc -usepw: could not find"
" a password to use.\n");
exit(1);
}
free(f);
}
if (got_rfbauth && (got_passwd || got_viewpasswd || got_passwdfile)) { if (got_rfbauth && (got_passwd || got_viewpasswd || got_passwdfile)) {
fprintf(stderr, "option -rfbauth is incompatible with:\n"); fprintf(stderr, "option -rfbauth is incompatible with:\n");
fprintf(stderr, " -passwd, -viewpasswd, and -passwdfile\n"); fprintf(stderr, " -passwd, -viewpasswd, and -passwdfile\n");
......
...@@ -37,9 +37,10 @@ ...@@ -37,9 +37,10 @@
/****************************************************************************/ /****************************************************************************/
/* Build-time customization via CPPFLAGS. */
/* /*
* Build-time customization via CPPFLAGS.
*
* Summary of options to include in CPPFLAGS for custom builds: * Summary of options to include in CPPFLAGS for custom builds:
* *
* -DVNCSHARED to have the vnc display shared by default. * -DVNCSHARED to have the vnc display shared by default.
...@@ -63,6 +64,7 @@ ...@@ -63,6 +64,7 @@
* -DWIREFRAME_PARMS=... set default -wirecopyrect parameters. * -DWIREFRAME_PARMS=... set default -wirecopyrect parameters.
* -DSCROLL_COPYRECT=0 to have -noscrollcopyrect as the default. * -DSCROLL_COPYRECT=0 to have -noscrollcopyrect as the default.
* -DSCROLL_COPYRECT_PARMS=... set default -scrollcopyrect parameters. * -DSCROLL_COPYRECT_PARMS=... set default -scrollcopyrect parameters.
* -DSCALING_COPYRECT=0
* -DXDAMAGE=0 to have -noxdamage as the default. * -DXDAMAGE=0 to have -noxdamage as the default.
* -DSKIPDUPS=0 to have -noskip_dups as the default or vice versa. * -DSKIPDUPS=0 to have -noskip_dups as the default or vice versa.
* *
...@@ -71,6 +73,8 @@ ...@@ -71,6 +73,8 @@
* -DSMALL_FOOTPRINT=1 for smaller binary size (no help, no gui, etc) * -DSMALL_FOOTPRINT=1 for smaller binary size (no help, no gui, etc)
* use 2 or 3 for even smaller footprint. * use 2 or 3 for even smaller footprint.
* -DNOGUI do not include the gui tkx11vnc. * -DNOGUI do not include the gui tkx11vnc.
* -DPOLL_8TO24_DELAY=N
* -DDEBUG_XEVENTS=1 enable printout for X events.
* *
* Set these in CPPFLAGS before running configure. E.g.: * Set these in CPPFLAGS before running configure. E.g.:
* *
......
...@@ -15,7 +15,7 @@ int xtrap_base_event_type = 0; ...@@ -15,7 +15,7 @@ int xtrap_base_event_type = 0;
int xdamage_base_event_type = 0; int xdamage_base_event_type = 0;
/* date +'lastmod: %Y-%m-%d' */ /* date +'lastmod: %Y-%m-%d' */
char lastmod[] = "0.8.1 lastmod: 2006-03-06"; char lastmod[] = "0.8.1 lastmod: 2006-03-08";
/* X display info */ /* X display info */
......
...@@ -19,6 +19,7 @@ int sync_tod_delay = 3; ...@@ -19,6 +19,7 @@ int sync_tod_delay = 3;
void initialize_vnc_connect_prop(void); void initialize_vnc_connect_prop(void);
void initialize_x11vnc_remote_prop(void); void initialize_x11vnc_remote_prop(void);
void initialize_clipboard_atom(void);
void spawn_grab_buster(void); void spawn_grab_buster(void);
void sync_tod_with_servertime(void); void sync_tod_with_servertime(void);
void check_keycode_state(void); void check_keycode_state(void);
...@@ -45,11 +46,25 @@ void initialize_x11vnc_remote_prop(void) { ...@@ -45,11 +46,25 @@ void initialize_x11vnc_remote_prop(void) {
x11vnc_remote_prop = XInternAtom(dpy, "X11VNC_REMOTE", False); x11vnc_remote_prop = XInternAtom(dpy, "X11VNC_REMOTE", False);
} }
void initialize_clipboard_atom(void) {
clipboard_atom = XInternAtom(dpy, "CLIPBOARD", False);
if (clipboard_atom == None) {
if (! quiet) rfbLog("could not find atom CLIPBOARD\n");
if (watch_clipboard) {
watch_clipboard = 0;
}
if (set_clipboard) {
set_clipboard = 0;
}
}
}
static void initialize_xevents(void) { static void initialize_xevents(void) {
static int did_xselect_input = 0; static int did_xselect_input = 0;
static int did_xcreate_simple_window = 0; static int did_xcreate_simple_window = 0;
static int did_vnc_connect_prop = 0; static int did_vnc_connect_prop = 0;
static int did_x11vnc_remote_prop = 0; static int did_x11vnc_remote_prop = 0;
static int did_clipboard_atom = 0;
static int did_xfixes = 0; static int did_xfixes = 0;
static int did_xdamage = 0; static int did_xdamage = 0;
static int did_xrandr = 0; static int did_xrandr = 0;
...@@ -90,6 +105,10 @@ static void initialize_xevents(void) { ...@@ -90,6 +105,10 @@ static void initialize_xevents(void) {
kill(run_gui_pid, SIGUSR1); kill(run_gui_pid, SIGUSR1);
run_gui_pid = 0; run_gui_pid = 0;
} }
if (!did_clipboard_atom) {
initialize_clipboard_atom();
did_clipboard_atom = 1;
}
if (xfixes_present && use_xfixes && !did_xfixes) { if (xfixes_present && use_xfixes && !did_xfixes) {
initialize_xfixes(); initialize_xfixes();
did_xfixes = 1; did_xfixes = 1;
...@@ -662,13 +681,13 @@ void check_xevents(void) { ...@@ -662,13 +681,13 @@ void check_xevents(void) {
XEvent xev; XEvent xev;
int tmp, have_clients = 0; int tmp, have_clients = 0;
static int sent_some_sel = 0; static int sent_some_sel = 0;
static time_t last_request = 0;
static time_t last_call = 0; static time_t last_call = 0;
static time_t last_bell = 0; static time_t last_bell = 0;
static time_t last_init_check = 0; static time_t last_init_check = 0;
static time_t last_sync = 0; static time_t last_sync = 0;
static time_t last_time_sync = 0; static time_t last_time_sync = 0;
time_t now = time(0); time_t now = time(0);
static double last_request = 0.0;
if (raw_fb && ! dpy) return; /* raw_fb hack */ if (raw_fb && ! dpy) return; /* raw_fb hack */
...@@ -798,56 +817,119 @@ void check_xevents(void) { ...@@ -798,56 +817,119 @@ void check_xevents(void) {
#endif #endif
/* check for our PRIMARY request notification: */ /* check for our PRIMARY request notification: */
if (watch_primary) { if (watch_primary || watch_clipboard) {
int doprimary = 1, doclipboard = 2, which, own;
double delay = 1.0;
Atom atom;
char *req;
if (XCheckTypedEvent(dpy, SelectionNotify, &xev)) { if (XCheckTypedEvent(dpy, SelectionNotify, &xev)) {
if (xev.type == SelectionNotify && if (xev.type == SelectionNotify &&
xev.xselection.requestor == selwin && xev.xselection.requestor == selwin &&
xev.xselection.selection == XA_PRIMARY &&
xev.xselection.property != None && xev.xselection.property != None &&
xev.xselection.target == XA_STRING) { xev.xselection.target == XA_STRING) {
Atom s = xev.xselection.selection;
/* go retrieve PRIMARY and check it */ if (s == XA_PRIMARY || s == clipboard_atom) {
if (now > last_client + sel_waittime /* go retrieve it and check it */
|| sent_some_sel) { if (now > last_client + sel_waittime
selection_send(&xev); || sent_some_sel) {
selection_send(&xev);
}
} }
} }
} }
if (now > last_request) { /*
* Every second or so, request PRIMARY or CLIPBOARD,
* unless we already own it or there is no owner or we
* have no clients.
* TODO: even at this low rate we should look into
* and performance problems in odds cases (large text,
* modem, etc.)
*/
which = 0;
if (watch_primary && watch_clipboard && ! own_clipboard &&
! own_primary) {
delay = 0.6;
}
if (dnow() > last_request + delay) {
/* /*
* Every second or two, request PRIMARY, unless we * It is not a good idea to do both at the same
* already own it or there is no owner or we have * time so we must choose one:
* no clients.
* TODO: even at this low rate we should look into
* and performance problems in odds cases, etc.
*/ */
last_request = now; if (watch_primary && watch_clipboard) {
if (! own_selection && have_clients && static int count = 0;
XGetSelectionOwner(dpy, XA_PRIMARY) != None) { if (own_clipboard) {
XConvertSelection(dpy, XA_PRIMARY, XA_STRING, which = doprimary;
XA_STRING, selwin, CurrentTime); } else if (own_primary) {
which = doclipboard;
} else if (count++ % 3 == 0) {
which = doclipboard;
} else {
which = doprimary;
}
} else if (watch_primary) {
which = doprimary;
} else if (watch_clipboard) {
which = doclipboard;
}
last_request = dnow();
}
atom = None;
req = "none";
if (which == doprimary) {
own = own_primary;
atom = XA_PRIMARY;
req = "PRIMARY";
} else if (which == doclipboard) {
own = own_clipboard;
atom = clipboard_atom;
req = "CLIPBOARD";
}
if (which != 0 && ! own && have_clients &&
XGetSelectionOwner(dpy, atom) != None) {
XConvertSelection(dpy, atom, XA_STRING, XA_STRING,
selwin, CurrentTime);
if (debug_sel) {
rfbLog("request %s\n", req);
} }
} }
} }
if (own_selection) { if (own_primary || own_clipboard) {
/* we own PRIMARY, see if someone requested it: */ /* we own PRIMARY or CLIPBOARD, see if someone requested it: */
if (XCheckTypedEvent(dpy, SelectionRequest, &xev)) { if (XCheckTypedEvent(dpy, SelectionRequest, &xev)) {
if (xev.type == SelectionRequest && if (own_primary && xev.type == SelectionRequest &&
xev.xselectionrequest.selection == XA_PRIMARY) { xev.xselectionrequest.selection == XA_PRIMARY) {
selection_request(&xev); selection_request(&xev, "PRIMARY");
}
if (own_clipboard && xev.type == SelectionRequest &&
xev.xselectionrequest.selection == clipboard_atom) {
selection_request(&xev, "CLIPBOARD");
} }
} }
/* we own PRIMARY, see if we no longer own it: */ /* we own PRIMARY or CLIPBOARD, see if we no longer own it: */
if (XCheckTypedEvent(dpy, SelectionClear, &xev)) { if (XCheckTypedEvent(dpy, SelectionClear, &xev)) {
if (xev.type == SelectionClear && if (own_primary && xev.type == SelectionClear &&
xev.xselectionclear.selection == XA_PRIMARY) { xev.xselectionclear.selection == XA_PRIMARY) {
own_primary = 0;
own_selection = 0; if (xcut_str_primary) {
if (xcut_str) { free(xcut_str_primary);
free(xcut_str); xcut_str_primary = NULL;
xcut_str = NULL; }
if (debug_sel) {
rfbLog("Released PRIMARY.\n");
}
}
if (own_clipboard && xev.type == SelectionClear &&
xev.xselectionclear.selection == clipboard_atom) {
own_clipboard = 0;
if (xcut_str_clipboard) {
free(xcut_str_clipboard);
xcut_str_clipboard = NULL;
}
if (debug_sel) {
rfbLog("Released CLIPBOARD.\n");
} }
} }
} }
...@@ -986,21 +1068,51 @@ void xcut_receive(char *text, int len, rfbClientPtr cl) { ...@@ -986,21 +1068,51 @@ void xcut_receive(char *text, int len, rfbClientPtr cl) {
X_LOCK; X_LOCK;
/* associate this text with PRIMARY (and SECONDARY...) */ /* associate this text with PRIMARY (and SECONDARY...) */
if (! own_selection) { if (set_primary && ! own_primary) {
own_selection = 1; own_primary = 1;
/* we need to grab the PRIMARY selection */ /* we need to grab the PRIMARY selection */
XSetSelectionOwner(dpy, XA_PRIMARY, selwin, CurrentTime); XSetSelectionOwner(dpy, XA_PRIMARY, selwin, CurrentTime);
XFlush(dpy); XFlush(dpy);
if (debug_sel) {
rfbLog("Own PRIMARY.\n");
}
}
if (set_clipboard && ! own_clipboard && clipboard_atom != None) {
own_clipboard = 1;
/* we need to grab the CLIPBOARD selection */
XSetSelectionOwner(dpy, clipboard_atom, selwin, CurrentTime);
XFlush(dpy);
if (debug_sel) {
rfbLog("Own CLIPBOARD.\n");
}
} }
/* duplicate the text string for our own use. */ /* duplicate the text string for our own use. */
if (xcut_str != NULL) { if (set_primary) {
free(xcut_str); if (xcut_str_primary != NULL) {
xcut_str = NULL; free(xcut_str_primary);
xcut_str_primary = NULL;
}
xcut_str_primary = (char *) malloc((size_t) (len+1));
strncpy(xcut_str_primary, text, len);
xcut_str_primary[len] = '\0'; /* make sure null terminated */
if (debug_sel) {
rfbLog("Set PRIMARY '%s'\n", xcut_str_primary);
}
}
if (set_clipboard) {
if (xcut_str_clipboard != NULL) {
free(xcut_str_clipboard);
xcut_str_clipboard = NULL;
}
xcut_str_clipboard = (char *) malloc((size_t) (len+1));
strncpy(xcut_str_clipboard, text, len);
xcut_str_clipboard[len] = '\0'; /* make sure null terminated */
if (debug_sel) {
rfbLog("Set CLIPBOARD '%s'\n", xcut_str_clipboard);
}
} }
xcut_str = (char *) malloc((size_t) (len+1));
strncpy(xcut_str, text, len);
xcut_str[len] = '\0'; /* make sure null terminated */
/* copy this text to CUT_BUFFER0 as well: */ /* copy this text to CUT_BUFFER0 as well: */
XChangeProperty(dpy, rootwin, XA_CUT_BUFFER0, XA_STRING, 8, XChangeProperty(dpy, rootwin, XA_CUT_BUFFER0, XA_STRING, 8,
......
...@@ -8,6 +8,7 @@ extern int sync_tod_delay; ...@@ -8,6 +8,7 @@ extern int sync_tod_delay;
extern void initialize_vnc_connect_prop(void); extern void initialize_vnc_connect_prop(void);
extern void initialize_x11vnc_remote_prop(void); extern void initialize_x11vnc_remote_prop(void);
extern void initialize_clipboard_atom(void);
extern void spawn_grab_buster(void); extern void spawn_grab_buster(void);
extern void sync_tod_with_servertime(void); extern void sync_tod_with_servertime(void);
extern void check_keycode_state(void); extern void check_keycode_state(void);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment