diff options
Diffstat (limited to 'x11vnc')
-rw-r--r-- | x11vnc/ChangeLog | 13 | ||||
-rw-r--r-- | x11vnc/README | 1756 | ||||
-rw-r--r-- | x11vnc/misc/README | 1 | ||||
-rwxr-xr-x | x11vnc/tkx11vnc | 10 | ||||
-rw-r--r-- | x11vnc/tkx11vnc.h | 10 | ||||
-rw-r--r-- | x11vnc/x11vnc.1 | 171 | ||||
-rw-r--r-- | x11vnc/x11vnc.c | 2242 |
7 files changed, 3108 insertions, 1095 deletions
diff --git a/x11vnc/ChangeLog b/x11vnc/ChangeLog index 0224880..dffbb81 100644 --- a/x11vnc/ChangeLog +++ b/x11vnc/ChangeLog @@ -1,6 +1,17 @@ +2005-04-19 Karl Runge <runge@karlrunge.com> + * somewhat safer remote-control defaults, and addnl options for + more safe operation: -privremote, -safer, -nocmds, -unsafe + * -wireframe, -wirecopyrect: instead of having user look at a + slowly moving, lurching window, guess when a window is being + moved/resized and just show a wireframe. -wirecopyrect means to + apply rfbDoCopyRegion to the detected move as well. + * debugging switches for X events and X damage: debug_xevents + debug_xdamage. + * -rawfb bugfixes. -noviewonly hack to still send UI to X. + 2005-04-11 Karl Runge <runge@karlrunge.com> * fix -clip under -rawfb, fix offset bug under file lseeking. - * add -rawfb setup:cmd mode to initialize fb. ex: misc/ranfb.pl + * add -rawfb setup:cmd mode to initialize fb. example: misc/ranfb.pl 2005-04-10 Karl Runge <runge@karlrunge.com> * -rawfb non X-polling (i.e. shm, mmap, lseek). diff --git a/x11vnc/README b/x11vnc/README index f2bffbd..74b92ad 100644 --- a/x11vnc/README +++ b/x11vnc/README @@ -1,5 +1,5 @@ -x11vnc README file Date: Mon Apr 11 16:12:34 EDT 2005 +x11vnc README file Date: Tue Apr 19 16:26:20 EDT 2005 The following information is taken from these URLs: @@ -15,7 +15,7 @@ http://www.karlrunge.com/x11vnc/index.html: x11vnc: a VNC server for real X displays (to [1]FAQ) (to [2]Downloads) (to [3]Building) (to -[4]Contrib) +[4]Donations) (to [5]Beta Test) x11vnc allows one to remotely view and interact with real X displays (i.e. a display corresponding to a physical monitor, keyboard, and @@ -27,8 +27,8 @@ x11vnc: a VNC server for real X displays problems centered around esoteric C++ toolkits. x11vnc is written in plain C and uses only standard libraries. I also added a few enhancements to improve the interactive response, add esoteric - features, etc. The [5]FAQ contains a lot of information and solutions - to problems, but please feel free to [6]contact me if you have + features, etc. The [6]FAQ contains a lot of information and solutions + to problems, but please feel free to [7]contact me if you have problems or questions. Background: @@ -40,9 +40,9 @@ x11vnc: a VNC server for real X displays framebuffer (RFB) protocol Some VNC links: - * [7]http://www.uk.research.att.com/vnc/ - * [8]http://www.realvnc.com - * [9]http://www.tightvnc.com + * [8]http://www.uk.research.att.com/vnc/ + * [9]http://www.realvnc.com + * [10]http://www.tightvnc.com For Unix, the VNC implementation includes a virtual X11 server Xvnc (usually launched via the vncserver command) that is not associated @@ -80,9 +80,9 @@ x11vnc: a VNC server for real X displays display you wish to view is "far-away.east:0" and the workstation you are presently working at is "sitting-here.west". - Step 0. Download x11vnc ([10]see below) and have it available to run + Step 0. Download x11vnc ([11]see below) and have it available to run on far-away.east. Similarly, have a VNC viewer (e.g. vncviewer) ready - to run on sitting-here.west. We recommend [11]TightVNC Viewers. + to run on sitting-here.west. We recommend [12]TightVNC Viewers. Step 1. By some means log in to far-away.east and get a command shell running there. You can use ssh, rlogin, telnet, or any other method to @@ -100,9 +100,9 @@ x11vnc: a VNC server for real X displays display (i.e. no viewer clients yet). To get X11 permissions right, you may also need to set the XAUTHORITY - environment variable (or use the [12]-auth option) to point to the + environment variable (or use the [13]-auth option) to point to the correct MIT-MAGIC-COOKIE file (e.g. /home/joe/.Xauthority). More on - this [13]below. + this [14]below. If you suspect an X11 permissions problem do this simple test: while sitting at the physical X display open a terminal window @@ -127,8 +127,8 @@ x11vnc: a VNC server for real X displays viewers for Unix, Windows, MacOS, Java-enabled web browsers, and even for PDA's like the Palm Pilot! You can use any of them to connect to x11vnc (see the above VNC links under "Background:" on how to obtain a - viewer for your platform or see [14]this FAQ. For Solaris, vncviewer - is available in the [15]Companion CD package SFWvnc ). + viewer for your platform or see [15]this FAQ. For Solaris, vncviewer + is available in the [16]Companion CD package SFWvnc ). In this example we'll use the Unix vncviewer program on sitting-here by typing the following command in a second terminal window: @@ -138,13 +138,13 @@ x11vnc: a VNC server for real X displays That should pop up a viewer window on sitting-here.west showing and allowing interaction with the far-away.east:0 X11 desktop. Pretty nifty! When finished, exit the viewer: the remote x11vnc process will - shutdown automatically (or you can use the [16]-forever option to have + shutdown automatically (or you can use the [17]-forever option to have it wait for additional viewer connections). Shortcut: Of course if you left x11vnc running on far-away.east:0 in a - terminal window with the [17]-forever option or as a [18]service, + terminal window with the [18]-forever option or as a [19]service, you'd only have to do Step 3 as you moved around. Be sure to use a VNC - [19]password or [20]other measures if you do that. + [20]password or [21]other measures if you do that. Desktop Sharing: The above more or less assumed nobody was sitting at @@ -160,7 +160,7 @@ x11vnc: a VNC server for real X displays For these cases it should be obvious how it is done. The above steps will work, but more easily the user sitting at far-away.east:0 simply starts up x11vnc from a terminal window, after which the guests would - start their VNC viewers. For this usage mode the "[21]-connect + start their VNC viewers. For this usage mode the "[22]-connect host1,host2" option may be of use automatically connect to vncviewers in "-listen" mode on the list of hosts. _________________________________________________________________ @@ -178,8 +178,8 @@ x11vnc: a VNC server for real X displays command: sitting-here> vncviewer -encodings "copyrect tight zrle hextile" localhost:0 - The -encodings option is very important: vncviewer will default to - "raw" encoding if it thinks the connection is to the local machine, + Note: The -encodings option is very important: vncviewer will default + to "raw" encoding if it thinks the connection is to the local machine, and so vncviewer gets tricked this way by the ssh redirection. "raw" encoding will be extremely slow over a networked link, so you need to force the issue with -encodings "copyrect tight ...". @@ -187,8 +187,8 @@ x11vnc: a VNC server for real X displays Some VNC viewers will do the ssh tunnelling for you automatically, the TightVNC vncviewer does this when the "-via far-away.east" option is supplied to it (this requires x11vnc to be already running on - far-away.east or having it started by [22]inetd(1)). See the 3rd - script example [23]below for more info. + far-away.east or having it started by [23]inetd(1)). See the 3rd + script example [24]below for more info. If the machine you SSH into is not the same machine with the X display you wish to view (e.g. your company provides incoming SSH access to a @@ -204,7 +204,7 @@ x11vnc: a VNC server for real X displays above port and display numbers may change a bit (e.g. -> 5901 and :1). However, if you "know" port 5900 will be free on the local and remote machines, you can easily automate the above two steps by using the - x11vnc option [24]-bg (forks into background after connection to the + x11vnc option [25]-bg (forks into background after connection to the display is set up) or using the -f option of ssh. Three example scripts are shown below. _________________________________________________________________ @@ -235,7 +235,7 @@ done #2. Another method is to start the VNC viewer in listen mode "vncviewer -listen" and have x11vnc initiate a reverse connection - using the [25]-connect option: + using the [26]-connect option: #!/bin/sh # usage: x11vnc_ssh <host>:<xdisplay> # e.g.: x11vnc_ssh snoopy.peanuts.com:0 @@ -277,52 +277,52 @@ export VNC_VIA_CMD vncviewer -via $host localhost:0 # must be TightVNC vncviewer. Of course if you already have the x11vnc running waiting for - connections (or have it started out of [26]inetd(1)), you can simply + connections (or have it started out of [27]inetd(1)), you can simply use the TightVNC "vncviewer -via gateway host:port" in its default mode to provide secure ssh tunnelling. VNC password file: Also note in the #1. example script that the - [27]option "-rfbauth .vnc/passwd" provides additional protection by + [28]option "-rfbauth .vnc/passwd" provides additional protection by requiring a VNC password for every VNC viewer that connects. The - vncpasswd or storepasswd programs, or the x11vnc [28]-storepasswd + vncpasswd or storepasswd programs, or the x11vnc [29]-storepasswd option can be used to create the password file. x11vnc also has the - slightly less secure [29]-passwdfile and "-passwd XXXXX" [30]options + slightly less secure [30]-passwdfile and "-passwd XXXXX" [31]options to specify passwords. Important: It is up to you to tell x11vnc to use password protection, it will not do it for you automatically or force you to. The same goes for encrypting the channel between the viewer and x11vnc: it is up to you to use ssh, stunnel, VPN, etc. Also look into the -allow and - -localhost [31]options and building x11vnc with [32]tcp_wrappers + -localhost [32]options and building x11vnc with [33]tcp_wrappers support to limit host access. _________________________________________________________________ Downloading x11vnc: - x11vnc is a contributed program to the [33]LibVNCServer project at + x11vnc is a contributed program to the [34]LibVNCServer project at SourceForge.net. I use libvncserver for all of the VNC aspects; I couldn't have done without it. The full source code may be found and downloaded (either file-release tarball or CVS tree) from the above - link. As of Feb 2005, the [34]x11vnc-0.7.1.tar.gz source package is - released (recommended download) . The [35]x11vnc 0.7.1 release notes. + link. As of Feb 2005, the [35]x11vnc-0.7.1.tar.gz source package is + released (recommended download) . The [36]x11vnc 0.7.1 release notes. The x11vnc package is the subset of the libvncserver package needed to build the x11vnc program. Also, you can get a copy of my latest, - bleeding edge [36]x11vnc.c file to replace the one in the above + bleeding edge [37]x11vnc.c file to replace the one in the above packages or the one in the CVS tree and then rebuild. You can also - update the tcl/tk gui with the [37]tkx11vnc.h file. If you have an + update the tcl/tk gui with the [38]tkx11vnc.h file. If you have an older libvncserver source tree, you may need to switch on the OLD_TREE variable near the top of the x11vnc.c file. - See the [38]FAQ below for information about where you might obtain a + See the [39]FAQ below for information about where you might obtain a precompiled x11vnc binary from 3rd parties. To obtain VNC viewers for the viewing side (Windows, Mac OS, or Unix) try these links: - * [39]http://www.tightvnc.com/download.html - * [40]http://www.realvnc.com/download-free.html - * [41]http://sourceforge.net/projects/cotvnc/ + * [40]http://www.tightvnc.com/download.html + * [41]http://www.realvnc.com/download-free.html + * [42]http://sourceforge.net/projects/cotvnc/ More tools: Here is a rsh/ssh wrapper script rx11vnc that attempts to @@ -333,8 +333,8 @@ vncviewer -via $host localhost:0 # must be TightVNC vncviewer. rx11vnc.pl that attempts to tunnel the vnc traffic through an ssh port redirection (and does not assume port 5900 is free). Have a look at them to see what they do and customize as needed: - * [42]rx11vnc wrapper script - * [43]rx11vnc.pl wrapper script to tunnel traffic thru ssh + * [43]rx11vnc wrapper script + * [44]rx11vnc.pl wrapper script to tunnel traffic thru ssh _________________________________________________________________ @@ -364,7 +364,7 @@ vncviewer -via $host localhost:0 # must be TightVNC vncviewer. Note: Currently gcc is required to build libvncserver. In some cases it will build with non-gcc compilers, but the resulting binary often fails to run properly. For Solaris pre-built gcc binaries are at - [44]http://www.sunfreeware.com/ However, one user reports it does + [45]http://www.sunfreeware.com/ However, one user reports it does work fine when built with Sun Studio 10, so YMMV. _________________________________________________________________ @@ -406,9 +406,9 @@ r/sfw; make' If your system does not have these libraries at all you can get the source for the libraries to build them: libjpeg is available at - [45]ftp://ftp.uu.net/graphics/jpeg/ and zlib at - [46]http://www.gzip.org/zlib/. See also - [47]http://www.sunfreeware.com/ for Solaris binary packages of these + [46]ftp://ftp.uu.net/graphics/jpeg/ and zlib at + [47]http://www.gzip.org/zlib/. See also + [48]http://www.sunfreeware.com/ for Solaris binary packages of these libraries as well as for gcc. Normally they will install into /usr/local but you can install them anywhere with the --prefix=/path/to/anywhere, etc. @@ -480,7 +480,7 @@ ls -l ./x11vnc/x11vnc like that. If you need to build on Solaris 2.5.1 or earlier or other older Unix - OS's, see [48]this workaround FAQ. + OS's, see [49]this workaround FAQ. Building on FreeBSD, OpenBSD, ...: The jpeg libraries seem to be in /usr/local or /usr/pkg on these OS's. You won't need the openwin stuff @@ -516,6 +516,20 @@ make $HOME/hpux/... directories. _________________________________________________________________ + Beta Testing: + + I don't have any formal beta-testers for the releases of x11vnc, so + I'd appreciate any additional testing very much! + + I'd like to release version 0.7.2 in Apr/May 2005 sometime, here is + the current tarball: [50]x11vnc-0.7.2.tar.gz. Please kick the tires, + and report bugs, performance regressions, etc. to [51]me. + + Here is what is shaping up to be [52]the release notes for 0.7.2.. + Note that the [53]X DAMAGE feature will be on by default and so I am + interested if that causes any problems. Thanks! + _________________________________________________________________ + Some Notes: Both a client and a server: It is sometimes confusing to people that @@ -526,8 +540,8 @@ make viewers on the network can connect to and view the screen framebuffer it manages. - When trying debug problems, remember to think of both roles. E.g. "how - is x11vnc connecting to the X server?", "how is the vncviewer + When trying to debug problems, remember to think of both roles. E.g. + "how is x11vnc connecting to the X server?", "how is the vncviewer connecting to x11vnc?", "what permits/restricts the connection?". Both links may have reachability, permission, and other issues. @@ -541,10 +555,10 @@ make a solid background while using x11vnc. You can turn the pretty background image back on when you are using the display directly. Update: As of Feb/2005 in the libvncserver CVS, x11vnc has the - [49]-solid [color] option that works on recent GNOME, KDE, and CDE and + [54]-solid [color] option that works on recent GNOME, KDE, and CDE and also on classic X (background image is on the root window). - I also find the [50]TightVNC encoding gives the best response for my + I also find the [55]TightVNC encoding gives the best response for my usage (Unix <-> Unix over cable modem). One needs a tightvnc-aware vncviewer to take advantage of this encoding. @@ -556,16 +570,16 @@ make is X11's default listening port). Had port 5900 been taken by some other application, x11vnc would have next tried 5901. That would mean the viewer command above should be changed to vncviewer - far-away.east:1. You can force the issue with the "[51]-rfbport NNNN" + far-away.east:1. You can force the issue with the "[56]-rfbport NNNN" option where NNNN is the desired port number. If that port is already taken, x11vnc will exit immediately. (also see the "SunRay Gotcha" note below) Options: x11vnc has (far too) many features that may be activated - via its [52]command line options. Useful options are -nap to use fewer + via its [57]command line options. Useful options are -nap to use fewer resources (it sleeps more between polls when activity is low) and -rfbauth passwd-file to use VNC password protection (the vncpasswd or - storepasswd programs, or the x11vnc [53]-storepasswd option can be + storepasswd programs, or the x11vnc [58]-storepasswd option can be used to create the password file). Algorithm: How does x11vnc do it? Rather brute-forcedly: it @@ -593,15 +607,15 @@ make first testing out the programs. You get an interesting "feedback" effect where vncviewer images keep popping up each one contained in the previous one and slightly shifted a bit by the window manager - decorations. There will be an [54]even more interesting effect if + decorations. There will be an [59]even more interesting effect if -scale is used. Also, if the XKEYBOARD is supported and the XBell "beeps" once, you get an infinite loop of beeps going off. Although all of this is mildly exciting it is not much use: you will normally run and display the viewer on a different machine! SunRay notes: You can run x11vnc on your (connected or disconnected) - [55]SunRay session (Please remember to use [56]-nap and maybe - [57]-wait 200 to avoid being a resource hog! It also helps to have a + [60]SunRay session (Please remember to use [61]-nap and maybe + [62]-wait 200 to avoid being a resource hog! It also helps to have a solid background color). You have to know the name of the machine your SunRay session X server is running on. You also need to know the X11 DISPLAY number for the session: on a SunRay it could be a large @@ -624,7 +638,7 @@ make sunray-server:0 (note the :0 corresponding to port 5900, it is not :137). If it cannot get 5900, it tries for 5901, and so on. You can also try to force the port (and thereby the VNC display) using the - [58]-rfbport NNNN option. + [63]-rfbport NNNN option. SunRay Gotcha #2: If you get an error like: shmget(tile) failed. @@ -637,7 +651,7 @@ make dies) the slot is not reclaimed. You can view the shm slots with the "ipcs -mA" command. If there are about 100 then you've probably hit this problem. They can be cleaned out (by the owner or by root) using - the ipcrm command. I wrote a script [59]shm_clear that finds the + the ipcrm command. I wrote a script [64]shm_clear that finds the orphans and lists or removes them. Longer term, have your SunRay sysadmin add something like this to /etc/system: set shmsys:shminfo_shmmax = 0x2000000 @@ -665,7 +679,8 @@ make you can run the benchmarks like: x11perf -getimage500, x11perf -putimage500, x11perf -shmput500 and for XFree86 displays with direct graphics access the dga command (press "b" to run the - benchmark and then after a few seconds press "q" to quit). + benchmark and then after a few seconds press "q" to quit). Even + this "dd if=/dev/fb0 of=/dev/null" often gives a good estimate. On XFree86 it is actually possible to increase the framebuffer read speed considerably (5-100 times) by using the Shadow Framebuffer (a copy of the framebuffer is kept in main memory and @@ -689,10 +704,10 @@ make * Somewhat surprisingly, the X11 mouse (cursor) shape is write-only and cannot be queried from the X server. So in x11vnc the cursor shape stays fixed at an arrow. (see the "-cursor X" and "-cursor - some" [60]options, however, for a partial hack for the root + some" [65]options, however, for a partial hack for the root window, etc.). Also, on Solaris using the SUN_OVL overlay extension, x11vnc can show the correct mouse cursor when the - [61]-overlay option is also supplied. A similar thing is done on + [66]-overlay option is also supplied. A similar thing is done on IRIX as well when -overlay is supplied. As of Dec/2004 x11vnc supports the XFIXES extension (in Xorg and Solaris 10) to query the X server for the exact cursor shape, this works pretty well @@ -707,9 +722,9 @@ make Evidently a timing related bug and difficult to reproduce... * Using -threads can expose some bugs in libvncserver. - Please feel free to [62]contact me if you have any questions, + Please feel free to [67]contact me if you have any questions, problems, or comments about x11vnc, etc. - Also, some people ask if they can make a donation, see [63]this link + Also, some people ask if they can make a donation, see [68]this link for that. _________________________________________________________________ @@ -718,276 +733,279 @@ make [Building and Starting] - [64]Q-1: I can't get x11vnc to start up. It says "XOpenDisplay failed + [69]Q-1: I can't get x11vnc to start up. It says "XOpenDisplay failed (null)" or "Xlib: connection to ":0.0" refused by server Xlib: No protocol specified" and then exits. What do I need to do? - [65]Q-2: I can't get x11vnc and/or libvncserver to compile. + [70]Q-2: I can't get x11vnc and/or libvncserver to compile. - [66]Q-3: I just built x11vnc successfully, but when I use it my + [71]Q-3: I just built x11vnc successfully, but when I use it my keystrokes and mouse button clicks are ignored (I am able to move the mouse though). - [67]Q-4: Help, I need to run x11vnc on Solaris 2.5.1 (or other old + [72]Q-4: Help, I need to run x11vnc on Solaris 2.5.1 (or other old Unix/Linux) and it doesn't compile! - [68]Q-5: Where can I get a precompiled x11vnc binary for my Operating + [73]Q-5: Where can I get a precompiled x11vnc binary for my Operating System? - [69]Q-6: Where can I get a VNC Viewer binary (or source code) for the + [74]Q-6: Where can I get a VNC Viewer binary (or source code) for the Operating System I will be viewing from? - [70]Q-7: How can I see all of x11vnc's command line options and + [75]Q-7: How can I see all of x11vnc's command line options and documentation on how to use them? - [71]Q-8: I don't like typing arcane command line options every time I + [76]Q-8: I don't like typing arcane command line options every time I start x11vnc. What can I do? Is there a config file? Or a GUI? - [72]Q-9: Can I make x11vnc more quiet and also go into the background + [77]Q-9: Can I make x11vnc more quiet and also go into the background after starting up? - [73]Q-10: Sometimes when a VNC viewer dies abruptly, x11vnc also dies + [78]Q-10: Sometimes when a VNC viewer dies abruptly, x11vnc also dies with the error message like: "Broken pipe". I'm using the -forever mode and I want x11vnc to keep running. - [74]Q-11: Are there any build-time customizations possible, e.g. + [79]Q-11: Are there any build-time customizations possible, e.g. change defaults, create a smaller binary, etc? [Win2VNC Related] - [75]Q-12: I have two separate machine displays in front of me, one + [80]Q-12: I have two separate machine displays in front of me, one Windows the other X11: can I use x11vnc in combination with Win2VNC in dual-screen mode to pass the keystrokes and mouse motions to the X11 display? - [76]Q-13: I am running Win2VNC on my Windows machine and "x11vnc + [81]Q-13: I am running Win2VNC on my Windows machine and "x11vnc -nofb" on Unix to pass keyboard and mouse to the Unix monitor. Whenever I start Win2VNC it quickly disconnects and x11vnc says: rfbProcessClientNormalMessage: read: Connection reset by peer [Color Issues] - [77]Q-14: The X display I run x11vnc on is only 8 bits per pixel (bpp) + [82]Q-14: The X display I run x11vnc on is only 8 bits per pixel (bpp) PseudoColor (i.e. only 256 distinct colors). The x11vnc colors may start out OK, but after a while they are incorrect in certain windows. - [78]Q-15: Color problems: Why are the colors for some windows messed + [83]Q-15: Color problems: Why are the colors for some windows messed up in x11vnc? BTW, my X display has nice overlay/multi-depth visuals of different color depths: e.g. there are both depth 8 and 24 visuals available at the same time. - [79]Q-16: How do I figure out the window id to supply to the -id + [84]Q-16: How do I figure out the window id to supply to the -id windowid option? - [80]Q-17: Why don't menus or other transient windows come up when I am + [85]Q-17: Why don't menus or other transient windows come up when I am using the -id windowid option to view a single application window? - [81]Q-18: My X display is depth 24 at 24bpp (instead of the normal + [86]Q-18: My X display is depth 24 at 24bpp (instead of the normal depth 24 at 32bpp). I'm having lots of color and visual problems with x11vnc and/or vncviewer. What's up? [Xterminals] - [82]Q-19: Can I use x11vnc to view and interact with an Xterminal + [87]Q-19: Can I use x11vnc to view and interact with an Xterminal (e.g. NCD) that is not running UNIX and so x11vnc cannot be run on it directly? - [83]Q-20: How do I get my X permissions (MIT-MAGIC-COOKIE) correct for + [88]Q-20: How do I get my X permissions (MIT-MAGIC-COOKIE) correct for a Unix/Linux machine acting as an Xterminal? [Remote Control] - [84]Q-21: How do I stop x11vnc once it is running in the background? + [89]Q-21: How do I stop x11vnc once it is running in the background? - [85]Q-22: Can I change settings in x11vnc without having to restart + [90]Q-22: Can I change settings in x11vnc without having to restart it? Can I remote control it? [Security and Permissions] - [86]Q-23: How do I create a VNC password for use with x11vnc? + [91]Q-23: How do I create a VNC password for use with x11vnc? - [87]Q-24: Can I have two passwords for VNC viewers, one for full + [92]Q-24: Can I have two passwords for VNC viewers, one for full access and the other for view-only access to the display? - [88]Q-25: Can I fine tune what types of user input are allowed? E.g. + [93]Q-25: Can I fine tune what types of user input are allowed? E.g. have some users just be able to move the mouse, but not click or type anything? - [89]Q-26: Why does x11vnc exit as soon as the VNC viewer disconnects? + [94]Q-26: Why does x11vnc exit as soon as the VNC viewer disconnects? And why doesn't it allow more than one VNC viewer to connect at the same time? - [90]Q-27: Can I limit which machines incoming VNC clients can connect + [95]Q-27: Can I limit which machines incoming VNC clients can connect from? - [91]Q-28: How do I build x11vnc/libvncserver with libwrap + [96]Q-28: How do I build x11vnc/libvncserver with libwrap (tcp_wrappers) support? - [92]Q-29: Can I have x11vnc only listen on one network interface (e.g. + [97]Q-29: Can I have x11vnc only listen on one network interface (e.g. internal LAN) rather than having it listen on all network interfaces and relying on -allow to filter unwanted connections out? - [93]Q-30: Now that -localhost implies listening only on the loopback + [98]Q-30: Now that -localhost implies listening only on the loopback interface, how I can occasionally allow in a non-localhost via the allowonce remote control command? - [94]Q-31: How can I tunnel my connection to x11vnc via an encrypted + [99]Q-31: How can I tunnel my connection to x11vnc via an encrypted SSH channel between two Unix machines? - [95]Q-32: How can I tunnel my connection to x11vnc via an encrypted + [100]Q-32: How can I tunnel my connection to x11vnc via an encrypted SSH channel from Windows using an SSH client like Putty? - [96]Q-33: Can I prompt the user at the local X display whether the + [101]Q-33: Can I prompt the user at the local X display whether the incoming VNC client should be accepted or not? Can I decide to make some clients view-only? How about running an arbitrary program to make the decisions? - [97]Q-34: Does x11vnc support Unix usernames and passwords? Can I + [102]Q-34: Does x11vnc support Unix usernames and passwords? Can I further limit the set of Unix usernames who can connect to the VNC desktop? - [98]Q-35: I start x11vnc as root because it is launched via inetd(1) + [103]Q-35: I start x11vnc as root because it is launched via inetd(1) or a display manager like gdm(1). Can I have x11vnc later switch to a different user? - [99]Q-36: I use a screen-lock when I leave my workstation (e.g. + [104]Q-36: I use a screen-lock when I leave my workstation (e.g. xscreensaver or xlock). When I remotely access my workstation desktop via x11vnc I can unlock the desktop fine, but I am worried people will see my activities on the physical monitor. What can I do to prevent this, or at least make it more difficult? - [100]Q-37: Can I have x11vnc automatically lock the screen when I + [105]Q-37: Can I have x11vnc automatically lock the screen when I disconnect the VNC viewer? [Display Managers and Services] - [101]Q-38: How can I run x11vnc as a "service" that is always + [106]Q-38: How can I run x11vnc as a "service" that is always available? - [102]Q-39: How can I use x11vnc to connect to an X login screen like + [107]Q-39: How can I use x11vnc to connect to an X login screen like xdm, GNOME gdm, KDE kdm, or CDE dtlogin? (i.e. nobody is logged into an X session yet). - [103]Q-40: Can I run x11vnc out of inetd(1)? How about xinetd(1)? + [108]Q-40: Can I run x11vnc out of inetd(1)? How about xinetd(1)? - [104]Q-41: How do I make x11vnc work with the Java VNC viewer applet + [109]Q-41: How do I make x11vnc work with the Java VNC viewer applet in a web browser? - [105]Q-42: Are reverse connections (i.e. the VNC server connecting to + [110]Q-42: Are reverse connections (i.e. the VNC server connecting to the VNC viewer) using "vncviewer -listen" and vncconnect(1) supported? - [106]Q-43: Can I use x11vnc as a replacement for Xvnc? (i.e. not for a + [111]Q-43: Can I use x11vnc as a replacement for Xvnc? (i.e. not for a real display, but for a virtual one I keep around). - [107]Q-44: How can I use x11vnc on "headless" machines? Why might I + [112]Q-44: How can I use x11vnc on "headless" machines? Why might I want to? [Resource Usage and Performance] - [108]Q-45: I have lots of memory, but why does x11vnc fail with + [113]Q-45: I have lots of memory, but why does x11vnc fail with shmget: No space left on device or Minor opcode of failed request: 1 (X_ShmAttach)? - [109]Q-46: How can I make x11vnc use less system resources? + [114]Q-46: How can I make x11vnc use less system resources? - [110]Q-47: How can I make x11vnc use MORE system resources? + [115]Q-47: How can I make x11vnc use MORE system resources? - [111]Q-48: I use x11vnc over a slow link with high latency (e.g. + [116]Q-48: I use x11vnc over a slow link with high latency (e.g. dialup modem), is there anything I can do to speed things up? - [112]Q-49: When I drag windows around with the mouse or scroll up and + [117]Q-49: 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 motion). Is there anything to do to improve things? - [113]Q-50: Does x11vnc support the X DAMAGE Xserver extension to find + [118]Q-50: Why not do something like wireframe animations to avoid the + windows "lurching" when being moved or resized? + + [119]Q-51: Does x11vnc support the X DAMAGE Xserver extension to find modified regions of the screen quickly and efficiently? [Mouse Cursor Shapes] - [114]Q-51: Why isn't the mouse cursor shape (the little icon shape + [120]Q-52: Why isn't the mouse cursor shape (the little icon shape where the mouse pointer is) correct as I move from window to window? - [115]Q-52: When using XFIXES cursorshape mode, some of the cursors + [121]Q-53: When using XFIXES cursorshape mode, some of the cursors look really bad with extra black borders around the cursor and other cruft. How can I improve their appearance? - [116]Q-53: In XFIXES mode, are there any hacks to handle cursor + [122]Q-54: In XFIXES mode, are there any hacks to handle cursor transparency ("alpha channel") exactly? [Mouse Pointer] - [117]Q-54: Why does the mouse arrow just stay in one corner in my + [123]Q-55: Why does the mouse arrow just stay in one corner in my vncviewer, whereas my cursor (that does move) is just a dot? - [118]Q-55: Can I take advantage of the TightVNC extension to the VNC + [124]Q-56: Can I take advantage of the TightVNC extension to the VNC protocol where Cursor Positions Updates are sent back to all connected clients (i.e. passive viewers can see the mouse cursor being moved around by another viewer)? - [119]Q-56: Is it possible to swap the mouse buttons (e.g. left-handed + [125]Q-57: Is it possible to swap the mouse buttons (e.g. left-handed operation), or arbitrarily remap them? How about mapping button clicks to keystrokes, e.g. to partially emulate Mouse wheel scrolling? [Keyboard Issues] - [120]Q-57: How can I get my AltGr and Shift modifiers to work between + [126]Q-58: How can I get my AltGr and Shift modifiers to work between keyboards for different languages? - [121]Q-58: When I try to type a "<" (i.e. less than) instead I get ">" + [127]Q-59: When I try to type a "<" (i.e. less than) instead I get ">" (i.e. greater than)! Strangely, typing ">" works OK!! - [122]Q-59: I'm using an "international" keyboard (e.g. German "de", or + [128]Q-60: I'm using an "international" keyboard (e.g. German "de", or Danish "dk") and the -modtweak mode works well if the VNC viewer is run on a Unix/Linux machine with a similar keyboard. But if I run the VNC viewer on Unix/Linux with a different keyboard (e.g. "us") or Windows with any keyboard, I can't type some keys like: "@", "$", "<", ">", etc. How can I fix this? - [123]Q-60: When typing I sometimes get double, triple, or more of my + [129]Q-61: When typing I sometimes get double, triple, or more of my keystrokes repeated. I'm sure I only typed them once, what can I do? - [124]Q-61: The x11vnc -norepeat mode is in effect, but I still get + [130]Q-62: The x11vnc -norepeat mode is in effect, but I still get repeated keystrokes!! - [125]Q-62: The machine where I run x11vnc has an AltGr key, but the + [131]Q-63: The machine where I run x11vnc has an AltGr key, but the local 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? - [126]Q-63: I have a Sun machine I run x11vnc on. Its Sun keyboard has + [132]Q-64: I have a Sun machine I run x11vnc on. Its Sun keyboard has just one Alt key labelled "Alt" and two Meta keys labelled with little diamonds. The machine where I run the VNC viewer only has Alt keys. How can I send a Meta keypress? (e.g. emacs needs this) - [127]Q-64: Can I map a keystroke to a mouse button click on the remote + [133]Q-65: Can I map a keystroke to a mouse button click on the remote machine? [Screen Related Issues and Features] - [128]Q-65: The remote display is larger (in number of pixels) than the + [134]Q-66: The remote display is larger (in number of pixels) than the local display I am running the vncviewer on. I don't like the vncviewer scrollbars, what I can do? - [129]Q-66: Does x11vnc support server-side framebuffer scaling? (E.g. + [135]Q-67: Does x11vnc support server-side framebuffer scaling? (E.g. to make the desktop smaller). - [130]Q-67: Does x11vnc work with Xinerama? (i.e. multiple monitors + [136]Q-68: Does x11vnc work with Xinerama? (i.e. multiple monitors joined together to form one big, single screen). - [131]Q-68: Can I use x11vnc on a multi-headed display that is not + [137]Q-69: Can I use x11vnc on a multi-headed display that is not Xinerama (i.e. separate screens :0.0, :0.1, ... for each monitor)? - [132]Q-69: Can x11vnc show only a portion of the display? (E.g. for a + [138]Q-70: Can x11vnc show only a portion of the display? (E.g. for a special purpose rfb application). - [133]Q-70: Does x11vnc support the XRANDR (X Resize, Rotate and + [139]Q-71: Does x11vnc support the XRANDR (X Resize, Rotate and Reflection) extension? Whenever I rotate or resize the screen x11vnc just seems to crash. - [134]Q-71: Why is the view in my VNC viewer completely black? Or why + [140]Q-72: Why is the view in my VNC viewer completely black? Or why is everything flashing around randomly? - [135]Q-72: I use Linux Virtual Consoles (VC's) to implement 'Fast User + [141]Q-73: I use Linux Virtual Consoles (VC's) to implement 'Fast User Switching' between users' sessions (e.g. Betty is on Ctrl-Alt-F7, Bobby is on Ctrl-Alt-F8, and Sid is on Ctrl-Alt-F1: they use those keystrokes to switch between their sessions). How come the view in a @@ -995,12 +1013,12 @@ make otherwise all messed up unless the X session x11vnc is attached to is in the active VC? - [136]Q-73: Can I use x11vnc to view my VMWare session remotely? + [142]Q-74: Can I use x11vnc to view my VMWare session remotely? - [137]Q-74: Can non-X devices (e.g. a raw framebuffer) be viewed and/or + [143]Q-75: Can non-X devices (e.g. a raw framebuffer) be viewed and/or controlled by x11vnc? - [138]Q-75: I am using x11vnc where my local machine has "popup/hidden + [144]Q-76: I am using x11vnc where my local machine has "popup/hidden taskbars" (e.g. GNOME or MacOS X) and the remote display where x11vnc runs also has "popup/hidden taskbars" (e.g. GNOME). When I move the mouse to the edge of the screen where the popups happen, the taskbars @@ -1008,13 +1026,13 @@ make [Misc: Clipboard, Beeps, Thanks, etc.] - [139]Q-76: Does the Clipboard/Selection get transferred between the + [145]Q-77: Does the Clipboard/Selection get transferred between the vncviewer and the X display? - [140]Q-77: Why don't I hear the "Beeps" in my X session (e.g. when + [146]Q-78: Why don't I hear the "Beeps" in my X session (e.g. when typing tput bel in an xterm)? - [141]Q-78: Thanks for your program and for your help! Can I make a + [147]Q-79: Thanks for your program and for your help! Can I make a donation? _________________________________________________________________ @@ -1027,7 +1045,7 @@ make For the former error, you need to specify the X display to connect to (it also needs to be on the same machine x11vnc is to run on). Set - your DISPLAY environment variable or use the [142]-display option to + your DISPLAY environment variable or use the [148]-display option to specify it. Nearly always the correct value will be ":0" For the latter error, you need to set up the X11 permissions @@ -1043,7 +1061,7 @@ make How to Solve: See the xauth(1), Xsecurity(7), and xhost(1) man pages for much info on X11 permissions. For example, you may need to set - your XAUTHORITY environment variable or use the [143]-auth option to + your XAUTHORITY environment variable or use the [149]-auth option to point to the correct cookie file (e.g. /home/joe/.Xauthority or /var/gdm/:0.Xauth), or simply be sure you run x11vnc as the correct user (i.e. the user who owns the X session you wish to view). Running @@ -1057,7 +1075,7 @@ make machine). The person could then type "xhost -localhost" after x11vnc has connected to go back to the default permissions. Also, for some situations the "-users lurk=" option may be of use (please read the - documentation on the [144]-users option). + documentation on the [150]-users option). To test out your X11 permissions from a remote shell, set DISPLAY and possibly XAUTHORITY (see your shell's man page, bash(1), tcsh(1), on @@ -1169,7 +1187,7 @@ h earlier and perhaps non-Solaris): First use the environment settings (CPPFLAGS, LDFLAGS, etc.) in the - above [145]Solaris build script to run the configure command. That + above [151]Solaris build script to run the configure command. That should succeed without failure. Then you have to hand edit the autogenerated rfb/rfbconfig.h file in the source tree, and just before the last #endif at the bottom of that file insert these workaround @@ -1195,7 +1213,7 @@ typedef unsigned int in_addr_t; on other older OS (Solaris, Linux, ...) releases. Here are some notes for similar steps that need to be done to build on - [146]SunOS 4.x + [152]SunOS 4.x Please let us know if you had to use the above workaround (and whether it worked or not). If there is enough demand we will try to push clean @@ -1205,19 +1223,19 @@ typedef unsigned int in_addr_t; Q-5: Where can I get a precompiled x11vnc binary for my Operating System? - Hopefully the [147]build steps above and [148]FAQ provide enough info + Hopefully the [153]build steps above and [154]FAQ provide enough info for a painless compile for most environments. Please report problems with the x11vnc configure, make, etc. on your system (if your system is known to compile other GNU packages successfully). There are precompiled x11vnc binaries built by other groups that are available at the following locations: - Debian: (.deb) [149]http://packages.debian.org/x11vnc + Debian: (.deb) [155]http://packages.debian.org/x11vnc - Slackware: (.tgz) [150]http://www.linuxpackages.net/ Redhat/Fedora: - (.rpm) [151]http://dag.wieers.com/packages/x11vnc/ Solaris: (pkg) - [152]http://www.sunfreeware.com/ wwexptools: (.tgz) - [153]http://www.bell-labs.com/project/wwexptools/packages.html The + Slackware: (.tgz) [156]http://www.linuxpackages.net/ Redhat/Fedora: + (.rpm) [157]http://dag.wieers.com/packages/x11vnc/ Solaris: (pkg) + [158]http://www.sunfreeware.com/ wwexptools: (.tgz) + [159]http://www.bell-labs.com/project/wwexptools/packages.html The last one, wwexptools, provides a variety of Unix binaries (Linux, Solaris, HP-UX, IRIX, ...) with the intent of being compatible on a wide range of OS releases. Find x11vnc near the bottom of that page @@ -1229,13 +1247,13 @@ typedef unsigned int in_addr_t; this by looking at the x11vnc output and if it says the encoding for a client is "hextile" then likely the fast compression encodings are missing. If you want optimal performance on your OS, you should see - the [154]build notes above for where to download libz and libjpeg, and + the [160]build notes above for where to download libz and libjpeg, and then build everything with gcc. For Solaris, the http://www.sunfreeware.com/ packages are built with libz and libjpeg. If the above binaries don't work and building x11vnc on your OS fails (and all else fails!) you can try one of my motley collection of - [155]test binaries. Some may be old, some may have extra debugging + [161]test binaries. Some may be old, some may have extra debugging output, etc. One of them may work on your OS... As a general note, the x11vnc program is simple enough you don't @@ -1256,9 +1274,9 @@ typedef unsigned int in_addr_t; To obtain VNC viewers for the viewing side (Windows, Mac OS, or Unix) try here: - * [156]http://www.tightvnc.com/download.html - * [157]http://www.realvnc.com/download-free.html - * [158]http://sourceforge.net/projects/cotvnc/ + * [162]http://www.tightvnc.com/download.html + * [163]http://www.realvnc.com/download-free.html + * [164]http://sourceforge.net/projects/cotvnc/ Q-7: How can I see all of x11vnc's command line options and @@ -1266,7 +1284,7 @@ typedef unsigned int in_addr_t; Run: x11vnc -opts to list just the option names or run: x11vnc -help for long descriptions about each option. The output is listed - [159]here as well. + [165]here as well. Q-8: I don't like typing arcane command line options every time I @@ -1299,7 +1317,7 @@ display :0 GUI based on the remote-control functionality that was added. It's not particularly user-friendly, it just provides a point and click mode to set all the many x11vnc parameters and obtain help on them. See the - [160]-gui option for more info. Examples: "x11vnc ... -gui" and + [166]-gui option for more info. Examples: "x11vnc ... -gui" and "x11vnc ... -gui other:0" in the latter case the gui is displayed on other:0, not the X display x11vnc is polling. @@ -1307,11 +1325,11 @@ display :0 Q-9: Can I make x11vnc more quiet and also go into the background after starting up? - Use the [161]-q and [162]-bg options, respectively. (also: -quiet is + Use the [167]-q and [168]-bg options, respectively. (also: -quiet is an alias for -q) Note that under -bg the stderr messages will be lost unless you use - the "[163]-o logfile" option. + the "[169]-o logfile" option. Q-10: Sometimes when a VNC viewer dies abruptly, x11vnc also dies with @@ -1324,7 +1342,7 @@ display :0 Up until of Apr/2004 the above fix only works for BSD signal systems (Linux, FreeBSD, ...) For SYSV systems there is a workaround in my - [164]x11vnc.c file. It also has an [165]option -sigpipe exit to have + [170]x11vnc.c file. It also has an [171]option -sigpipe exit to have x11vnc clean up and exit upon receiving SIGPIPE. @@ -1333,7 +1351,7 @@ display :0 As of Mar/2004 in the libvncserver cvs there are a few such options. They are enabled by adding something like -Dxxxx=1 to the CPPFLAGS - environment variable before running configure (see the [166]build + environment variable before running configure (see the [172]build notes for general background). * -DX11VNC_SHARED=1 make -shared the default. * -DX11VNC_FOREVER=1 make -forever the default. @@ -1378,21 +1396,21 @@ display :0 dual-screen mode to pass the keystrokes and mouse motions to the X11 display? - Yes, for best response start up x11vnc with the "[167]-nofb" option + Yes, for best response start up x11vnc with the "[173]-nofb" option (disables framebuffer polling, and does other optimizations) on the secondary display (X11) machine. Then start up Win2VNC on the primary display (Windows) referring it to the secondary display. - This will also work X11 to X11 using [168]x2vnc, however you would + This will also work X11 to X11 using [174]x2vnc, however you would probably just want to avoid VNC and use x2x for that. For reference, here are some links to Win2VNC-like programs for multiple monitor setups: - * [169]Original Win2VNC - * [170]Enhanced Win2VNC and [171]sourceforge link - * [172]x2vnc - * [173]x2x also [174]here - * [175]zvnc (MorphOS) + * [175]Original Win2VNC + * [176]Enhanced Win2VNC and [177]sourceforge link + * [178]x2vnc + * [179]x2x also [180]here + * [181]zvnc (MorphOS) All of them will work with x11vnc (except x2x where it is not needed). @@ -1412,7 +1430,7 @@ display :0 on your display to be depth 24 TrueColor? Sun machines often have 8+24 overlay/multi-depth visuals, and you can make the default visual depth 24 TrueColor (see fbconfig(1) and Xsun(1)). 2) As of Feb/2004, in the - libvncserver CVS, x11vnc has the [176]-visual option to allow you to + libvncserver CVS, x11vnc has the [182]-visual option to allow you to force the framebuffer visual to whatever you want (this usually messes up the colors unless you are very clever). In this case, the option provides a convenient workaround for the Win2VNC bug: @@ -1427,7 +1445,7 @@ display :0 PseudoColor (i.e. only 256 distinct colors). The x11vnc colors may start out OK, but after a while they are incorrect in certain windows. - Use the [177]-flashcmap option to have x11vnc watch for changes in the + Use the [183]-flashcmap option to have x11vnc watch for changes in the colormap, and propagate those changes back to connected clients. This can be slow (since the whole screen must be updated over the network whenever the colormap changes). This flashing colormap behavior often @@ -1436,7 +1454,7 @@ display :0 example of this. Consider reconfiguring the system to 16 bpp or depth 24 TrueColor if at all possible. - Also note that in some rare cases the [178]-notruecolor option has + Also note that in some rare cases the [184]-notruecolor option has corrected colors on 8bpp displays. The red, green, and blue masks were non-zero in 8bpp PseudoColor on an obscure setup, and this option corrected the problems. @@ -1447,10 +1465,10 @@ display :0 different color depths: e.g. there are both depth 8 and 24 visuals available at the same time. - You may want to review the [179]previous question regarding 8 bpp + You may want to review the [185]previous question regarding 8 bpp PseudoColor. - On some hardware (Sun/SPARC, Sgi), the [180]-overlay option discussed + On some hardware (Sun/SPARC, Sgi), the [186]-overlay option discussed a couple paragraphs down may solve this for you (you may want to skip to it directly). @@ -1488,7 +1506,7 @@ TrueColor defdepth 24 The -overlay mode: Another option is if the system with overlay visuals is a Sun system running Solaris or Sgi running IRIX you can - use the [181]-overlay x11vnc option (Aug/2004) to have x11vnc use the + use the [187]-overlay x11vnc option (Aug/2004) to have x11vnc use the Solaris XReadScreen(3X11) function to poll the "true view" of the whole screen at depth 24 TrueColor. XReadDisplay(3X11) is used on IRIX. This is useful for Legacy applications (older versions of @@ -1510,7 +1528,7 @@ TrueColor defdepth 24 Colors still not working correctly? Run xwininfo on the application with the messed up colors to verify that the depth of its visual is different from the default visual depth (gotten from xdpyinfo). One - possible workaround in this case is to use the [182]-id option to + possible workaround in this case is to use the [188]-id option to point x11vnc at the application window itself. If the application is complicated (lots of toplevel windows and popup menus) this may not be acceptable, and may even crash x11vnc (but not the application). @@ -1518,7 +1536,7 @@ TrueColor defdepth 24 It is theoretically possible to solve this problem in general (see xwd(1) for example), but it does not seem trivial or sufficiently fast for x11vnc to be able to do so in real time. Fortunately the - [183]-overlay option works for Solaris machines with overlay visuals + [189]-overlay option works for Solaris machines with overlay visuals where most of this problem occurs. @@ -1529,13 +1547,13 @@ TrueColor defdepth 24 the desired application window. After clicking, it will print out much information, including the window id (e.g. 0x6000010). Also, the visual and depth of the window printed out is often useful in - debugging x11vnc [184]problems. + debugging x11vnc [190]problems. When using -id windowid, note that some VNC viewers will have problems rendering screens that have a width that is not a multiple of 4. Try to manually adjust the window width before starting x11vnc -id .... - Also, as of Dec/2004 libvncserver CVS you can use "[185]-id pick" to + Also, as of Dec/2004 libvncserver CVS you can use "[191]-id pick" to have x11vnc run xwininfo(1) for you and after you click the window it extracts the windowid. Besides "pick" there is also "id:root" to allow you to go back to root window when doing remote-control. @@ -1553,7 +1571,7 @@ TrueColor defdepth 24 be able to see these transient windows. If things are not working and you still want to do the single window - polling, try the [186]-sid windowid option ("shifted" windowid). + polling, try the [192]-sid windowid option ("shifted" windowid). x11vnc is known to crash under both -id and -sid, so both modes are still experimental. Please report any reproducible bugs. @@ -1606,15 +1624,15 @@ TrueColor defdepth 24 since you will be polling the X display over the network as opposed to over the local hardware. To do this, run x11vnc on a UNIX machine as close as possible network-wise (e.g. same switch) to the Xterminal - machine. Use the [187]-display option to point the display to that of + machine. Use the [193]-display option to point the display to that of the Xterminal (you'll of course need basic X11 permission to do that) - and also supply the [188]-noshm option (this enables the polling over + and also supply the [194]-noshm option (this enables the polling over the network). The response will likely be sluggish (maybe only one "frame" per second). This mode is not recommended except for "quick checks" of hard to get to X servers. Use something like -wait 150 to cut down on - the polling rate. You may also need [189]-flipbyteorder if the colors + the polling rate. You may also need [195]-flipbyteorder if the colors get messed up due to endian byte order differences. Q-20: How do I get my X permissions (MIT-MAGIC-COOKIE) correct for a @@ -1638,7 +1656,7 @@ TrueColor defdepth 24 copied to the Xterminal. If $HOME/.Xauthority is exported via NFS (this is insecure of course, but has been going on for decades), then x11vnc can simply pick it up via NFS (you may need to use the - [190]-auth option to point to the correct file). Other options include + [196]-auth option to point to the correct file). Other options include copying the auth file using scp, or something like: central-server> xauth nextract - xterm123:0 | ssh xterm123 xauth nmerge - @@ -1650,7 +1668,7 @@ TrueColor defdepth 24 details. If the display name in the cookie file needs to be changed between the - two hosts, see [191]this note on the "xauth add ..." command. + two hosts, see [197]this note on the "xauth add ..." command. A less secure option is to run something like "xhost +127.0.0.1" while sitting at the Xterminal box to allow cookie-free local access for @@ -1664,7 +1682,7 @@ TrueColor defdepth 24 occasional app more efficiently locally on the Xterminal box (e.g. realplayer). - Not recommended, but as a last resort, you could have x11vnc [192]poll + Not recommended, but as a last resort, you could have x11vnc [198]poll the Xterminal Display over the network. For this you would run a "x11vnc -noshm ..." process on the central-server (and hope the network admin doesn't get angry...) @@ -1695,17 +1713,17 @@ TrueColor defdepth 24 As of Dec/2004 in the libvncserver CVS there is a remote control feature. It can change a huge amount of things on the fly: see the - [193]-remote and [194]-query options. To shut down the running x11vnc + [199]-remote and [200]-query options. To shut down the running x11vnc server just type "x11vnc -R stop". To disconnect all clients do "x11vnc -R disconnect:all", etc. - For older versions: If the [195]-forever option has not been supplied, + For older versions: If the [201]-forever option has not been supplied, x11vnc will automatically exit after the first client disconnects. In general you will have to kill the x11vnc process This can be done via: "kill NNNNN" (where NNNNN is the x11vnc process id number found from ps(1)), or "pkill x11vnc", or "killall x11vnc" (Linux only). - If you have not put x11vnc in the background via the [196]-bg option + If you have not put x11vnc in the background via the [202]-bg option or shell & operator, then simply press Ctrl-C in the shell where x11vnc is running to stop it. Potential Gotcha: If somehow your Keypress of Ctrl-C went through x11vnc to the Xserver that then @@ -1714,14 +1732,14 @@ TrueColor defdepth 24 Tapping the stuck key (either via a new x11vnc or at the physical console) will release it from the stuck state. If the keyboard seems to be acting strangely it is often fixed by tapping Ctrl, Shift, and - Alt. Alternatively, the [197]-clear_mods option and [198]-clear_keys + Alt. Alternatively, the [203]-clear_mods option and [204]-clear_keys option can be used to release pressed keys at startup and exit. Q-22: Can I change settings in x11vnc without having to restart it? Can I remote control it? - Look at the [199]-remote (same as -R) and [200]-query (same as -Q) + Look at the [205]-remote (same as -R) and [206]-query (same as -Q) options added in the Dec/2004 libvncserver CVS. They allow nearly everything to be changed dynamically and settings to be queried. Examples: "x11vnc -R shared", "x11vnc -R forever", "x11vnc -R @@ -1733,7 +1751,7 @@ TrueColor defdepth 24 be possible. There is also a simple tcl/tk gui based on this remote control - mechanism. See the [201]-gui option for more info. + mechanism. See the [207]-gui option for more info. [Security and Permissions] @@ -1745,12 +1763,12 @@ TrueColor defdepth 24 vncpasswd(1) program from those packages. The libvncserver package also comes with a simple program: storepasswd in the examples directory. And as of Jun/2004 in the libvncserver CVS x11vnc supports - the -storepasswd "pass" "file" [202]option, which is the the same + the -storepasswd "pass" "file" [208]option, which is the the same functionality of storepasswd. Be sure to quote the "pass" if it contains shell meta characters, spaces, etc. Example: x11vnc -storepasswd 'sword*fish' $HOME/myvncpasswd - You then use the password via the x11vnc option: [203]-rfbauth + You then use the password via the x11vnc option: [209]-rfbauth $HOME/myvncpasswd Compared to vncpasswd(1) the latter two methods are a somewhat unsafe @@ -1759,7 +1777,7 @@ TrueColor defdepth 24 out for the command winding up in your shell's history file (history -c is often a way to clear it). - x11vnc also has the [204]-passwdfile and -passwd/-viewpasswd plain + x11vnc also has the [210]-passwdfile and -passwd/-viewpasswd plain text (i.e. not obscured like the -rfbauth VNC passwords) password options. @@ -1768,13 +1786,13 @@ TrueColor defdepth 24 and the other for view-only access to the display? Yes, as of May/2004 in the libvncserver CVS there is the - [205]-viewpasswd option to supply the view-only password. Note the - full-access password option [206]-passwd must be supplied at the same + [211]-viewpasswd option to supply the view-only password. Note the + full-access password option [212]-passwd must be supplied at the same time. E.g.: -passwd sword -viewpasswd fish. To avoid specifying the passwords on the command line (where they could be observed via the ps(1) command by any user) you can use the - [207]-passwdfile option to specify a file containing plain text + [213]-passwdfile option to specify a file containing plain text passwords. Presumably this file is readable only by you, and ideally it is located on the machine x11vnc is run on (to avoid being snooped on over the network). The first line of this file is the full-access @@ -1782,7 +1800,7 @@ TrueColor defdepth 24 it is taken as the view-only password. (use "__EMPTY__" to supply an empty one). - View-only passwords currently do not work for the [208]-rfbauth + View-only passwords currently do not work for the [214]-rfbauth password option (standard VNC password storing mechanism). FWIW, note that although the output (usually placed in $HOME/.vnc/passwd) by the vncpasswd or storepasswd programs (or from x11vnc -storepasswd) looks @@ -1796,7 +1814,7 @@ TrueColor defdepth 24 some users just be able to move the mouse, but not click or type anything? - As of Feb/2005, the [209]-input option allows you to do this. "K", + As of Feb/2005, the [215]-input option allows you to do this. "K", "M", and "B" stand for Keystroke, Mouse-motion, and Button-clicks, respectively. The setting: "-input M" makes attached viewers only able to move the mouse. "-input KMB,M" lets normal clients do everything @@ -1812,15 +1830,15 @@ TrueColor defdepth 24 These defaults are simple safety measures to avoid someone unknowingly leaving his X11 desktop exposed (to the internet, say) for long - periods of time. Use the [210]-forever option (aka -many) to have + periods of time. Use the [216]-forever option (aka -many) to have x11vnc wait for more connections after the first client disconnects. - Use the [211]-shared option to have x11vnc allow multiple clients to + Use the [217]-shared option to have x11vnc allow multiple clients to connect simultaneously. - Recommended additional safety measures include using ssh ([212]see + Recommended additional safety measures include using ssh ([218]see above), stunnel, or a VPN to authenticate and encrypt the viewer - connections or to at least use the -rfbauth passwd-file [213]option to - use VNC password protection (or [214]-passwdfile) It is up to you to + connections or to at least use the -rfbauth passwd-file [219]option to + use VNC password protection (or [220]-passwdfile) It is up to you to apply these security measures, they will not be done for you automatically. @@ -1828,7 +1846,7 @@ TrueColor defdepth 24 Q-27: Can I limit which machines incoming VNC clients can connect from? - Yes, look at the [215]-allow and [216]-localhost options to limit + Yes, look at the [221]-allow and [222]-localhost options to limit connections by hostname or IP address. E.g. x11vnc -allow 192.168.0.1,192.168.0.2 @@ -1840,7 +1858,7 @@ TrueColor defdepth 24 Note that -localhost is the same as "-allow 127.0.0.1" For more control, build libvncserver with libwrap support - [217](tcp_wrappers) and then use /etc/hosts.allow See hosts_access(5) + [223](tcp_wrappers) and then use /etc/hosts.allow See hosts_access(5) for complete details. @@ -1860,7 +1878,7 @@ TrueColor defdepth 24 is "vnc", e.g.: vnc: 192.168.100.3 .example.com - Note that if you run x11vnc out of [218]inetd you do not need to build + Note that if you run x11vnc out of [224]inetd you do not need to build x11vnc with libwrap support because the /usr/sbin/tcpd reference in /etc/inetd.conf handles the tcp_wrappers stuff. @@ -1869,16 +1887,16 @@ TrueColor defdepth 24 internal LAN) rather than having it listen on all network interfaces and relying on -allow to filter unwanted connections out? - As of Mar/2005 in the libvncserver CVS, there is the "[219]-listen + As of Mar/2005 in the libvncserver CVS, there is the "[225]-listen ipaddr" option that enables this. For ipaddr either supply the desired network interface's IP address (or use a hostname that resolves to it) or use the string "localhost". For additional filtering simultaneously - use the "[220]-allow host1,..." option to allow only specific hosts + use the "[226]-allow host1,..." option to allow only specific hosts in. This option is useful if you want insure that no one can even begin a dialog with x11vnc from untrusted network interfaces (e.g. ppp0). The - option [221]-localhost now implies "-listen localhost" since that is + option [227]-localhost now implies "-listen localhost" since that is what most people expect it to do. @@ -1886,24 +1904,24 @@ TrueColor defdepth 24 interface, how I can occasionally allow in a non-localhost via the allowonce remote control command? - To do this specify "[222]-allow localhost". Unlike [223]-localhost + To do this specify "[228]-allow localhost". Unlike [229]-localhost this will leave x11vnc listening on all interfaces (but of course only allowing in local connections, e.g. ssh redirs). Then you can later run "x11vnc -R allowonce:somehost" or use to gui to permit a one-shot connection from a remote host. Note that if you do a lot of changing of the listening interface - ([224]-listen option) via remote control or gui, you may need to also - manually adjust the [225]-allow list if you unexpectedly get into a + ([230]-listen option) via remote control or gui, you may need to also + manually adjust the [231]-allow list if you unexpectedly get into a state where the allow list cannot match any hosts that would be coming - in on the listening interface. If you just toggle [226]-localhost on + in on the listening interface. If you just toggle [232]-localhost on and off x11vnc should see to it that you never get into such a state. Q-31: How can I tunnel my connection to x11vnc via an encrypted SSH channel between two Unix machines? - See the description earlier on this page on [227]how to tunnel VNC via + See the description earlier on this page on [233]how to tunnel VNC via SSH from Unix to Unix. A number of ways are described along with some issues you may encounter. @@ -1914,7 +1932,7 @@ TrueColor defdepth 24 Q-32: How can I tunnel my connection to x11vnc via an encrypted SSH channel from Windows using an SSH client like Putty? - [228]Above we described how to tunnel VNC via SSH from Unix to Unix, + [234]Above we described how to tunnel VNC via SSH from Unix to Unix, you may want to review it. To do this from Windows using Putty it would go something like this: * In the Putty dialog window under 'Session' enter the hostname or @@ -1937,8 +1955,8 @@ TrueColor defdepth 24 process in a BAT file including launching the VNC viewer by using the plink Putty utility. Send us the script if you get that working. - For extra protection feel free to run x11vnc with the [229]-localhost - and [230]-rfbauth/[231]-passwdfile options. + For extra protection feel free to run x11vnc with the [235]-localhost + and [236]-rfbauth/[237]-passwdfile options. If the machine you SSH into via Putty is not the same machine with the X display you wish to view (e.g. your company provides incoming SSH @@ -1947,9 +1965,9 @@ TrueColor defdepth 24 you'll need to do a second login (ssh or rsh) to the workstation machine 'otherhost' and then start up x11vnc on it. - As discussed [232]above another option is to first start the VNC + As discussed [238]above another option is to first start the VNC viewer in "listen" mode, and then launch x11vnc with the - "[233]-connect localhost" option to establish the reverse connection. + "[239]-connect localhost" option to establish the reverse connection. In this case a Remote port redirection (not Local) is needed for port 5500 instead of 5900 (i.e. 'Source port: 5500' and 'Destination: localhost:5500' for a Remote connection). @@ -1960,7 +1978,7 @@ TrueColor defdepth 24 some clients view-only? How about running an arbitrary program to make the decisions? - Yes, look at the "[234]-accept command" option, it allows you to + Yes, look at the "[240]-accept command" option, it allows you to specify an external command that is run for each new client. (use quotes around the command if it contains spaces, etc.). If the external command returns 0 the client is accepted, otherwise the @@ -1979,7 +1997,7 @@ TrueColor defdepth 24 own simple popup window. To accept the client press "y" or click mouse on the "Yes" button. To reject the client press "n" or click mouse on the "No" button. To accept the client View-only, press "v" or click - mouse on the "View" button. If the [235]-viewonly option has been + mouse on the "View" button. If the [241]-viewonly option has been supplied, the "View" action will not be present: the whole display is view only in that case. @@ -1995,7 +2013,7 @@ TrueColor defdepth 24 program to prompt the user whether the client should be accepted or not. This requires that you have xmessage installed and available via PATH. In case it is not already on your system, the xmessage program - is available at [236]ftp://ftp.x.org/ + is available at [242]ftp://ftp.x.org/ To include view-only decisions for the external commands, prefix the command something like this: "yes:0,no:*,view:3 mycommand ..." This @@ -2034,7 +2052,7 @@ elif [ $rc = 4 ]; then fi exit 1 - Stefan Radman has written a nice dtksh script [237]dtVncPopup for use + Stefan Radman has written a nice dtksh script [243]dtVncPopup for use in CDE environments to do the same sort of thing. Information on how to use it is found at the top of the file. He encourages you to provide feedback to him to help improve the script. @@ -2043,7 +2061,7 @@ exit 1 popup is being run, so attached clients will not receive screen updates, etc during this period. - To run a command when a client disconnects, use the "[238]-gone + To run a command when a client disconnects, use the "[244]-gone command" option. This is for the user's convenience only: the return code of the command is not interpreted by x11vnc. The same environment variables are set as in "-accept command" (except that RFB_MODE will @@ -2058,13 +2076,13 @@ exit 1 such support. One approximate method involves starting x11vnc with the - [239]-localhost option. This basically requires the viewer user to log + [245]-localhost option. This basically requires the viewer user to log into the workstation where x11vnc is running via their Unix username and password, and then somehow set up a port redirection of his vncviewer connection to make it appear to emanate from the local machine. As discussed above, ssh is useful for this: ssh -l username -L 5900:localhost:5900 hostname ... See the ssh wrapper scripts - mentioned [240]elsewhere on this page. Of course a malicious user + mentioned [246]elsewhere on this page. Of course a malicious user could allow other users to get in through his channel, but that is a problem with every method. Another thing to watch out for is a malicious user on the viewer side (where ssh is running) trying to @@ -2073,7 +2091,7 @@ exit 1 Regarding limiting the set of Unix usernames who can connect, the traditional way would be to further require a VNC password to supplied (-rfbauth, -passwd, etc). A scheme that avoids a second password - involves using the [241]-accept option that runs a program to examine + involves using the [247]-accept option that runs a program to examine the connection information to determine which user is connecting from the local machine. For example, the program could use the ident service on the local machine (normally ident should not be trusted @@ -2106,7 +2124,7 @@ exit 1 # reject it display manager like gdm(1). Can I have x11vnc later switch to a different user? - As of Feb/2005 x11vnc has the [242]-users option that allows things + As of Feb/2005 x11vnc has the [248]-users option that allows things like this. Please read the documentation on it (in the x11vnc -help output) carefully for features and caveats. It's use can often decrease security unless care is taken. A nice use of it is "-users @@ -2127,7 +2145,7 @@ exit 1 # reject it In any event, as of Jun/2004 there is an experimental utility to make it more difficult for nosey people to see your x11vnc activities. The - source for it is [243]blockdpy.c The idea behind it is simple (but + source for it is [249]blockdpy.c The idea behind it is simple (but obviously not bulletproof): when a VNC client attaches to x11vnc put the display monitor in the DPMS "off" state, if the DPMS state ever changes immediately start up the screen-lock program. The x11vnc user @@ -2143,8 +2161,8 @@ exit 1 # reject it bulletproof. A really robust solution would likely require X server and perhaps even video hardware support. - The blockdpy utility is launched by the [244]-accept option and told - to exit via the [245]-gone option (the vnc client user should + The blockdpy utility is launched by the [250]-accept option and told + to exit via the [251]-gone option (the vnc client user should obviously re-lock the screen before disconnecting!). Instructions can be found in the source code for the utility at the above link. @@ -2152,7 +2170,7 @@ exit 1 # reject it Q-37: Can I have x11vnc automatically lock the screen when I disconnect the VNC viewer? - Yes, a user mentions he uses the [246]-gone option under CDE to run a + Yes, a user mentions he uses the [252]-gone option under CDE to run a screen lock program: x11vnc -display :0 -forever -gone 'dtaction LockDisplay' @@ -2175,11 +2193,11 @@ exit 1 # reject it permissions to connect to the X display. Here are some ideas: - * Use the description under "Continuously" in the [247]FAQ on x11vnc + * Use the description under "Continuously" in the [253]FAQ on x11vnc and Display Managers - * Use the description in the [248]FAQ on x11vnc and inetd(1) + * Use the description in the [254]FAQ on x11vnc and inetd(1) * Start x11vnc from your $HOME/.xsession (or $HOME/.xinitrc) - * Although less reliable, see the [249]x11vnc_loop rc.local hack + * Although less reliable, see the [255]x11vnc_loop rc.local hack below. The display manager scheme will not be specific to which user has the @@ -2210,7 +2228,7 @@ x11vnc -logfile $HOME/.x11vnc.log -rfbauth $HOME/.vnc/passwd -forever -bg while running x11vnc as root, e.g. for the gnome display manager, gdm: x11vnc -auth /var/gdm/:0.Xauth -display :0 - (the [250]-auth option sets the XAUTHORITY variable for you). + (the [256]-auth option sets the XAUTHORITY variable for you). There will be a similar thing for xdm using however a different auth directory path (perhaps something like @@ -2235,7 +2253,7 @@ x11vnc -logfile $HOME/.x11vnc.log -rfbauth $HOME/.vnc/passwd -forever -bg auth file should be in /var/dt), you'll also need to add something like Dtlogin*grabServer:False to the Xconfig file (/etc/dt/config/Xconfig or /usr/dt/config/Xconfig on Solaris, see - [251]the example at the end of this FAQ). Then restart dtlogin, e.g.: + [257]the example at the end of this FAQ). Then restart dtlogin, e.g.: /etc/init.d/dtlogin stop; /etc/init.d/dtlogin start or reboot. Continuously. Have x11vnc reattach each time the X server is @@ -2289,7 +2307,7 @@ rever -bg Then restart: /usr/sbin/gdm-restart (or reboot). The KillInitClients=false setting is important: without it x11vnc will be - killed immediately after the user logs in. Here are [252]full details + killed immediately after the user logs in. Here are [258]full details on how to configure gdm _________________________________________________________________ @@ -2331,13 +2349,13 @@ rever -bg If you do not want to deal with any display manager startup scripts, here is a kludgey script that can be run manually or out of a boot - file like rc.local: [253]x11vnc_loop It will need some local + file like rc.local: [259]x11vnc_loop It will need some local customization before running. Because the XAUTHORITY auth file must be guessed by this script, use of the display manager script method described above is greatly preferred. If the machine is a traditional Xterminal you may want to read - [254]this FAQ. + [260]this FAQ. Q-40: Can I run x11vnc out of inetd(1)? How about xinetd(1)? @@ -2347,7 +2365,7 @@ rever -bg 5900 stream tcp nowait root /usr/sbin/tcpd /usr/local/bin/x11vnc_sh - where the shell script /usr/local/bin/x11vnc_sh uses the [255]-inetd + where the shell script /usr/local/bin/x11vnc_sh uses the [261]-inetd option and looks something like (you'll need to customize to your settings). #!/bin/sh @@ -2359,13 +2377,13 @@ rever -bg (otherwise the standard error also goes to the VNC vncviewer, and that confuses it greatly). If you do not use a wrapper script as above but rather call x11vnc directly in /etc/inetd.conf and do not redirect - stderr to a file, then you must specify the -q (aka [256]-quiet) + stderr to a file, then you must specify the -q (aka [262]-quiet) option: "/usr/local/bin/x11vnc -q -inetd ..." or use "-o logfile" to collect the output in a file. The wrapper script with redirection to a log file is the recommended method because the errors and warnings printed out are very useful in troubleshooting problems. - Note also the need to set XAUTHORITY via [257]-auth to point to the + Note also the need to set XAUTHORITY via [263]-auth to point to the MIT-COOKIE auth file to get permission to connect to the X display (setting and exporting the XAUTHORITY variable accomplishes the same thing). See the x11vnc_loop file in the previous question for more @@ -2413,7 +2431,7 @@ service x11vncservice web browser? To have x11vnc serve up a Java VNC viewer applet to any web browsers - that connect to it, run x11vnc with this [258]option: + that connect to it, run x11vnc with this [264]option: -httpdir /path/to/the/java/classes/dir (this directory will contain the files index.vnc and, for example, @@ -2443,7 +2461,7 @@ service x11vncservice As of Mar/2004 in the libvncserver CVS x11vnc supports reverse connections. On Unix one starts the VNC viewer in listen mode: vncviewer -listen (see your documentation for Windows, etc), and then - starts up x11vnc with the [259]-connect option. To connect immediately + starts up x11vnc with the [265]-connect option. To connect immediately 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 is 5500). If a file is specified instead: -connect /path/to/some/file @@ -2451,7 +2469,7 @@ service x11vncservice hosts to connect to. To use the vncconnect(1) program (from the core VNC package at - www.realvnc.com) specify the [260]-vncconnect option to x11vnc (Note: + www.realvnc.com) specify the [266]-vncconnect option to x11vnc (Note: 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 to communicate with x11vnc). If you do not have or do not want to get @@ -2493,7 +2511,7 @@ xprop -root -f VNC_CONNECT 8s -set VNC_CONNECT "$1" There are some annoyances WRT Xvfb though. The default keyboard mapping seems to be very poor. One should run x11vnc with - [261]-add_keysyms option to have keysyms added automatically. Also, to + [267]-add_keysyms option to have keysyms added automatically. Also, to add the Shift_R and Control_R modifiers something like this is needed: #!/bin/sh xmodmap -e "keycode any = Shift_R" @@ -2520,7 +2538,7 @@ xmodmap -e "add Control = Control_L Control_R" 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 keyboard or mouse, see the next paragraph). Then you can export that X - display via x11vnc (e.g. see [262]this FAQ) and access it from + display via x11vnc (e.g. see [268]this FAQ) and access it from anywhere on the network via a VNC viewer. Some tips on getting X servers to start on machines without keyboard @@ -2563,7 +2581,7 @@ xmodmap -e "add Control = Control_L Control_R" 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 - Here is a shell script [263]shm_clear to list and prompt for removal + Here is a shell script [269]shm_clear to list and prompt for removal 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 prompt). If x11vnc is regularly not cleaning up its shm segments, @@ -2597,35 +2615,35 @@ ied) in /etc/system. See the next paragraph for more workarounds. To minimize the number of shm segments used by x11vnc try using the - [264]-onetile option (corresponds to only 3 shm segments used, and + [270]-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 with shm segments, consider disabling shm completely via the - [265]-noshm option. Performance will be somewhat degraded but when + [271]-noshm option. Performance will be somewhat degraded but when done over local machine sockets it should be acceptable (see an - [266]earlier question discussing -noshm). + [272]earlier question discussing -noshm). Q-46: How can I make x11vnc use less system resources? - The [267]-nap and "[268]-wait n" (where n is the sleep between polls + The [273]-nap and "[274]-wait n" (where n is the sleep between polls 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 even 8bpp) will further decrease memory I/O and network I/O. Using the - [269]-onetile option will use less memory and use fewer shared memory - slots (add [270]-fs 1.0 for one less slot). + [275]-onetile option will use less memory and use fewer shared memory + slots (add [276]-fs 1.0 for one less slot). Q-47: How can I make x11vnc use MORE system resources? - You can try [271]-threads and dial down the wait time (e.g. -wait 1) - and possibly dial down [272]-defer as well. Note that if you try to + You can try [277]-threads and dial down the wait time (e.g. -wait 1) + and possibly dial down [278]-defer as well. Note that if you try to 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, etc. 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 - the x11vnc [273]-id option) can be streamed over a LAN or wireless at + the x11vnc [279]-id option) can be streamed over a LAN or wireless at a reasonable frame rate. @@ -2641,7 +2659,7 @@ ied) * Use a smaller desktop size (e.g. 1024x768 instead of 1280x1024) * Make sure the desktop background is a solid color (the background is resent every time it is re-exposed). Consider using the - [274]-solid [color] option. + [280]-solid [color] option. * Configure your window manager or desktop "theme" to not use fancy images, shading, and gradients for the window decorations, etc. Disable Opaque moves, resizes, and animations. @@ -2657,7 +2675,7 @@ ied) worth it, but could be of use in some situations. VNC viewer parameters: - * Use a [275]TightVNC enabled viewer! + * Use a [281]TightVNC enabled viewer! * Make sure the tight encoding is being used (look at vncviewer and x11vnc outputs) * Request 8 bits per pixel using -bgr233 (up to 4X speedup over @@ -2675,19 +2693,19 @@ ied) vncviewer to be very slow) x11vnc parameters: - * Try using [276]-nodragging (no screen updates when dragging mouse, + * Try using [282]-nodragging (no screen updates when dragging mouse, but sometimes you miss visual feedback) - * Try the [277]-progressive pixelheight mode with the block + * Try the [283]-progressive pixelheight mode with the block pixelheight 100 or so (delays sending vertical blocks since they may change while viewer is receiving earlier ones) - * Set [278]-fs 1.0 (disables fullscreen updates) - * Try increasing [279]-wait or [280]-defer (reduces the maximum + * Set [284]-fs 1.0 (disables fullscreen updates) + * Try increasing [285]-wait or [286]-defer (reduces the maximum "frame rate", but won't help much for large screen changes) - * If you just want to watch one (simple) window use [281]-id (cuts + * If you just want to watch one (simple) window use [287]-id (cuts down extraneous polling and updates, but can be buggy or insufficient) - * Set [282]-nosel (disables all clipboard selection exchange) - * Use [283]-nocursor and [284]-nocursorpos (repainting the remote + * Set [288]-nosel (disables all clipboard selection exchange) + * Use [289]-nocursor and [290]-nocursorpos (repainting the remote cursor position and shape takes resources and round trips) @@ -2695,30 +2713,131 @@ ied) things really bog down (unless I do the drag in a single, quick motion). Is there anything to do to improve things? + This problem is primarily due to slow read rates from 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 only read the + video card at about 5 MB/sec, so it can take a good 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 or scroll + appears to "lurch" forward). See the description in the + [291]-pointer_mode option for more info. The next bottleneck is + compressing all of these changes and sending them out to connected + viewers, however the VNC protocol is pretty much self-adapting with + respect to that (updates are only packaged and sent when viewers ask + for them). + As of Jan/2004 there are some improvements in the libvncserver CVS 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 reason these changes make matters worse, you can go back to the old - way via the "[285]-pointer_mode 1" option. + way via the "[292]-pointer_mode 1" option. - Also added was the [286]-nodragging option that disables all screen + Also added was the [293]-nodragging option that disables all screen updates while dragging with the mouse (i.e. mouse motion with a button held down). This gives the snappiest response, but might be undesired in some circumstances when you want to see the visual feedback while dragging (e.g. menu traversal or text selection). - As of Dec/2004 in the libvncserver CVS the [287]-pointer_mode n option - was introduced. n=1 is the original mose, n=2 and improvement, etc.. + As of Dec/2004 in the libvncserver CVS the [294]-pointer_mode n option + was introduced. n=1 is the original mode, n=2 an improvement, etc.. See the -pointer_mode n help for more info. - Also, in some circumstances the [288]-threads option can improve + Also, in some circumstances the [295]-threads option can improve response considerably. Be forewarned that if more than one vncviewer 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 ZRLE). - - Q-50: Does x11vnc support the X DAMAGE Xserver extension to find + See the [296]wireframe FAQ below for a scheme to sweep this problem + under the rug for window moves or resizes. + + + Q-50: Why not do something like wireframe animations to avoid the + windows "lurching" when being moved or resized? + + Nice idea for a hack! As of Apr/2005 in the libvncserver CVS x11vnc by + default will apply heuristics to try to guess if a window is being + (opaquely) moved or resized. If such a change is detected framebuffer + polling and updates will be suspended and only an animated "wireframe" + (a rectangle outline drawn where the moved/resized window would be) is + shown. When the window move/resize stops, it returns to normal + processing: you should just see the window appear in the new position. + This spares you from interacting with a "lurching" window during all + of the intermediate steps. (the lurching is due to [297]slow video + card read rates) + + The mode is currently on be default because most people are inflicted + with the problem. It can be disabled with the [298]-nowireframe + option. Why might one want to turn off the wireframing? Since 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 you + move the pointer. If your window-manager or desktop already does its + own wireframing then this mode is a waste of time or could do the + wrong thing occasionally. There may be other reasons the new mode + feels unnatural. If you have very expensive video hardware (SGI) or + are using an in-RAM video framebuffer (SunRay, ShadowFB, Xvfb), the + read rate from that framebuffer may be very fast (100's of MB/sec) and + so you don't really see much lurching: opaque moves look smooth in + x11vnc. Note: ShadowFB is often turned on when you are using the + vesafb or fbdev XFree86 video driver instead of a native one. + + The heuristics used to guess window motion or resizing are simple, but + are not fool proof: x11vnc is sometimes tricked and so you'll + occasionally see the lurching opaque move and rarely something even + worse. First it assumes that the move/resize will occur with a mouse + button pressed and held down (of course this is only mostly true). + Next it will only consider a window for wireframing if the mouse + pointer is initially "close enough" to the edges of the window frame, + e.g. you have grabbed the title bar or a resizer edge (this + requirement can be disabled). If these are true, it will wait an + amount of time to see if the window starts moving or resizing. If it + does, it starts drawing the wireframe "animation" of where the window + would be. If the mouse button is released, or a timeout occurs, it + goes back to the standard mode to allow the framebuffer changes to + propagate to the viewers. + + These parameters can be tweaked: + * Color/Shade of the wireframe. + * Linewidth of the outline frame. + * Cutoff size of windows to not apply wireframing to. + * Cutoffs for closeness to Top, Bottom, Left, and Right edges of + window. + * Maximum time to wait for dragging pointer events. + * Maximum time to wait for the window to start moving/resizing. + * Maximum time to show a wireframe animation. + * Minimum time between sending wireframe outlines. + + See the [299]"-wireframe tweaks" option for more details. On a slow + link, e.g. dialup modem, you may want to increase all four of these + times, e.g. double them from the defaults. + + + CopyRect encoding: In addition to the above there is the + [300]"-wirecopyrect mode" option. It is also on by default. This + instructs x11vnc to not only show show the wireframe animation, but to + also instruct all connected VNC viewers to locally translate the + window image data from the original position to the new position on + the screen when the animation is done. This speedup is the VNC + CopyRect encoding: the framebuffer update doesn't need to send the + actual new image data. This is nice in general, and very convenient + over a slow link, but since it is based on heuristics you may need to + disable it with the -nowirecopyrect option if it works incorrectly or + unnaturally for you. + + The -wirecopyrect modes are: "never" (same as -nowirecopyrect); "top", + only apply the CopyRect if the window is appears to be on the top of + the window stack and is not obstructed by other windows; and "always" + to always try to apply the CopyRect (obstructed regions are clipped + off and not translated). + + Note that some desktops (KDE and xfce) appear to mess with the window + stacking in ways that are not yet clear. In these cases x11vnc works + around the problem by applying the CopyRect even if obscuring windows' + data is translated! Use -nowirecopyrect if this yields undesirable + effects for your desktop. + + + Q-51: Does x11vnc support the X DAMAGE Xserver extension to find modified regions of the screen quickly and efficiently? Yes, as of Mar/2005 in the libvncserver CVS x11vnc will use the X @@ -2750,19 +2869,19 @@ ied) To work around this deficiency, x11vnc currently only trusts small DAMAGE rectangles to contain real damage. The larger rectangles are - only used as hints to direct 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 - skipped). You can use the "[289]-xd_area A" option to adjust the size + skipped). You can use the "[301]-xd_area A" option to adjust the size 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 all DAMAGE rectangles. - The option "[290]-xd_mem f" may also be of use in tuning the - algorithm. To disable using DAMAGE entirely use "[291]-noxdamage". + The option "[302]-xd_mem f" may also be of use in tuning the + algorithm. To disable using DAMAGE entirely use "[303]-noxdamage". [Mouse Cursor Shapes] - Q-51: Why isn't the mouse cursor shape (the little icon shape where + Q-52: Why isn't the mouse cursor shape (the little icon shape where the mouse pointer is) correct as I move from window to window? On X servers supporting XFIXES or Solaris/IRIX Overlay extensions it @@ -2776,16 +2895,16 @@ ied) this is because the cursor shape is often downloaded to the graphics hardware (video card), but I could be mistaken. - A simple kludge is provided by the "[292]-cursor X" option that + A simple kludge is provided by the "[304]-cursor X" option that changes the cursor when the mouse is on the root background (or any window has the same cursor as the root background). Note that desktops like GNOME or KDE often cover up the root background, so this won't - work for those cases. Also see the "[293]-cursor some" option for + work for those cases. Also see the "[305]-cursor some" option for additional kludges. 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 - cursor when the [294]-overlay option is supplied. See [295]this FAQ + cursor when the [306]-overlay option is supplied. See [307]this FAQ for more info. Also as of Dec/2004 in the libvncserver CVS XFIXES X extension support @@ -2793,7 +2912,7 @@ ied) XFIXES fixes the problem of the cursor-shape being write-only: x11vnc can now query the X server for the current shape and send it back to the connected viewers. XFIXES is available on recent Linux Xorg based - distros and [296]Solaris 10. + distros and [308]Solaris 10. The only XFIXES issue is the handling of alpha channel transparency in cursors. If a cursor has any translucency then in general it must be @@ -2801,10 +2920,10 @@ ied) cursor transparency can also handled exactly: when the VNC Viewer requires the cursor shape be drawn into the VNC framebuffer or if you apply a patch to your VNC Viewer to extract hidden alpha channel data - under 32bpp. [297]Details can be found here. + under 32bpp. [309]Details can be found here. - Q-52: When using XFIXES cursorshape mode, some of the cursors look + Q-53: When using XFIXES cursorshape mode, some of the cursors look really bad with extra black borders around the cursor and other cruft. How can I improve their appearance? @@ -2834,17 +2953,17 @@ ied) for most cursor themes and you don't have to worry about it. In case it still looks bad for your cursor theme, there are (of - course!) some tunable parameters. The "[298]-alphacut n" option lets + course!) some tunable parameters. The "[310]-alphacut n" option lets you set the threshold "n" (between 0 and 255): cursor pixels with alpha values below n will be considered completely transparent while values equal to or above n will be completely opaque. The default is - 240. The "[299]-alphafrac f" option tries to correct individual + 240. The "[311]-alphafrac f" option tries to correct individual cursors that did not fare well with the default -alphacut value: if a cursor has less than fraction f (between 0.0 and 1.0) of its pixels selected by the default -alphacut, the threshold is lowered until f of its pixels are selected. The default fraction is 0.33. - Finally, there is an option [300]-alpharemove that is useful for + Finally, there is an option [312]-alpharemove that is useful for themes where many cursors are light colored (e.g. "whiteglass"). XFIXES returns the cursor data with the RGB values pre-multiplied by the alpha value. If the white cursors look too grey, specify @@ -2852,7 +2971,7 @@ ied) value. - Q-53: In XFIXES mode, are there any hacks to handle cursor + Q-54: In XFIXES mode, are there any hacks to handle cursor transparency ("alpha channel") exactly? As of Jan/2005 in the CVS, libvncserver has been modified to allow an @@ -2860,11 +2979,11 @@ ied) send the alpha channel data to libvncserver. However, this data will only be used for VNC clients that do not support the CursorShapeUpdates VNC extension (or have disabled it). It can be - disabled for all clients with the [301]-nocursorshape x11vnc option. + disabled for all clients with the [313]-nocursorshape x11vnc option. In this case the cursor is drawn, correctly blended with the background, into the VNC framebuffer before being sent out to the client. So the alpha blending is done on the x11vnc side. Use the - [302]-noalphablend option to disable this behavior (always approximate + [314]-noalphablend option to disable this behavior (always approximate transparent cursors with opaque RGB values). The CursorShapeUpdates VNC extension complicates matters because the @@ -2889,12 +3008,12 @@ ied) [Mouse Pointer] - Q-54: Why does the mouse arrow just stay in one corner in my + Q-55: Why does the mouse arrow just stay in one corner in my vncviewer, whereas my cursor (that does move) is just a dot? - This default takes advantage of a [303]tightvnc extension + This default takes advantage of a [315]tightvnc extension (CursorShapeUpdates) that allows specifying a cursor image shape for - the local VNC viewer. You may disable it with the [304]-nocursor + the local VNC viewer. You may disable it with the [316]-nocursor 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 @@ -2903,23 +3022,23 @@ ied) framebuffer. This can also be disabled via -nocursor. - Q-55: Can I take advantage of the TightVNC extension to the VNC + Q-56: Can I take advantage of the TightVNC extension to the VNC protocol where Cursor Positions Updates are sent back to all connected clients (i.e. passive viewers can see the mouse cursor being moved around by another viewer)? - Use the [305]-cursorpos option when starting x11vnc. A VNC viewer must + Use the [317]-cursorpos option when starting x11vnc. A VNC viewer must support the Cursor Positions Updates for the user to see the mouse motions (the TightVNC viewers support this). As of Aug/2004 in the - libvncserver CVS -cursorpos is the default. See also [306]-nocursorpos - and [307]-nocursorshape. + libvncserver CVS -cursorpos is the default. See also [318]-nocursorpos + and [319]-nocursorshape. - Q-56: Is it possible to swap the mouse buttons (e.g. left-handed + Q-57: Is it possible to swap the mouse buttons (e.g. left-handed operation), or arbitrarily remap them? How about mapping button clicks to keystrokes, e.g. to partially emulate Mouse wheel scrolling? - You can remap the mouse buttons via something like: [308]-buttonmap + You can remap the mouse buttons via something like: [320]-buttonmap 13-31 (or perhaps 12-21). Also, note that xmodmap(1) lets you directly adjust the X server's button mappings, but in some circumstances it might be more desirable to have x11vnc do it. @@ -2927,7 +3046,7 @@ ied) One user had an X server with only one mouse button(!) and was able to map all of the VNC client mouse buttons to it via: -buttonmap 123-111. - Note that the [309]-debug_pointer option prints out much info for + Note that the [321]-debug_pointer option prints out much info for every mouse/pointer event and is handy in solving problems. To map mouse button clicks to keystrokes you can use the alternate @@ -2949,7 +3068,7 @@ ied) Exactly what keystroke "scrolling" events they should be bound to depends on one's taste. If this method is too approximate, one could - consider not using [310]-buttonmap but rather configuring the X server + consider not using [322]-buttonmap but rather configuring the X server to think it has a mouse with 5 buttons even though the physical mouse does not. @@ -2967,10 +3086,10 @@ ied) (yes, this is getting a little silly). [Keyboard Issues] - Q-57: How can I get my AltGr and Shift modifiers to work between + Q-58: How can I get my AltGr and Shift modifiers to work between keyboards for different languages? - The option [311]-modtweak should be of some use for this. It is a mode + The option [323]-modtweak should be of some use for this. It is a mode that monitors the state of the Shift and AltGr Modifiers and tries to deduce the correct keycode to send, possibly by sending fake modifier key presses and releases in addition to the actual keystroke. @@ -2979,21 +3098,21 @@ ied) default (use -nomodtweak to get the old behavior). This was done because it was noticed on newer XFree86 setups even on bland "us" keyboards like "pc104 us" XFree86 included a "ghost" key with both "<" - and ">" it. This key does not exist on the keyboard (see [312]this FAQ + and ">" it. This key does not exist on the keyboard (see [324]this FAQ for more info). Without -modtweak there was then an ambiguity in the reverse map keysym => keycode, making it so the "<" symbol could not be typed. - Also see the [313]FAQ about the -xkb option for a more powerful method + Also see the [325]FAQ about the -xkb option for a more powerful method of modifier tweaking for use on X servers with the XKEYBOARD extension. When trying to resolve keyboard mapping problems, note that the - [314]-debug_keyboard option prints out much info for every keystroke + [326]-debug_keyboard option prints out much info for every keystroke and so can be useful debugging things. - Q-58: When I try to type a "<" (i.e. less than) instead I get ">" + Q-59: When I try to type a "<" (i.e. less than) instead I get ">" (i.e. greater than)! Strangely, typing ">" works OK!! Does your keyboard have a single key with both "<" and ">" on it? Even @@ -3040,21 +3159,21 @@ ied) -remap less-comma These are convenient in that they do not modify the actual X server - settings. The former ([315]-modtweak) is a mode that monitors the + settings. The former ([327]-modtweak) is a mode that monitors the state of the Shift and AltGr modifiers and tries to deduce the correct keycode sequence to send. Since Jul/2004 -modtweak is now the default. - The latter ([316]-remap less-comma) is an immediate remapping of the + The latter ([328]-remap less-comma) is an immediate remapping of the keysym less to the keysym comma when it comes in from a client (so when Shift is down the comma press will yield "<"). - See also the [317]FAQ about the -xkb option as a possible workaround + See also the [329]FAQ about the -xkb option as a possible workaround using the XKEYBOARD extension. - Note that the [318]-debug_keyboard option prints out much info for + Note that the [330]-debug_keyboard option prints out much info for every keystroke to aid debugging keyboard problems. - Q-59: I'm using an "international" keyboard (e.g. German "de", or + Q-60: I'm using an "international" keyboard (e.g. German "de", or Danish "dk") and the -modtweak mode works well if the VNC viewer is run on a Unix/Linux machine with a similar keyboard. But if I run the VNC viewer on Unix/Linux with a different keyboard (e.g. "us") or @@ -3075,7 +3194,7 @@ ied) In both cases no AltGr is sent to the VNC server, but we know AltGr is needed on the physical international keyboard to type a "@". - This all worked fine with x11vnc running with the [319]-modtweak + This all worked fine with x11vnc running with the [331]-modtweak option (it figures out how to adjust the Modifier keys (Shift or AltGr) to get the "@"). However it fails under recent versions of XFree86 (and the X.org fork). These run the XKEYBOARD extension by @@ -3093,7 +3212,7 @@ ied) * there is a new option -xkb to use the XKEYBOARD extension API to do the Modifier key tweaking. - The [320]-xkb option seems to fix all of the missing keys: "@", "<", + The [332]-xkb option seems to fix all of the missing keys: "@", "<", ">", etc.: it is recommended that you try it if you have this sort of problem. Let us know if there are any remaining problems (see the next paragraph for some known problems). If you specify the -debug_keyboard @@ -3111,7 +3230,7 @@ ied) was attached to keycode 93 (no physical key generates this keycode) while ISO_Level3_Shift was attached to keycode 113. The keycode skipping option was used to disable the ghost key: - [321]-skip_keycodes 93 + [333]-skip_keycodes 93 * In implementing -xkb we noticed that some characters were still not getting through, e.g. "~" and "^". This is not really an XKEYBOARD problem. What was happening was the VNC viewer was @@ -3128,14 +3247,14 @@ ied) What to do? In general the VNC protocol has not really solved this problem: what should be done if the VNC viewer sends a keysym not recognized by the VNC server side? Workarounds can possibly be - created using the [322]-remap x11vnc option: + created using the [334]-remap x11vnc option: -remap asciitilde-dead_tilde,asciicircum-dead_circumflex etc. Use -remap filename if the list is long. Please send us your workarounds for this problem on your keyboard. Perhaps we can have x11vnc adjust automatically at some point. Also see the - [323]-add_keysyms option in the next paragraph. - * To complement the above workaround using the [324]-remap, an - option [325]-add_keysyms was added. This option instructs x11vnc + [335]-add_keysyms option in the next paragraph. + * To complement the above workaround using the [336]-remap, an + option [337]-add_keysyms was added. This option instructs x11vnc to bind any unknown Keysyms coming in from VNC viewers to unused Keycodes in the X server. This modifies the global state of the X server. When x11vnc exits it removes the extra keymappings it @@ -3144,7 +3263,7 @@ ied) would -add_keysyms, or anything else, come into play. - Q-60: When typing I sometimes get double, triple, or more of my + Q-61: When typing I sometimes get double, triple, or more of my keystrokes repeated. I'm sure I only typed them once, what can I do? This may be due to an interplay between your X server's key autorepeat @@ -3152,7 +3271,7 @@ ied) Short answer: disable key autorepeating by running the command "xset r off" on the Xserver where x11vnc is run (restore via "xset r on") or - use the new (Jul/2004) [326]-norepeat x11vnc option. You will still + use the new (Jul/2004) [338]-norepeat x11vnc option. You will still have autorepeating because that is taken care of on your VNC viewer side. Update: as of Dec/2004 -norepeat is now the default. Use -repeat to disable it. @@ -3174,18 +3293,18 @@ ied) off", does the problem go away? The workaround is to manually apply "xset r off" and "xset r on" as - needed, or to use the [327]-norepeat (which has since Dec/2004 been + needed, or to use the [339]-norepeat (which has since Dec/2004 been made the default). Note that with X server autorepeat turned off the VNC viewer side of the connection will (nearly always) do its own autorepeating so there is no big loss here, unless someone is also working at the physical display and misses his autorepeating. - Q-61: The x11vnc -norepeat mode is in effect, but I still get repeated + Q-62: The x11vnc -norepeat mode is in effect, but I still get repeated keystrokes!! Are you using x11vnc to log in to an X session? (as described in - [328]this FAQ) If so, x11vnc is starting before your session and it + [340]this FAQ) If so, x11vnc is starting before your session and it disables autorepeat when you connect, but then after you log in your session startup (GNOME, KDE, ...) could be resetting the autorepeat to be on. Or it could be something inside your desktop trying to be @@ -3205,11 +3324,11 @@ ied) should figure out how to disable that somehow. - Q-62: The machine where I run x11vnc has an AltGr key, but the local + Q-63: The machine where I run x11vnc has an AltGr key, but the local machine where I run the VNC viewer does not. Is there a way I can map a local unused key to send an AltGr? How about a Compose key as well? - Something like "[329]-remap Super_R-Mode_switch" x11vnc option may + Something like "[341]-remap Super_R-Mode_switch" x11vnc option may work. Note that Super_R is the "Right Windoze(tm) Flaggie" key; you may want to choose another. The -debug_keyboard option comes in handy in finding keysym names (so does xev(1)). @@ -3220,7 +3339,7 @@ ied) specify remappings from a file. - Q-63: I have a Sun machine I run x11vnc on. Its Sun keyboard has just + Q-64: I have a Sun machine I run x11vnc on. Its Sun keyboard has just one Alt key labelled "Alt" and two Meta keys labelled with little diamonds. The machine where I run the VNC viewer only has Alt keys. How can I send a Meta keypress? (e.g. emacs needs this) @@ -3232,18 +3351,18 @@ ied) Since xmodmap(1) modifies the X server mappings you may not want to do this (because it affects local work on that machine). Something like - the [330]-remap Alt_L-Meta_L to x11vnc may be sufficient for ones + the [342]-remap Alt_L-Meta_L to x11vnc may be sufficient for ones needs, and does not modify the X server environment. Note that you cannot send Alt_L in this case, maybe -remap Super_L-Meta_L would be a better choice if the Super_L key is typically unused. - Q-64: Can I map a keystroke to a mouse button click on the remote + Q-65: Can I map a keystroke to a mouse button click on the remote machine? This can be done directly in some X servers using AccessX and Pointer_EnableKeys, but is a bit awkward. It may be more convenient to - have x11vnc do the remapping. This can be done via the [331]-remap + have x11vnc do the remapping. This can be done via the [343]-remap option using the fake "keysyms" Button1, Button2, etc. as the "to" keys (i.e. the ones after the "-") @@ -3251,7 +3370,7 @@ ied) a touchpad with only two buttons. It is difficult to do a middle button "paste" because (using XFree86 Emulate3Buttons) you have to click both buttons on the touch pad at the same time. This remapping: - [332]-remap Super_R-Button2 + [344]-remap Super_R-Button2 maps the Super_R "flag" key press to the Button2 click, thereby making X pasting a bit easier. @@ -3262,7 +3381,7 @@ ied) [Screen Related Issues and Features] - Q-65: The remote display is larger (in number of pixels) than the + Q-66: The remote display is larger (in number of pixels) than the local display I am running the vncviewer on. I don't like the vncviewer scrollbars, what I can do? @@ -3280,16 +3399,16 @@ ied) There may also be scaling viewers out there (e.g. TightVNC on Windows) that automatically shrink or expand the remote framebuffer to fit the - local display. Especially for hand-held devices. See also [333]this + local display. Especially for hand-held devices. See also [345]this FAQ on x11vnc scaling. - Q-66: Does x11vnc support server-side framebuffer scaling? (E.g. to + Q-67: Does x11vnc support server-side framebuffer scaling? (E.g. to make the desktop smaller). As of Jun/2004 in the libvncserver CVS x11vnc provides basic server-side scaling. It is a global scaling of the desktop, not a - per-client setting. To enable it use the "[334]-scale fraction" + per-client setting. To enable it use the "[346]-scale fraction" option. "fraction" can either be a floating point number (e.g. -scale 0.5) or the alternative m/n fraction notation (e.g. -scale 2/3). Note that if fraction is greater than one the display is magnified. @@ -3309,7 +3428,7 @@ ied) 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 - [335]applications. Since with integer scale factors the framebuffers + [347]applications. Since with integer scale factors the framebuffers become huge and scaling operations time consuming, be sure to use ":nb" for the fastest response. @@ -3335,17 +3454,17 @@ ied) If one desires per-client scaling for something like 1:1 from a workstation and 1:2 from a smaller device (e.g. handheld), currently the only option is to run two (or more) x11vnc processes with - different scalings listening on separate ports ([336]-rfbport option, + different scalings listening on separate ports ([348]-rfbport option, etc.). 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 want - that, use the [337]"-scale_cursor frac" option to set the cursor + that, use the [349]"-scale_cursor frac" option to set the cursor scaling to a different factor (e.g. use "-scale_cursor 1" to keep the cursor at its natural unscaled size). - Q-67: Does x11vnc work with Xinerama? (i.e. multiple monitors joined + Q-68: Does x11vnc work with Xinerama? (i.e. multiple monitors joined together to form one big, single screen). Yes, it should generally work because it simply polls the big @@ -3357,23 +3476,23 @@ ied) rectangular (e.g. 1280x1024 and 1024x768 monitors joined together), then there will be "non-existent" areas on the screen. The X server will return "garbage" image data for these areas and so they may be - distracting to the viewer. The [338]-blackout x11vnc option allows you + distracting to the viewer. The [350]-blackout x11vnc option allows you to blacken-out rectangles by specifying their WxH+X+Y geometries. If - your system has the libXinerama library, the [339]-xinerama x11vnc + your system has the libXinerama library, the [351]-xinerama x11vnc option can be used to have it automatically determine the rectangles to be blackened out. (Note on 8bpp PseudoColor displays the fill color may not be black). Some users have reported that the mouse does not behave properly for their Xinerama display: i.e. the mouse cannot be moved to all regions - of the large display. If this happens try using the [340]-xwarppointer + of the large display. If this happens try using the [352]-xwarppointer option. This instructs x11vnc to fake mouse pointer motions using the XWarpPointer function instead of the XTestFakeMotionEvent XTEST function. (This may be due to a bug in the X server for XTEST when Xinerama is enabled). - Q-68: Can I use x11vnc on a multi-headed display that is not Xinerama + Q-69: Can I use x11vnc on a multi-headed display that is not Xinerama (i.e. separate screens :0.0, :0.1, ... for each monitor)? You can, but it is a little bit awkward: you must start separate @@ -3391,31 +3510,31 @@ ied) Note: if you are running on Solaris 8 or earlier you can easily hit up against the maximum of 6 shm segments per process (for Xsun in this case) from running multiple x11vnc processes. You should modify - /etc/system as mentioned in another [341]FAQ to increase the limit. It - is probably also a good idea to run with the [342]-onetile option in + /etc/system as mentioned in another [353]FAQ to increase the limit. It + is probably also a good idea to run with the [354]-onetile option in this case (to limit each x11vnc to 3 shm segments), or even - [343]-noshm to use no shm segments. + [355]-noshm to use no shm segments. - Q-69: Can x11vnc show only a portion of the display? (E.g. for a + Q-70: Can x11vnc show only a portion of the display? (E.g. for a special purpose rfb application). - As of Mar/2005 in the libvncserver CVS x11vnc has the "[344]-clip + As of Mar/2005 in the libvncserver CVS x11vnc has the "[356]-clip WxH+X+Y" option to select a rectangle of width W, height H and offset (X, Y). Thus the VNC screen will be the clipped sub-region of the display and be only WxH in size. This also works to view a sub-region of a single application window if - the [345]-id or [346]-sid options are used. The offset is measured + the [357]-id or [358]-sid options are used. The offset is measured from the upper left corner of the selected window. - Q-70: Does x11vnc support the XRANDR (X Resize, Rotate and Reflection) + Q-71: Does x11vnc support the XRANDR (X Resize, Rotate and Reflection) extension? Whenever I rotate or resize the screen x11vnc just seems to crash. As of Dec/2004 in the libvncserver CVS x11vnc supports XRANDR. You - enable it with the [347]-xrandr option to make x11vnc monitor XRANDR + enable it with the [359]-xrandr option to make x11vnc monitor XRANDR events and also trap X server errors if the screen change occurred in the middle of an X call like XGetImage. Once it traps the screen change it will create a new framebuffer using the new screen. If the @@ -3424,7 +3543,7 @@ ied) viewer will automatically resize. Otherwise, the new framebuffer is fit as best as possible into the original viewer size (portions of the screen may be clipped, unused, etc). For these viewers you can try the - [348]-padgeom option to make the region big enough to hold all resizes + [360]-padgeom option to make the region big enough to hold all resizes and rotations. If you specify "-xrandr newfbsize" then vnc viewers that do not @@ -3433,13 +3552,13 @@ ied) terminate. - Q-71: Why is the view in my VNC viewer completely black? Or why is + Q-72: Why is the view in my VNC viewer completely black? Or why is everything flashing around randomly? See the next FAQ for a possible explanation. - Q-72: I use Linux Virtual Consoles (VC's) to implement 'Fast User + Q-73: I use Linux Virtual Consoles (VC's) to implement 'Fast User Switching' between users' sessions (e.g. Betty is on Ctrl-Alt-F7, Bobby is on Ctrl-Alt-F8, and Sid is on Ctrl-Alt-F1: they use those keystrokes to switch between their sessions). How come the view in a @@ -3467,7 +3586,7 @@ ied) "chvt 7" for VC #7. - Q-73: Can I use x11vnc to view my VMWare session remotely? + Q-74: Can I use x11vnc to view my VMWare session remotely? Yes, since VMWare is an X application you can view it via x11vnc in the normal way. @@ -3478,9 +3597,9 @@ ied) * Fullscreen mode The way VMWare does Fullscreen mode on Linux is to display the Guest - desktop in a separate Virtual Console (e.g. VC 8) (see [349]this FAQ + desktop in a separate Virtual Console (e.g. VC 8) (see [361]this FAQ on VC's for background). Unfortunately, this Fullscreen VC is not an X - server. So x11vnc cannot access it (however, [350]see this for a + server. So x11vnc cannot access it (however, [362]see this for a possible partial workaround). x11vnc works fine with "Normal X application window" and "Quick-Switch mode" because these use X. @@ -3497,13 +3616,13 @@ ied) 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 emulates Fullscreen mode to some degree and can be viewed via x11vnc - as long as the VMWare X session [351]is in the active VC. + as long as the VMWare X session [363]is in the active VC. Also note that with a little bit of playing with "xwininfo -all -children" output one can extract the (non-toplevel) windowid of the of the Guest desktop only when VMWare is running as a normal X application. Then one can export just the guest desktop (i.e. without - the VMWare menu buttons) by use of the [352]-id windowid option. The + the VMWare menu buttons) by use of the [364]-id windowid option. The caveats are the X session VMWare is in must be in the active VC and the window must be fully visible, so this mode is not terribly convenient, but could be useful in some circumstances (e.g. running @@ -3512,7 +3631,7 @@ ied) mouse)). - Q-74: Can non-X devices (e.g. a raw framebuffer) be viewed and/or + Q-75: Can non-X devices (e.g. a raw framebuffer) be viewed and/or controlled by x11vnc? As of Apr/2005 in the libvncserver CVS there is rudimentary support @@ -3529,7 +3648,7 @@ ied) such an option via the command line or remote control. The format for the -rawfb string is: - <type>:<object>@<W>x<H>x<bpp>[:<R>/<G>/<B>][+<offset>] + -rawfb <type>:<object>@<W>x<H>x<bpp>[:<R>/<G>/<B>][+<offset>] Some examples: -rawfb shm:210337933@800x600x32:ff/ff00/ff0000 @@ -3544,7 +3663,8 @@ ied) "file" for file objects. "map" uses mmap(2) to map the file into memory and is preferred over "file" (that uses the slower lseek(2) access method). Only use file if map isn't working. BTW, "mmap" is an - alias for "map". + alias for "map" and if you do not supply a type and the file exists, + map is assumed. Also, if the string is of the form "setup:cmd" then cmd is run and the first line of its output retrieved and used as the rawfb string. This @@ -3583,7 +3703,7 @@ ied) screen to either shm or a mapped file. The format of these is XWD and so the initial header should be skipped. BTW, since XWD is not strictly RGB the view will only be approximate. Of course for the case - of Xvfb x11vnc can poll it much better via the [353]X API, but you get + of Xvfb x11vnc can poll it much better via the [365]X API, but you get the idea. By default in -rawfb mode x11vnc will actually close any X display it @@ -3593,7 +3713,10 @@ ied) framebuffer capitalize the type (i.e. "SHM:", "MAP:", or "FILE:"). This could be convenient for keeping the remote control channel active (it uses X properties). The "-connect /path/to/file" mechanism could - also be used for remote control to avoid the X property channel. + also be used for remote control to avoid the X property channel. Rare + usage, but if you also supply -noviewonly in this mode then the mouse + and keyboard input are still sent to the X display, presumably for + doing something strange with /dev/fb... All of the above was just for viewing the raw framebuffer. That may be @@ -3633,7 +3756,7 @@ ied) keystrokes into the Linux console (e.g. the virtual consoles: /dev/tty1, /dev/tty2, etc) in x11vnc/misc/vcinject.pl. It is based on the vncterm/LinuxVNC.c program also in the libvncserver CVS. So to - view and interact with VC #2 (assuming it is the [354]active VC) one + view and interact with VC #2 (assuming it is the [366]active VC) one can run something like: x11vnc -rawfb map:/dev/fb0@1024x768x16 -pipeinput './vcinject.pl 2' @@ -3646,7 +3769,7 @@ ied) more accurate and faster LinuxVNC program. The only advantage x11vnc -rawfb might have is that it can presumably allow interaction with a non-text application, e.g. one based on svgalib. For example the - [355]VMWare Fullscreen mode is actually viewable under -rawfb. But + [367]VMWare Fullscreen mode is actually viewable under -rawfb. But this isn't much use until one figures out how to inject keystrokes and mouse events. @@ -3657,7 +3780,7 @@ ied) program that passes the framebuffer to libvncserver. - Q-75: I am using x11vnc where my local machine has "popup/hidden + Q-76: I am using x11vnc where my local machine has "popup/hidden taskbars" (e.g. GNOME or MacOS X) and the remote display where x11vnc runs also has "popup/hidden taskbars" (e.g. GNOME). When I move the mouse to the edge of the screen where the popups happen, the taskbars @@ -3671,22 +3794,22 @@ ied) [Misc: Clipboard, Beeps, Thanks, etc.] - Q-76: Does the Clipboard/Selection get transferred between the + Q-77: Does the Clipboard/Selection get transferred between the vncviewer and the X display? As of Jan/2004 in the libvncserver CVS x11vnc supports the "CutText" 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 - the Clipboard/Selection exchanged use the [356]-nosel option. If you + the Clipboard/Selection exchanged use the [368]-nosel option. If you don't want the PRIMARY selection to be polled for changes use the - [357]-noprimary option. + [369]-noprimary option. You may need to watch out for desktop utilities such as KDE's "Klipper" that do odd things with the selection, clipboard, and cutbuffers. - Q-77: Why don't I hear the "Beeps" in my X session (e.g. when typing + Q-78: Why don't I hear the "Beeps" in my X session (e.g. when typing tput bel in an xterm)? As of Dec/2003 in the libvncserver CVS "Beep" XBell events are tracked @@ -3694,21 +3817,23 @@ ied) 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. - If you don't want to hear the beeps use the [358]-nobell option. If + If you don't want to hear the beeps use the [370]-nobell option. If you want to hear the audio from the remote applications, consider trying a redirector such as esd. + + Contributions: - Q-78: Thanks for your program and for your help! Can I make a + Q-79: Thanks for your program and for your help! Can I make a donation? Please do (any amount is appreciated) and thank you for your support! Click on the PayPal button below for more info. Also, in general I always enjoy hearing from x11vnc users, how they use it, what new features they would like, etc. Please send me an - [359]email! + [371]email! [PayPal] @@ -3718,361 +3843,373 @@ References 2. http://www.karlrunge.com/x11vnc/index.html#downloading 3. http://www.karlrunge.com/x11vnc/index.html#building 4. http://www.karlrunge.com/x11vnc/index.html#faq-thanks - 5. http://www.karlrunge.com/x11vnc/index.html#faq - 6. http://www.karlrunge.com/x11vnc/index.html#contact - 7. http://www.uk.research.att.com/vnc/ - 8. http://www.realvnc.com/ - 9. http://www.tightvnc.com/ - 10. http://www.karlrunge.com/x11vnc/index.html#downloading - 11. http://www.tightvnc.com/download.html - 12. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-auth - 13. http://www.karlrunge.com/x11vnc/index.html#faq-xperms - 14. http://www.karlrunge.com/x11vnc/index.html#faq-viewer-download - 15. http://www.sun.com/software/solaris/freeware/ - 16. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-forever + 5. http://www.karlrunge.com/x11vnc/index.html#beta-test + 6. http://www.karlrunge.com/x11vnc/index.html#faq + 7. http://www.karlrunge.com/x11vnc/index.html#contact + 8. http://www.uk.research.att.com/vnc/ + 9. http://www.realvnc.com/ + 10. http://www.tightvnc.com/ + 11. http://www.karlrunge.com/x11vnc/index.html#downloading + 12. http://www.tightvnc.com/download.html + 13. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-auth + 14. http://www.karlrunge.com/x11vnc/index.html#faq-xperms + 15. http://www.karlrunge.com/x11vnc/index.html#faq-viewer-download + 16. http://www.sun.com/software/solaris/freeware/ 17. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-forever - 18. http://www.karlrunge.com/x11vnc/index.html#faq-service - 19. http://www.karlrunge.com/x11vnc/index.html#faq-passwd - 20. http://www.karlrunge.com/x11vnc/index.html#vnc_password_file - 21. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-connect - 22. http://www.karlrunge.com/x11vnc/index.html#faq-inetd - 23. http://www.karlrunge.com/x11vnc/index.html#tightvnc_via - 24. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-bg - 25. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-connect - 26. http://www.karlrunge.com/x11vnc/index.html#faq-inetd - 27. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-rfbauth - 28. http://www.karlrunge.com/x11vnc/index.html#faq-passwd - 29. http://www.karlrunge.com/x11vnc/index.html#faq-passwdfile - 30. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-passwdfile - 31. http://www.karlrunge.com/x11vnc/index.html#faq-allow-opt - 32. http://www.karlrunge.com/x11vnc/index.html#faq-tcp_wrappers - 33. http://sourceforge.net/projects/libvncserver/ - 34. http://sourceforge.net/project/showfiles.php?group_id=32584&package_id=119006&release_id=307884 - 35. http://sourceforge.net/project/shownotes.php?group_id=32584&release_id=307884 - 36. http://www.karlrunge.com/x11vnc/x11vnc.c - 37. http://www.karlrunge.com/x11vnc/tkx11vnc.h - 38. http://www.karlrunge.com/x11vnc/index.html#faq-binaries - 39. http://www.tightvnc.com/download.html - 40. http://www.realvnc.com/download-free.html - 41. http://sourceforge.net/projects/cotvnc/ - 42. http://www.karlrunge.com/x11vnc/rx11vnc - 43. http://www.karlrunge.com/x11vnc/rx11vnc.pl - 44. http://www.sunfreeware.com/ - 45. ftp://ftp.uu.net/graphics/jpeg/ - 46. http://www.gzip.org/zlib/ - 47. http://www.sunfreeware.com/ - 48. http://www.karlrunge.com/x11vnc/index.html#faq-solaris251build - 49. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-solid - 50. http://www.tightvnc.com/ - 51. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-rfbport - 52. http://www.karlrunge.com/x11vnc/x11vnc_opts.html - 53. http://www.karlrunge.com/x11vnc/index.html#faq-passwd - 54. http://www.karlrunge.com/x11vnc/recurse_x11vnc.jpg - 55. http://wwws.sun.com/sunray/index.html - 56. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-nap - 57. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-wait - 58. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-rfbport - 59. http://www.karlrunge.com/x11vnc/shm_clear - 60. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-cursor - 61. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-overlay - 62. mailto:xvml@karlrunge.com - 63. http://www.karlrunge.com/x11vnc/index.html#faq-thanks - 64. http://www.karlrunge.com/x11vnc/index.html#faq-xperms - 65. http://www.karlrunge.com/x11vnc/index.html#faq-build - 66. http://www.karlrunge.com/x11vnc/index.html#faq-missing-xtest - 67. http://www.karlrunge.com/x11vnc/index.html#faq-solaris251build - 68. http://www.karlrunge.com/x11vnc/index.html#faq-binaries - 69. http://www.karlrunge.com/x11vnc/index.html#faq-viewer-download - 70. http://www.karlrunge.com/x11vnc/index.html#faq-cmdline-opts - 71. http://www.karlrunge.com/x11vnc/index.html#faq-config-file - 72. http://www.karlrunge.com/x11vnc/index.html#faq-quiet-bg - 73. http://www.karlrunge.com/x11vnc/index.html#faq-sigpipe - 74. http://www.karlrunge.com/x11vnc/index.html#faq-build-customizations - 75. http://www.karlrunge.com/x11vnc/index.html#faq-win2vnc - 76. http://www.karlrunge.com/x11vnc/index.html#faq-win2vnc-8bpp - 77. http://www.karlrunge.com/x11vnc/index.html#faq-8bpp - 78. http://www.karlrunge.com/x11vnc/index.html#faq-overlays - 79. http://www.karlrunge.com/x11vnc/index.html#faq-windowid - 80. http://www.karlrunge.com/x11vnc/index.html#faq-transients-id - 81. http://www.karlrunge.com/x11vnc/index.html#faq-24bpp - 82. http://www.karlrunge.com/x11vnc/index.html#faq-noshm - 83. http://www.karlrunge.com/x11vnc/index.html#faq-xterminal-xauth - 84. http://www.karlrunge.com/x11vnc/index.html#faq-stop-bg - 85. http://www.karlrunge.com/x11vnc/index.html#faq-remote_control - 86. http://www.karlrunge.com/x11vnc/index.html#faq-passwd - 87. http://www.karlrunge.com/x11vnc/index.html#faq-passwdfile - 88. http://www.karlrunge.com/x11vnc/index.html#faq-input-opt - 89. http://www.karlrunge.com/x11vnc/index.html#faq-forever-shared - 90. http://www.karlrunge.com/x11vnc/index.html#faq-allow-opt - 91. http://www.karlrunge.com/x11vnc/index.html#faq-tcp_wrappers - 92. http://www.karlrunge.com/x11vnc/index.html#faq-listen-interface - 93. http://www.karlrunge.com/x11vnc/index.html#faq-listen-localhost - 94. http://www.karlrunge.com/x11vnc/index.html#faq-ssh-unix - 95. http://www.karlrunge.com/x11vnc/index.html#faq-ssh-putty - 96. http://www.karlrunge.com/x11vnc/index.html#faq-accept-opt - 97. http://www.karlrunge.com/x11vnc/index.html#faq-unix-passwords - 98. http://www.karlrunge.com/x11vnc/index.html#faq-users-opt - 99. http://www.karlrunge.com/x11vnc/index.html#faq-blockdpy - 100. http://www.karlrunge.com/x11vnc/index.html#faq-gone-lock - 101. http://www.karlrunge.com/x11vnc/index.html#faq-service - 102. http://www.karlrunge.com/x11vnc/index.html#faq-display-manager - 103. http://www.karlrunge.com/x11vnc/index.html#faq-inetd - 104. http://www.karlrunge.com/x11vnc/index.html#faq-java-http - 105. http://www.karlrunge.com/x11vnc/index.html#faq-reverse-connect - 106. http://www.karlrunge.com/x11vnc/index.html#faq-xvfb - 107. http://www.karlrunge.com/x11vnc/index.html#faq-headless - 108. http://www.karlrunge.com/x11vnc/index.html#faq-solshm - 109. http://www.karlrunge.com/x11vnc/index.html#faq-less-resource - 110. http://www.karlrunge.com/x11vnc/index.html#faq-more-resource - 111. http://www.karlrunge.com/x11vnc/index.html#faq-slow-link - 112. http://www.karlrunge.com/x11vnc/index.html#faq-pointer-mode - 113. http://www.karlrunge.com/x11vnc/index.html#faq-xdamage - 114. http://www.karlrunge.com/x11vnc/index.html#faq-cursor-shape - 115. http://www.karlrunge.com/x11vnc/index.html#faq-xfixes-alpha - 116. http://www.karlrunge.com/x11vnc/index.html#faq-xfixes-alpha-hacks - 117. http://www.karlrunge.com/x11vnc/index.html#faq-cursor-arrow - 118. http://www.karlrunge.com/x11vnc/index.html#faq-cursor-positions - 119. http://www.karlrunge.com/x11vnc/index.html#faq-buttonmap-opt - 120. http://www.karlrunge.com/x11vnc/index.html#faq-altgr - 121. http://www.karlrunge.com/x11vnc/index.html#faq-greaterless - 122. http://www.karlrunge.com/x11vnc/index.html#faq-xkbmodtweak - 123. http://www.karlrunge.com/x11vnc/index.html#faq-repeated-keys - 124. http://www.karlrunge.com/x11vnc/index.html#faq-repeated-keys-still - 125. http://www.karlrunge.com/x11vnc/index.html#faq-remap-opt - 126. http://www.karlrunge.com/x11vnc/index.html#faq-sun-alt-meta - 127. http://www.karlrunge.com/x11vnc/index.html#faq-remap-button-click - 128. http://www.karlrunge.com/x11vnc/index.html#faq-scrollbars - 129. http://www.karlrunge.com/x11vnc/index.html#faq-scaling - 130. http://www.karlrunge.com/x11vnc/index.html#faq-xinerama - 131. http://www.karlrunge.com/x11vnc/index.html#faq-multi-screen - 132. http://www.karlrunge.com/x11vnc/index.html#faq-clip-screen - 133. http://www.karlrunge.com/x11vnc/index.html#faq-xrandr - 134. http://www.karlrunge.com/x11vnc/index.html#faq-black-screen - 135. http://www.karlrunge.com/x11vnc/index.html#faq-linuxvc - 136. http://www.karlrunge.com/x11vnc/index.html#faq-vmware - 137. http://www.karlrunge.com/x11vnc/index.html#faq-rawfb - 138. http://www.karlrunge.com/x11vnc/index.html#faq-hidden-taskbars - 139. http://www.karlrunge.com/x11vnc/index.html#faq-clipboard - 140. http://www.karlrunge.com/x11vnc/index.html#faq-beeps - 141. http://www.karlrunge.com/x11vnc/index.html#faq-thanks - 142. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-display - 143. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-auth - 144. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-users - 145. http://www.karlrunge.com/x11vnc/index.html#solarisbuilding - 146. http://www.karlrunge.com/x11vnc/x11vnc_sunos4.html - 147. http://www.karlrunge.com/x11vnc/index.html#building - 148. http://www.karlrunge.com/x11vnc/index.html#faq-build - 149. http://packages.debian.org/x11vnc - 150. http://www.linuxpackages.net/search_view.php?by=name&name=x11vnc - 151. http://dag.wieers.com/packages/x11vnc/ - 152. http://www.sunfreeware.com/ - 153. http://www.bell-labs.com/project/wwexptools/packages.html - 154. http://www.karlrunge.com/x11vnc/index.html#solarisbuilding - 155. http://www.karlrunge.com/x11vnc/bins - 156. http://www.tightvnc.com/download.html - 157. http://www.realvnc.com/download-free.html - 158. http://sourceforge.net/projects/cotvnc/ - 159. http://www.karlrunge.com/x11vnc/x11vnc_opts.html - 160. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-gui - 161. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-q - 162. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-bg - 163. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-o - 164. http://www.karlrunge.com/x11vnc/x11vnc.c - 165. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-sigpipe - 166. http://www.karlrunge.com/x11vnc/index.html#solarisbuilding - 167. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-nofb - 168. http://fredrik.hubbe.net/x2vnc.html - 169. http://www.hubbe.net/~hubbe/win2vnc.html - 170. http://www.deboer.gmxhome.de/ - 171. http://sourceforge.net/projects/win2vnc/ - 172. http://fredrik.hubbe.net/x2vnc.html - 173. http://freshmeat.net/projects/x2x/ - 174. http://ftp.digital.com/pub/Digital/SRC/x2x/ - 175. http://zapek.com/software/zvnc/ - 176. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-visual - 177. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-flashcmap - 178. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-notruecolor - 179. http://www.karlrunge.com/x11vnc/index.html#faq-8bpp - 180. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-overlay - 181. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-overlay - 182. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-id - 183. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-overlay - 184. http://www.karlrunge.com/x11vnc/index.html#faq-overlays - 185. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-id - 186. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-sid - 187. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-display - 188. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-noshm - 189. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-flipbyteorder - 190. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-auth - 191. http://www.karlrunge.com/x11vnc/index.html#xauth_pain - 192. http://www.karlrunge.com/x11vnc/index.html#faq-noshm - 193. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-remote - 194. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-query - 195. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-forever - 196. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-bg - 197. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-clear_mods - 198. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-clear_keys + 18. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-forever + 19. http://www.karlrunge.com/x11vnc/index.html#faq-service + 20. http://www.karlrunge.com/x11vnc/index.html#faq-passwd + 21. http://www.karlrunge.com/x11vnc/index.html#vnc_password_file + 22. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-connect + 23. http://www.karlrunge.com/x11vnc/index.html#faq-inetd + 24. http://www.karlrunge.com/x11vnc/index.html#tightvnc_via + 25. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-bg + 26. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-connect + 27. http://www.karlrunge.com/x11vnc/index.html#faq-inetd + 28. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-rfbauth + 29. http://www.karlrunge.com/x11vnc/index.html#faq-passwd + 30. http://www.karlrunge.com/x11vnc/index.html#faq-passwdfile + 31. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-passwdfile + 32. http://www.karlrunge.com/x11vnc/index.html#faq-allow-opt + 33. http://www.karlrunge.com/x11vnc/index.html#faq-tcp_wrappers + 34. http://sourceforge.net/projects/libvncserver/ + 35. http://sourceforge.net/project/showfiles.php?group_id=32584&package_id=119006&release_id=307884 + 36. http://sourceforge.net/project/shownotes.php?group_id=32584&release_id=307884 + 37. http://www.karlrunge.com/x11vnc/x11vnc.c + 38. http://www.karlrunge.com/x11vnc/tkx11vnc.h + 39. http://www.karlrunge.com/x11vnc/index.html#faq-binaries + 40. http://www.tightvnc.com/download.html + 41. http://www.realvnc.com/download-free.html + 42. http://sourceforge.net/projects/cotvnc/ + 43. http://www.karlrunge.com/x11vnc/rx11vnc + 44. http://www.karlrunge.com/x11vnc/rx11vnc.pl + 45. http://www.sunfreeware.com/ + 46. ftp://ftp.uu.net/graphics/jpeg/ + 47. http://www.gzip.org/zlib/ + 48. http://www.sunfreeware.com/ + 49. http://www.karlrunge.com/x11vnc/index.html#faq-solaris251build + 50. http://www.karlrunge.com/x11vnc/x11vnc-0.7.2.tar.gz + 51. http://www.karlrunge.com/x11vnc/index.html#contact + 52. http://www.karlrunge.com/x11vnc/next-rel.html + 53. http://www.karlrunge.com/x11vnc/index.html#faq-xdamage + 54. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-solid + 55. http://www.tightvnc.com/ + 56. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-rfbport + 57. http://www.karlrunge.com/x11vnc/x11vnc_opts.html + 58. http://www.karlrunge.com/x11vnc/index.html#faq-passwd + 59. http://www.karlrunge.com/x11vnc/recurse_x11vnc.jpg + 60. http://wwws.sun.com/sunray/index.html + 61. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-nap + 62. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-wait + 63. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-rfbport + 64. http://www.karlrunge.com/x11vnc/shm_clear + 65. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-cursor + 66. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-overlay + 67. mailto:xvml@karlrunge.com + 68. http://www.karlrunge.com/x11vnc/index.html#faq-thanks + 69. http://www.karlrunge.com/x11vnc/index.html#faq-xperms + 70. http://www.karlrunge.com/x11vnc/index.html#faq-build + 71. http://www.karlrunge.com/x11vnc/index.html#faq-missing-xtest + 72. http://www.karlrunge.com/x11vnc/index.html#faq-solaris251build + 73. http://www.karlrunge.com/x11vnc/index.html#faq-binaries + 74. http://www.karlrunge.com/x11vnc/index.html#faq-viewer-download + 75. http://www.karlrunge.com/x11vnc/index.html#faq-cmdline-opts + 76. http://www.karlrunge.com/x11vnc/index.html#faq-config-file + 77. http://www.karlrunge.com/x11vnc/index.html#faq-quiet-bg + 78. http://www.karlrunge.com/x11vnc/index.html#faq-sigpipe + 79. http://www.karlrunge.com/x11vnc/index.html#faq-build-customizations + 80. http://www.karlrunge.com/x11vnc/index.html#faq-win2vnc + 81. http://www.karlrunge.com/x11vnc/index.html#faq-win2vnc-8bpp + 82. http://www.karlrunge.com/x11vnc/index.html#faq-8bpp + 83. http://www.karlrunge.com/x11vnc/index.html#faq-overlays + 84. http://www.karlrunge.com/x11vnc/index.html#faq-windowid + 85. http://www.karlrunge.com/x11vnc/index.html#faq-transients-id + 86. http://www.karlrunge.com/x11vnc/index.html#faq-24bpp + 87. http://www.karlrunge.com/x11vnc/index.html#faq-noshm + 88. http://www.karlrunge.com/x11vnc/index.html#faq-xterminal-xauth + 89. http://www.karlrunge.com/x11vnc/index.html#faq-stop-bg + 90. http://www.karlrunge.com/x11vnc/index.html#faq-remote_control + 91. http://www.karlrunge.com/x11vnc/index.html#faq-passwd + 92. http://www.karlrunge.com/x11vnc/index.html#faq-passwdfile + 93. http://www.karlrunge.com/x11vnc/index.html#faq-input-opt + 94. http://www.karlrunge.com/x11vnc/index.html#faq-forever-shared + 95. http://www.karlrunge.com/x11vnc/index.html#faq-allow-opt + 96. http://www.karlrunge.com/x11vnc/index.html#faq-tcp_wrappers + 97. http://www.karlrunge.com/x11vnc/index.html#faq-listen-interface + 98. http://www.karlrunge.com/x11vnc/index.html#faq-listen-localhost + 99. http://www.karlrunge.com/x11vnc/index.html#faq-ssh-unix + 100. http://www.karlrunge.com/x11vnc/index.html#faq-ssh-putty + 101. http://www.karlrunge.com/x11vnc/index.html#faq-accept-opt + 102. http://www.karlrunge.com/x11vnc/index.html#faq-unix-passwords + 103. http://www.karlrunge.com/x11vnc/index.html#faq-users-opt + 104. http://www.karlrunge.com/x11vnc/index.html#faq-blockdpy + 105. http://www.karlrunge.com/x11vnc/index.html#faq-gone-lock + 106. http://www.karlrunge.com/x11vnc/index.html#faq-service + 107. http://www.karlrunge.com/x11vnc/index.html#faq-display-manager + 108. http://www.karlrunge.com/x11vnc/index.html#faq-inetd + 109. http://www.karlrunge.com/x11vnc/index.html#faq-java-http + 110. http://www.karlrunge.com/x11vnc/index.html#faq-reverse-connect + 111. http://www.karlrunge.com/x11vnc/index.html#faq-xvfb + 112. http://www.karlrunge.com/x11vnc/index.html#faq-headless + 113. http://www.karlrunge.com/x11vnc/index.html#faq-solshm + 114. http://www.karlrunge.com/x11vnc/index.html#faq-less-resource + 115. http://www.karlrunge.com/x11vnc/index.html#faq-more-resource + 116. http://www.karlrunge.com/x11vnc/index.html#faq-slow-link + 117. http://www.karlrunge.com/x11vnc/index.html#faq-pointer-mode + 118. http://www.karlrunge.com/x11vnc/index.html#faq-wireframe + 119. http://www.karlrunge.com/x11vnc/index.html#faq-xdamage + 120. http://www.karlrunge.com/x11vnc/index.html#faq-cursor-shape + 121. http://www.karlrunge.com/x11vnc/index.html#faq-xfixes-alpha + 122. http://www.karlrunge.com/x11vnc/index.html#faq-xfixes-alpha-hacks + 123. http://www.karlrunge.com/x11vnc/index.html#faq-cursor-arrow + 124. http://www.karlrunge.com/x11vnc/index.html#faq-cursor-positions + 125. http://www.karlrunge.com/x11vnc/index.html#faq-buttonmap-opt + 126. http://www.karlrunge.com/x11vnc/index.html#faq-altgr + 127. http://www.karlrunge.com/x11vnc/index.html#faq-greaterless + 128. http://www.karlrunge.com/x11vnc/index.html#faq-xkbmodtweak + 129. http://www.karlrunge.com/x11vnc/index.html#faq-repeated-keys + 130. http://www.karlrunge.com/x11vnc/index.html#faq-repeated-keys-still + 131. http://www.karlrunge.com/x11vnc/index.html#faq-remap-opt + 132. http://www.karlrunge.com/x11vnc/index.html#faq-sun-alt-meta + 133. http://www.karlrunge.com/x11vnc/index.html#faq-remap-button-click + 134. http://www.karlrunge.com/x11vnc/index.html#faq-scrollbars + 135. http://www.karlrunge.com/x11vnc/index.html#faq-scaling + 136. http://www.karlrunge.com/x11vnc/index.html#faq-xinerama + 137. http://www.karlrunge.com/x11vnc/index.html#faq-multi-screen + 138. http://www.karlrunge.com/x11vnc/index.html#faq-clip-screen + 139. http://www.karlrunge.com/x11vnc/index.html#faq-xrandr + 140. http://www.karlrunge.com/x11vnc/index.html#faq-black-screen + 141. http://www.karlrunge.com/x11vnc/index.html#faq-linuxvc + 142. http://www.karlrunge.com/x11vnc/index.html#faq-vmware + 143. http://www.karlrunge.com/x11vnc/index.html#faq-rawfb + 144. http://www.karlrunge.com/x11vnc/index.html#faq-hidden-taskbars + 145. http://www.karlrunge.com/x11vnc/index.html#faq-clipboard + 146. http://www.karlrunge.com/x11vnc/index.html#faq-beeps + 147. http://www.karlrunge.com/x11vnc/index.html#faq-thanks + 148. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-display + 149. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-auth + 150. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-users + 151. http://www.karlrunge.com/x11vnc/index.html#solarisbuilding + 152. http://www.karlrunge.com/x11vnc/x11vnc_sunos4.html + 153. http://www.karlrunge.com/x11vnc/index.html#building + 154. http://www.karlrunge.com/x11vnc/index.html#faq-build + 155. http://packages.debian.org/x11vnc + 156. http://www.linuxpackages.net/search_view.php?by=name&name=x11vnc + 157. http://dag.wieers.com/packages/x11vnc/ + 158. http://www.sunfreeware.com/ + 159. http://www.bell-labs.com/project/wwexptools/packages.html + 160. http://www.karlrunge.com/x11vnc/index.html#solarisbuilding + 161. http://www.karlrunge.com/x11vnc/bins + 162. http://www.tightvnc.com/download.html + 163. http://www.realvnc.com/download-free.html + 164. http://sourceforge.net/projects/cotvnc/ + 165. http://www.karlrunge.com/x11vnc/x11vnc_opts.html + 166. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-gui + 167. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-q + 168. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-bg + 169. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-o + 170. http://www.karlrunge.com/x11vnc/x11vnc.c + 171. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-sigpipe + 172. http://www.karlrunge.com/x11vnc/index.html#solarisbuilding + 173. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-nofb + 174. http://fredrik.hubbe.net/x2vnc.html + 175. http://www.hubbe.net/~hubbe/win2vnc.html + 176. http://www.deboer.gmxhome.de/ + 177. http://sourceforge.net/projects/win2vnc/ + 178. http://fredrik.hubbe.net/x2vnc.html + 179. http://freshmeat.net/projects/x2x/ + 180. http://ftp.digital.com/pub/Digital/SRC/x2x/ + 181. http://zapek.com/software/zvnc/ + 182. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-visual + 183. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-flashcmap + 184. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-notruecolor + 185. http://www.karlrunge.com/x11vnc/index.html#faq-8bpp + 186. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-overlay + 187. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-overlay + 188. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-id + 189. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-overlay + 190. http://www.karlrunge.com/x11vnc/index.html#faq-overlays + 191. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-id + 192. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-sid + 193. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-display + 194. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-noshm + 195. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-flipbyteorder + 196. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-auth + 197. http://www.karlrunge.com/x11vnc/index.html#xauth_pain + 198. http://www.karlrunge.com/x11vnc/index.html#faq-noshm 199. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-remote 200. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-query - 201. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-gui - 202. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-storepasswd - 203. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-rfbauth - 204. http://www.karlrunge.com/x11vnc/index.html#faq-passwdfile - 205. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-viewpasswd - 206. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-passwd - 207. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-passwdfile - 208. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-rfbauth - 209. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-input - 210. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-forever - 211. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-shared - 212. http://www.karlrunge.com/x11vnc/index.html#tunnelling - 213. http://www.karlrunge.com/x11vnc/index.html#faq-passwd - 214. http://www.karlrunge.com/x11vnc/index.html#faq-passwdfile - 215. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-allow - 216. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-localhost - 217. http://www.karlrunge.com/x11vnc/index.html#faq-tcp_wrappers - 218. http://www.karlrunge.com/x11vnc/index.html#faq-inetd - 219. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-listen - 220. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-allow - 221. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-localhost - 222. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-allow - 223. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-localhost - 224. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-listen - 225. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-allow - 226. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-localhost - 227. http://www.karlrunge.com/x11vnc/index.html#tunnelling - 228. http://www.karlrunge.com/x11vnc/index.html#tunnelling + 201. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-forever + 202. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-bg + 203. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-clear_mods + 204. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-clear_keys + 205. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-remote + 206. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-query + 207. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-gui + 208. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-storepasswd + 209. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-rfbauth + 210. http://www.karlrunge.com/x11vnc/index.html#faq-passwdfile + 211. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-viewpasswd + 212. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-passwd + 213. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-passwdfile + 214. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-rfbauth + 215. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-input + 216. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-forever + 217. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-shared + 218. http://www.karlrunge.com/x11vnc/index.html#tunnelling + 219. http://www.karlrunge.com/x11vnc/index.html#faq-passwd + 220. http://www.karlrunge.com/x11vnc/index.html#faq-passwdfile + 221. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-allow + 222. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-localhost + 223. http://www.karlrunge.com/x11vnc/index.html#faq-tcp_wrappers + 224. http://www.karlrunge.com/x11vnc/index.html#faq-inetd + 225. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-listen + 226. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-allow + 227. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-localhost + 228. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-allow 229. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-localhost - 230. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-rfbauth - 231. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-passwdfile - 232. http://www.karlrunge.com/x11vnc/index.html#tunnelling - 233. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-connect - 234. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-accept - 235. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-viewonly - 236. ftp://ftp.x.org/ - 237. http://www.karlrunge.com/x11vnc/dtVncPopup - 238. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-gone - 239. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-localhost - 240. http://www.karlrunge.com/x11vnc/index.html#tunnelling - 241. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-accept - 242. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-users - 243. http://www.karlrunge.com/x11vnc/blockdpy.c - 244. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-accept - 245. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-gone - 246. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-gone - 247. http://www.karlrunge.com/x11vnc/index.html#display-manager-continuously - 248. http://www.karlrunge.com/x11vnc/index.html#faq-inetd - 249. http://www.karlrunge.com/x11vnc/index.html#x11vnc_loop - 250. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-auth - 251. http://www.karlrunge.com/x11vnc/index.html#dtlogin_solaris - 252. http://www.jirka.org/gdm-documentation/x241.html - 253. http://www.karlrunge.com/x11vnc/x11vnc_loop - 254. http://www.karlrunge.com/x11vnc/index.html#faq-xterminal-xauth - 255. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-inetd - 256. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-q - 257. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-auth - 258. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-httpdir - 259. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-connect - 260. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-vncconnect - 261. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-add_keysyms - 262. http://www.karlrunge.com/x11vnc/index.html#display-manager-continuously - 263. http://www.karlrunge.com/x11vnc/shm_clear - 264. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-onetile - 265. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-noshm - 266. http://www.karlrunge.com/x11vnc/index.html#faq-noshm - 267. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-nap - 268. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-wait - 269. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-onetile - 270. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-fs - 271. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-threads - 272. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-defer - 273. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-id - 274. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-solid - 275. http://www.tightvnc.com/ - 276. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-nodragging - 277. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-progressive - 278. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-fs - 279. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-wait - 280. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-defer - 281. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-id - 282. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-nosel - 283. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-nocursor - 284. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-nocursorpos - 285. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-pointer_mode - 286. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-nodragging - 287. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-pointer_mode - 288. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-threads - 289. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-xd_area - 290. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-xd_mem - 291. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-noxdamage - 292. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-cursor - 293. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-cursor - 294. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-overlay - 295. http://www.karlrunge.com/x11vnc/index.html#the-overlay-mode - 296. http://www.karlrunge.com/x11vnc/index.html#solaris10-build - 297. http://www.karlrunge.com/x11vnc/index.html#faq-xfixes-alpha-hacks - 298. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-alphacut - 299. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-alphafrac - 300. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-alpharemove - 301. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-nocursorshape - 302. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-noalphablend - 303. http://www.tightvnc.com/ - 304. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-nocursor - 305. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-cursorpos - 306. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-nocursorpos - 307. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-nocursorshape - 308. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-buttonmap - 309. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-debug_pointer - 310. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-buttonmap - 311. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-modtweak - 312. http://www.karlrunge.com/x11vnc/index.html#faq-greaterless - 313. http://www.karlrunge.com/x11vnc/index.html#faq-xkbmodtweak - 314. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-debug_keyboard - 315. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-modtweak - 316. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-remap - 317. http://www.karlrunge.com/x11vnc/index.html#faq-xkbmodtweak - 318. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-debug_keyboard - 319. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-modtweak - 320. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-xkb - 321. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-skip_keycodes - 322. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-remap - 323. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-add_keysyms - 324. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-remap - 325. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-add_keysyms - 326. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-norepeat - 327. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-norepeat - 328. http://www.karlrunge.com/x11vnc/index.html#faq-display-manager - 329. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-remap - 330. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-remap - 331. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-remap - 332. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-remap - 333. http://www.karlrunge.com/x11vnc/index.html#faq-scaling - 334. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-scale - 335. http://www.cus.cam.ac.uk/~ssb22/source/vnc-magnification.html - 336. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-rfbport - 337. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-scale_cursor - 338. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-blackout - 339. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-xinerama - 340. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-xwarppointer - 341. http://www.karlrunge.com/x11vnc/index.html#faq-solshm - 342. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-onetile - 343. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-noshm - 344. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-clip - 345. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-id - 346. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-id - 347. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-xrandr - 348. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-padgeom - 349. http://www.karlrunge.com/x11vnc/index.html#faq-linuxvc - 350. http://www.karlrunge.com/x11vnc/index.html#faq-rawfb - 351. http://www.karlrunge.com/x11vnc/index.html#faq-linuxvc - 352. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-id - 353. http://www.karlrunge.com/x11vnc/index.html#faq-xvfb - 354. http://www.karlrunge.com/x11vnc/index.html#faq-linuxvc - 355. http://www.karlrunge.com/x11vnc/index.html#faq-vmware - 356. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-nosel - 357. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-noprimary - 358. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-nobell - 359. mailto:xvml@karlrunge.com + 230. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-listen + 231. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-allow + 232. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-localhost + 233. http://www.karlrunge.com/x11vnc/index.html#tunnelling + 234. http://www.karlrunge.com/x11vnc/index.html#tunnelling + 235. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-localhost + 236. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-rfbauth + 237. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-passwdfile + 238. http://www.karlrunge.com/x11vnc/index.html#tunnelling + 239. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-connect + 240. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-accept + 241. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-viewonly + 242. ftp://ftp.x.org/ + 243. http://www.karlrunge.com/x11vnc/dtVncPopup + 244. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-gone + 245. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-localhost + 246. http://www.karlrunge.com/x11vnc/index.html#tunnelling + 247. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-accept + 248. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-users + 249. http://www.karlrunge.com/x11vnc/blockdpy.c + 250. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-accept + 251. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-gone + 252. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-gone + 253. http://www.karlrunge.com/x11vnc/index.html#display-manager-continuously + 254. http://www.karlrunge.com/x11vnc/index.html#faq-inetd + 255. http://www.karlrunge.com/x11vnc/index.html#x11vnc_loop + 256. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-auth + 257. http://www.karlrunge.com/x11vnc/index.html#dtlogin_solaris + 258. http://www.jirka.org/gdm-documentation/x241.html + 259. http://www.karlrunge.com/x11vnc/x11vnc_loop + 260. http://www.karlrunge.com/x11vnc/index.html#faq-xterminal-xauth + 261. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-inetd + 262. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-q + 263. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-auth + 264. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-httpdir + 265. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-connect + 266. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-vncconnect + 267. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-add_keysyms + 268. http://www.karlrunge.com/x11vnc/index.html#display-manager-continuously + 269. http://www.karlrunge.com/x11vnc/shm_clear + 270. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-onetile + 271. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-noshm + 272. http://www.karlrunge.com/x11vnc/index.html#faq-noshm + 273. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-nap + 274. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-wait + 275. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-onetile + 276. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-fs + 277. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-threads + 278. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-defer + 279. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-id + 280. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-solid + 281. http://www.tightvnc.com/ + 282. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-nodragging + 283. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-progressive + 284. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-fs + 285. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-wait + 286. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-defer + 287. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-id + 288. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-nosel + 289. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-nocursor + 290. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-nocursorpos + 291. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-pointer_mode + 292. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-pointer_mode + 293. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-nodragging + 294. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-pointer_mode + 295. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-threads + 296. http://www.karlrunge.com/x11vnc/index.html#faq-wireframe + 297. http://www.karlrunge.com/x11vnc/index.html#faq-pointer-mode + 298. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-wireframe + 299. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-wireframe + 300. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-wireframe + 301. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-xd_area + 302. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-xd_mem + 303. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-noxdamage + 304. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-cursor + 305. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-cursor + 306. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-overlay + 307. http://www.karlrunge.com/x11vnc/index.html#the-overlay-mode + 308. http://www.karlrunge.com/x11vnc/index.html#solaris10-build + 309. http://www.karlrunge.com/x11vnc/index.html#faq-xfixes-alpha-hacks + 310. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-alphacut + 311. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-alphafrac + 312. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-alpharemove + 313. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-nocursorshape + 314. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-noalphablend + 315. http://www.tightvnc.com/ + 316. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-nocursor + 317. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-cursorpos + 318. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-nocursorpos + 319. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-nocursorshape + 320. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-buttonmap + 321. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-debug_pointer + 322. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-buttonmap + 323. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-modtweak + 324. http://www.karlrunge.com/x11vnc/index.html#faq-greaterless + 325. http://www.karlrunge.com/x11vnc/index.html#faq-xkbmodtweak + 326. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-debug_keyboard + 327. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-modtweak + 328. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-remap + 329. http://www.karlrunge.com/x11vnc/index.html#faq-xkbmodtweak + 330. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-debug_keyboard + 331. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-modtweak + 332. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-xkb + 333. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-skip_keycodes + 334. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-remap + 335. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-add_keysyms + 336. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-remap + 337. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-add_keysyms + 338. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-norepeat + 339. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-norepeat + 340. http://www.karlrunge.com/x11vnc/index.html#faq-display-manager + 341. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-remap + 342. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-remap + 343. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-remap + 344. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-remap + 345. http://www.karlrunge.com/x11vnc/index.html#faq-scaling + 346. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-scale + 347. http://www.cus.cam.ac.uk/~ssb22/source/vnc-magnification.html + 348. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-rfbport + 349. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-scale_cursor + 350. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-blackout + 351. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-xinerama + 352. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-xwarppointer + 353. http://www.karlrunge.com/x11vnc/index.html#faq-solshm + 354. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-onetile + 355. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-noshm + 356. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-clip + 357. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-id + 358. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-id + 359. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-xrandr + 360. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-padgeom + 361. http://www.karlrunge.com/x11vnc/index.html#faq-linuxvc + 362. http://www.karlrunge.com/x11vnc/index.html#faq-rawfb + 363. http://www.karlrunge.com/x11vnc/index.html#faq-linuxvc + 364. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-id + 365. http://www.karlrunge.com/x11vnc/index.html#faq-xvfb + 366. http://www.karlrunge.com/x11vnc/index.html#faq-linuxvc + 367. http://www.karlrunge.com/x11vnc/index.html#faq-vmware + 368. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-nosel + 369. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-noprimary + 370. http://www.karlrunge.com/x11vnc/x11vnc_opts.html#opt-nobell + 371. mailto:xvml@karlrunge.com ======================================================================= @@ -4085,7 +4222,7 @@ x11vnc: a VNC server for real X displays Here are all of x11vnc command line options: % x11vnc -opts (see below for -help long descriptions) -x11vnc: allow VNC connections to real X11 displays. 0.7.2 lastmod: 2005-04-11 +x11vnc: allow VNC connections to real X11 displays. 0.7.2 lastmod: 2005-04-19 x11vnc options: -display disp -auth file @@ -4127,7 +4264,9 @@ x11vnc options: -noalphablend -nocursorshape -cursorpos -nocursorpos -xwarppointer -buttonmap string - -nodragging -pointer_mode n + -nodragging -wireframe [str] + -nowireframe -wirecopyrect mode + -nowirecopyrect -pointer_mode n -input_skip n -speeds rd,bw,lat -debug_pointer -debug_keyboard -defer time -wait time @@ -4142,7 +4281,8 @@ x11vnc options: -gui [gui-opts] -remote command -query variable -sync -noremote -unsafe - -safer -deny_all + -safer -privremote + -nocmds -deny_all libvncserver options: @@ -4169,7 +4309,7 @@ libvncserver options: % x11vnc -help -x11vnc: allow VNC connections to real X11 displays. 0.7.2 lastmod: 2005-04-11 +x11vnc: allow VNC connections to real X11 displays. 0.7.2 lastmod: 2005-04-19 Typical usage is: @@ -4862,6 +5002,62 @@ Options: slow setups, but you lose all visual feedback for drags, text selection, and some menu traversals. It overrides any -pointer_mode setting + +-wireframe [str] Try to detect window moves or resizes when a mouse +-nowireframe button is held down and show a wireframe instead of + the full opaque window. This is based completely on + heuristics and may not always work: it depends on your + window manager and even how you move things around. + See -pointer_mode below for discussion of the "bogging + down" problem this tries to avoid. Default: -wireframe + + The value "str" is optional and, of course, is + packed with many tunable parameters for this scheme: + + Format: shade,linewidth,percent,T+B+L+R,t1+t2+t3+t4 + Default: 0xff,3,0,32+8+8+8,0.15+0.35+4.0+0.1 + + If you leave nothing between commas: ",," the default + value is used. If you don't specify enough commas, + the trailing parameters are set to their defaults. + + "shade" indicate the "color" for the wireframe, + usually a greyscale: 0-255, however for 16 and 32bpp you + can specify an rgb.txt X color (e.g. "dodgerblue") or + a value > 255 is treated as RGB (e.g. red is 0xff0000). + "linewidth" sets the width of the wireframe in pixels. + "percent" indicates to not apply the wireframe scheme + to windows with area less than this percent of the + full screen. + + "T+B+L+R" indicates four integers for how close in + pixels the pointer has to be from the Top, Bottom, Left, + or Right edges of the window to consider wireframing. + This is a speedup to quickly exclude a window from being + wireframed: set them all to zero to not try the speedup + (scrolling and selecting text will likely be slower). + + "t1+t2+t3+t4" specify four floating point times in + seconds: t1 is how long to wait for the pointer to move, + t2 is how long to wait for the window to start moving + or being resized (for some window managers this can be + rather long), t3 is how long to keep a wireframe moving + before repainting the window. t4 is the minimum time + between sending wireframe "animations". For a slow + link this might be a better choice: 0.25+0.6+6.0+0.15 + +-wirecopyrect mode Since the -wireframe mechanism evidently tracks moving +-nowirecopyrect windows, a speedup can be obtained by telling the VNC + viewers to locally copy the translated window region. + This is the VNC CopyRect encoding: the framebuffer + update doesn't need to send the actual new image data. + "mode" can be "never" (same as -nowirecopyrect) + to never try the copyrect, "top" means only do it if + the window was not covered by any other windows, and + "always" means to translate the orginally unobscured + region (this may look odd as the remaining pieces come + in, but helps on a slow link) Default: always + -pointer_mode n Various pointer motion update schemes. "-pm" is an alias. The problem is pointer motion can cause rapid changes on the screen: consider the rapid changes @@ -4885,7 +5081,6 @@ Options: n=2 is an improved scheme: by watching the current rate of input events it tries to detect if it should try to "eat" additional pointer events before continuing. - This mode was the default until Apr 2005. n=3 is basically the same as n=2 except with slightly tweaked parameters. We made this a new one so one @@ -5027,8 +5222,9 @@ Options: which specifies a shmid N and framebuffer Width, Height, and Bits per pixel. To memory map mmap(2) a file use: "map:/path/to/a/file@WxHxB". If there is trouble - with mmap, use "file:/..." for slower lseek(2) based - reading. + with mmap, use "file:/..." for slower lseek(2) + based reading. If you do not supply a type "map" + is assumed if the file exists. If string is "setup:cmd", then the command "cmd" is run and the first line from it is read and used @@ -5052,10 +5248,16 @@ Options: All user input is discarded. Most of the X11 (screen, keyboard, mouse) options do not make sense and many will cause this mode to crash, so please think twice - before setting/changing them. If you don't want x11vnc - to close the DISPLAY in rawfb mode, then capitalize - the prefix, SHM:, MAP: etc. Keeping the display open - enables default remote-control channel. + before setting/changing them. + + If you don't want x11vnc to close the X DISPLAY in + rawfb mode, then capitalize the prefix, SHM:, MAP:, + FILE: Keeping the display open enables the default + remote-control channel, which could be useful. Also, + if you also specify -noviewonly, then the mouse and + keyboard input are still sent to the X display, this + usage should be very rare, i.e. doing something strange + with /dev/fb0. -pipeinput cmd Another experimental option: it lets you supply an extern command in "cmd" that x11vnc will pipe @@ -5301,6 +5503,11 @@ Options: buttonmap:str set -buttonmap "str", empty to disable dragging disable -nodragging mode. nodragging enable -nodragging mode. + wireframe enable -wireframe mode. + nowireframe disable -wireframe mode. + wireframe:str enable -wireframe mode string. + wireframe_mode:str enable -wireframe mode string. + wirecopyrect:str set -wirecopyrect string. pointer_mode:n set -pointer_mode to n. same as "pm" input_skip:n set -input_skip to n. speeds:str set -speeds to str. @@ -5397,31 +5604,33 @@ Options: noxtrap xrandr noxrandr xrandr_mode padgeom quiet q noquiet modtweak nomodtweak xkb noxkb skip_keycodes add_keysyms noadd_keysyms clear_mods noclear_mods - clear_keys noclear_keys remap repeat norepeat fb nofb - bell nobell sel nosel primary noprimary cursorshape - nocursorshape cursorpos nocursorpos cursor show_cursor - noshow_cursor nocursor arrow xfixes noxfixes xdamage - noxdamage xd_area xd_mem alphacut alphafrac alpharemove - noalpharemove alphablend noalphablend xwarp xwarppointer - noxwarp noxwarppointer buttonmap dragging nodragging + clear_keys noclear_keys remap repeat norepeat + fb nofb bell nobell sel nosel primary noprimary + cursorshape nocursorshape cursorpos nocursorpos + cursor show_cursor noshow_cursor nocursor arrow + xfixes noxfixes xdamage noxdamage xd_area xd_mem + alphacut alphafrac alpharemove noalpharemove alphablend + noalphablend xwarp xwarppointer noxwarp noxwarppointer + buttonmap dragging nodragging wireframe_mode + wireframe nowireframe wirecopyrect nowirecopyrect pointer_mode pm input_skip input client_input speeds debug_pointer dp nodebug_pointer nodp debug_keyboard dk - nodebug_keyboard nodk deferupdate defer wait rfbwait nap - nonap sb screen_blank fs gaps grow fuzz snapfb nosnapfb - rawfb setup: progressive rfbport http nohttp httpport + nodebug_keyboard nodk deferupdate defer wait rfbwait + nap nonap sb screen_blank fs gaps grow fuzz snapfb + nosnapfb rawfb progressive rfbport http nohttp httpport httpdir enablehttpproxy noenablehttpproxy alwaysshared noalwaysshared nevershared noalwaysshared dontdisconnect nodontdisconnect desktop noremote - aro= debug_xevents: display vncdisplay desktopname - http_url auth users rootshift clipshift scale_str - scaled_x scaled_y scale_numer scale_denom + aro= debug_xevents debug_xdamage display vncdisplay + desktopname http_url auth users rootshift clipshift + scale_str scaled_x scaled_y scale_numer scale_denom scale_fac scaling_blend scaling_nomult4 scaling_pad - scaling_interpolate inetd safer unsafe passwdfile - using_shm logfile o flag rc norc h help V version - lastmod bg sigpipe threads pipeinput clients - client_count pid ext_xtest ext_xtrap ext_xkb ext_xshm - ext_xinerama ext_overlay ext_xfixes ext_xdamage + scaling_interpolate inetd privremote unsafe safer + nocmds passwdfile using_shm logfile o flag rc norc h + help V version lastmod bg sigpipe threads pipeinput + clients client_count pid ext_xtest ext_xtrap ext_xkb + ext_xshm ext_xinerama ext_overlay ext_xfixes ext_xdamage ext_xrandr rootwin num_buttons button_mask mouse_x mouse_y bpp depth indexed_color dpy_x dpy_y wdpy_x wdpy_y off_x off_y cdpy_x cdpy_y coff_x coff_y rfbauth @@ -5459,22 +5668,29 @@ Options: channel is being used, obviously anyone who can write to /path/to/file can remotely control x11vnc. So be sure to protect the X display and that file's write - permissions. + permissions. See -privremote below. If you are paranoid and do not think -noremote is enough, to disable the VNC_CONNECT property channel - completely use -novncconnect. - --unsafe If x11vnc is running as root (e.g. inetd or Xsetup for - a display manager) a few remote commands are disabled - (currently: id:pick, accept:<cmd>, and gone:<cmd>) - because they are associated with running external - programs. If you specify -unsafe, then these remote - control commands are allowed when running as root. - When running as non-root all commands are allowed. - See -safer below. --safer Even if not running as root, disable the above unsafe - remote control commands. + completely use -novncconnect, or use the -safer + option that shuts many things off. + +-unsafe A few remote commands are disabled by default + (currently: id:pick, accept:<cmd>, gone:<cmd>, and + rawfb:setup:<cmd>) because they are associated with + running external programs. If you specify -unsafe, then + these remote-control commands are allowed. Note that + you can still specify these parameters on the command + line, they just cannot be changed via remote-control. +-safer Equivalent to: -novncconnect -noremote and prohibiting + -gui and the -connect file. Shuts off communcation + channels. +-privremote Perform some sanity checks and only allow remote-control + commands if it appears that the X DISPLAY and/or + connectfile cannot be accessed by other users. (not + complete, does not check for empty access control list) +-nocmds No external commands (e.g. system(3), popen(3), exec(3)) + will be run. -deny_all For use with -remote nodeny: start out denying all incoming clients until "-remote nodeny" is used to @@ -5505,7 +5721,7 @@ These options are passed to libvncserver: Pretty wild huh? [1]Contact me if you have any questions or problems. Personally, I use: -x11vnc -rfbauth $HOME/.vnc/passwd -nap -flashcmap -cursor X -add_keysyms +x11vnc -rfbauth $HOME/.vnc/passwd -flashcmap -cursor X -add_keysyms (the -flashcmap only matters on old 8-bit X displays) diff --git a/x11vnc/misc/README b/x11vnc/misc/README index be7063f..713c95b 100644 --- a/x11vnc/misc/README +++ b/x11vnc/misc/README @@ -24,6 +24,7 @@ x11vnc -pipeinput/-rawfb utilities: vcinject.pl perl script like LinuxVNC.c, for x11vnc viewing of linux console slide.pl amusing example using x11vnc -rawfb for jpeg slideshow. + ranfb.pl example -rawfb setup:./ranfb.pl to set up a framebuffer. Misc. scripts: diff --git a/x11vnc/tkx11vnc b/x11vnc/tkx11vnc index 6f16085..0ed781b 100755 --- a/x11vnc/tkx11vnc +++ b/x11vnc/tkx11vnc @@ -229,6 +229,10 @@ Tuning input_skip: =D nodragging -- + wireframe + wireframe_mode: + =-C:never,top,always wirecopyrect: + -- noshm flipbyteorder onetile @@ -372,6 +376,10 @@ Set the -solid color value. Set the -xrandr mode value. " + set helptext(wireframe_mode) " +Set the -wireframe mode string value. +" + set helptext(simple-gui) " Toggle between menu items corresponding the most basic ones and all possible settings. I.e. toggle between a simple gui @@ -2821,6 +2829,8 @@ proc get_start_x11vnc_cmd {{show_rc 0}} { set nitem "sb" } elseif {$nitem == "xrandr_mode"} { set nitem "xrandr" + } elseif {$nitem == "wireframe_mode"} { + set nitem "wireframe" } elseif {$nitem == "solid_color"} { set nitem "solid" } diff --git a/x11vnc/tkx11vnc.h b/x11vnc/tkx11vnc.h index 66b7398..b00fc1d 100644 --- a/x11vnc/tkx11vnc.h +++ b/x11vnc/tkx11vnc.h @@ -235,6 +235,10 @@ " input_skip:\n" " =D nodragging\n" " --\n" +" wireframe\n" +" wireframe_mode:\n" +" =-C:never,top,always wirecopyrect:\n" +" --\n" " noshm\n" " flipbyteorder\n" " onetile\n" @@ -378,6 +382,10 @@ "Set the -xrandr mode value.\n" "\"\n" "\n" +" set helptext(wireframe_mode) \"\n" +"Set the -wireframe mode string value.\n" +"\"\n" +"\n" " set helptext(simple-gui) \"\n" "Toggle between menu items corresponding the most basic ones\n" "and all possible settings. I.e. toggle between a simple gui\n" @@ -2827,6 +2835,8 @@ " set nitem \"sb\"\n" " } elseif {$nitem == \"xrandr_mode\"} {\n" " set nitem \"xrandr\"\n" +" } elseif {$nitem == \"wireframe_mode\"} {\n" +" set nitem \"wireframe\"\n" " } elseif {$nitem == \"solid_color\"} {\n" " set nitem \"solid\"\n" " }\n" diff --git a/x11vnc/x11vnc.1 b/x11vnc/x11vnc.1 index 7bc9f6e..2acc247 100644 --- a/x11vnc/x11vnc.1 +++ b/x11vnc/x11vnc.1 @@ -2,7 +2,7 @@ .TH X11VNC "1" "April 2005" "x11vnc " "User Commands" .SH NAME x11vnc - allow VNC connections to real X11 displays - version: 0.7.2, lastmod: 2005-04-11 + version: 0.7.2, lastmod: 2005-04-19 .SH SYNOPSIS .B x11vnc [OPTION]... @@ -948,6 +948,65 @@ slow setups, but you lose all visual feedback for drags, text selection, and some menu traversals. It overrides any \fB-pointer_mode\fR setting .PP +\fB-wireframe\fR \fI[str],\fR \fB-nowireframe\fR +.IP +Try to detect window moves or resizes when a mouse +button is held down and show a wireframe instead of +the full opaque window. This is based completely on +heuristics and may not always work: it depends on your +window manager and even how you move things around. +See \fB-pointer_mode\fR below for discussion of the "bogging +down" problem this tries to avoid. Default: \fB-wireframe\fR +.IP +The value "str" is optional and, of course, is +packed with many tunable parameters for this scheme: +.IP +Format: shade,linewidth,percent,T+B+L+R,t1+t2+t3+t4 +Default: 0xff,3,0,32+8+8+8,0.15+0.35+4.0+0.1 +.IP +If you leave nothing between commas: ",," the default +value is used. If you don't specify enough commas, +the trailing parameters are set to their defaults. +.IP +"shade" indicate the "color" for the wireframe, +usually a greyscale: 0-255, however for 16 and 32bpp you +can specify an rgb.txt X color (e.g. "dodgerblue") or +a value > 255 is treated as RGB (e.g. red is 0xff0000). +"linewidth" sets the width of the wireframe in pixels. +"percent" indicates to not apply the wireframe scheme +to windows with area less than this percent of the +full screen. +.IP +"T+B+L+R" indicates four integers for how close in +pixels the pointer has to be from the Top, Bottom, Left, +or Right edges of the window to consider wireframing. +This is a speedup to quickly exclude a window from being +wireframed: set them all to zero to not try the speedup +(scrolling and selecting text will likely be slower). +.IP +"t1+t2+t3+t4" specify four floating point times in +seconds: t1 is how long to wait for the pointer to move, +t2 is how long to wait for the window to start moving +or being resized (for some window managers this can be +rather long), t3 is how long to keep a wireframe moving +before repainting the window. t4 is the minimum time +between sending wireframe "animations". For a slow +link this might be a better choice: 0.25+0.6+6.0+0.15 +.PP +\fB-wirecopyrect\fR \fImode,\fR \fB-nowirecopyrect\fR +.IP +Since the \fB-wireframe\fR mechanism evidently tracks moving +windows, a speedup can be obtained by telling the VNC +viewers to locally copy the translated window region. +This is the VNC CopyRect encoding: the framebuffer +update doesn't need to send the actual new image data. +"mode" can be "never" (same as \fB-nowirecopyrect)\fR +to never try the copyrect, "top" means only do it if +the window was not covered by any other windows, and +"always" means to translate the orginally unobscured +region (this may look odd as the remaining pieces come +in, but helps on a slow link) Default: always +.PP \fB-pointer_mode\fR \fIn\fR .IP Various pointer motion update schemes. "\fB-pm\fR" is @@ -973,7 +1032,6 @@ events before repolling the screen. n=2 is an improved scheme: by watching the current rate of input events it tries to detect if it should try to "eat" additional pointer events before continuing. -This mode was the default until Apr 2005. .IP n=3 is basically the same as n=2 except with slightly tweaked parameters. We made this a new one so one @@ -1171,8 +1229,8 @@ a file use: "map:/path/to/a/file@WxHxB". If there is trouble with mmap, use "file:/..." for slower .IR lseek (2) -based -reading. +based reading. If you do not supply a type "map" +is assumed if the file exists. .IP If string is "setup:cmd", then the command "cmd" is run and the first line from it is read and used @@ -1204,10 +1262,16 @@ for the first two examples) All user input is discarded. Most of the X11 (screen, keyboard, mouse) options do not make sense and many will cause this mode to crash, so please think twice -before setting/changing them. If you don't want x11vnc -to close the DISPLAY in rawfb mode, then capitalize -the prefix, SHM:, MAP: etc. Keeping the display open -enables default remote-control channel. +before setting/changing them. +.IP +If you don't want x11vnc to close the X DISPLAY in +rawfb mode, then capitalize the prefix, SHM:, MAP:, +FILE: Keeping the display open enables the default +remote-control channel, which could be useful. Also, +if you also specify \fB-noviewonly,\fR then the mouse and +keyboard input are still sent to the X display, this +usage should be very rare, i.e. doing something strange +with /dev/fb0. .PP \fB-pipeinput\fR \fIcmd\fR .IP @@ -1569,6 +1633,16 @@ dragging disable \fB-nodragging\fR mode. .IP nodragging enable \fB-nodragging\fR mode. .IP +wireframe enable \fB-wireframe\fR mode. +.IP +nowireframe disable \fB-wireframe\fR mode. +.IP +wireframe:str enable \fB-wireframe\fR mode string. +.IP +wireframe_mode:str enable \fB-wireframe\fR mode string. +.IP +wirecopyrect:str set \fB-wirecopyrect\fR string. +.IP pointer_mode:n set \fB-pointer_mode\fR to n. same as "pm" .IP input_skip:n set \fB-input_skip\fR to n. @@ -1719,31 +1793,33 @@ solid nosolid blackout xinerama noxinerama xtrap noxtrap xrandr noxrandr xrandr_mode padgeom quiet q noquiet modtweak nomodtweak xkb noxkb skip_keycodes add_keysyms noadd_keysyms clear_mods noclear_mods -clear_keys noclear_keys remap repeat norepeat fb nofb -bell nobell sel nosel primary noprimary cursorshape -nocursorshape cursorpos nocursorpos cursor show_cursor -noshow_cursor nocursor arrow xfixes noxfixes xdamage -noxdamage xd_area xd_mem alphacut alphafrac alpharemove -noalpharemove alphablend noalphablend xwarp xwarppointer -noxwarp noxwarppointer buttonmap dragging nodragging +clear_keys noclear_keys remap repeat norepeat +fb nofb bell nobell sel nosel primary noprimary +cursorshape nocursorshape cursorpos nocursorpos +cursor show_cursor noshow_cursor nocursor arrow +xfixes noxfixes xdamage noxdamage xd_area xd_mem +alphacut alphafrac alpharemove noalpharemove alphablend +noalphablend xwarp xwarppointer noxwarp noxwarppointer +buttonmap dragging nodragging wireframe_mode +wireframe nowireframe wirecopyrect nowirecopyrect pointer_mode pm input_skip input client_input speeds debug_pointer dp nodebug_pointer nodp debug_keyboard dk -nodebug_keyboard nodk deferupdate defer wait rfbwait nap -nonap sb screen_blank fs gaps grow fuzz snapfb nosnapfb -rawfb setup: progressive rfbport http nohttp httpport +nodebug_keyboard nodk deferupdate defer wait rfbwait +nap nonap sb screen_blank fs gaps grow fuzz snapfb +nosnapfb rawfb progressive rfbport http nohttp httpport httpdir enablehttpproxy noenablehttpproxy alwaysshared noalwaysshared nevershared noalwaysshared dontdisconnect nodontdisconnect desktop noremote .IP -aro= debug_xevents: display vncdisplay desktopname -http_url auth users rootshift clipshift scale_str -scaled_x scaled_y scale_numer scale_denom +aro= debug_xevents debug_xdamage display vncdisplay +desktopname http_url auth users rootshift clipshift +scale_str scaled_x scaled_y scale_numer scale_denom scale_fac scaling_blend scaling_nomult4 scaling_pad -scaling_interpolate inetd safer unsafe passwdfile -using_shm logfile o flag rc norc h help V version -lastmod bg sigpipe threads pipeinput clients -client_count pid ext_xtest ext_xtrap ext_xkb ext_xshm -ext_xinerama ext_overlay ext_xfixes ext_xdamage +scaling_interpolate inetd privremote unsafe safer +nocmds passwdfile using_shm logfile o flag rc norc h +help V version lastmod bg sigpipe threads pipeinput +clients client_count pid ext_xtest ext_xtrap ext_xkb +ext_xshm ext_xinerama ext_overlay ext_xfixes ext_xdamage ext_xrandr rootwin num_buttons button_mask mouse_x mouse_y bpp depth indexed_color dpy_x dpy_y wdpy_x wdpy_y off_x off_y cdpy_x cdpy_y coff_x coff_y rfbauth @@ -1785,27 +1861,46 @@ of the desktop. If the "\fB-connect\fR \fI/path/to/file\fR" channel is being used, obviously anyone who can write to /path/to/file can remotely control x11vnc. So be sure to protect the X display and that file's write -permissions. +permissions. See \fB-privremote\fR below. .IP If you are paranoid and do not think \fB-noremote\fR is enough, to disable the VNC_CONNECT property channel -completely use \fB-novncconnect.\fR +completely use \fB-novncconnect,\fR or use the \fB-safer\fR +option that shuts many things off. .PP \fB-unsafe\fR .IP -If x11vnc is running as root (e.g. inetd or Xsetup for -a display manager) a few remote commands are disabled -(currently: id:pick, accept:<cmd>, and gone:<cmd>) -because they are associated with running external -programs. If you specify \fB-unsafe,\fR then these remote -control commands are allowed when running as root. -When running as non-root all commands are allowed. -See \fB-safer\fR below. +A few remote commands are disabled by default +(currently: id:pick, accept:<cmd>, gone:<cmd>, and +rawfb:setup:<cmd>) because they are associated with +running external programs. If you specify \fB-unsafe,\fR then +these remote-control commands are allowed. Note that +you can still specify these parameters on the command +line, they just cannot be changed via remote-control. .PP \fB-safer\fR .IP -Even if not running as root, disable the above unsafe -remote control commands. +Equivalent to: \fB-novncconnect\fR \fB-noremote\fR and prohibiting +\fB-gui\fR and the \fB-connect\fR file. Shuts off communcation +channels. +.PP +\fB-privremote\fR +.IP +Perform some sanity checks and only allow remote-control +commands if it appears that the X DISPLAY and/or +connectfile cannot be accessed by other users. (not +complete, does not check for empty access control list) +.PP +\fB-nocmds\fR +.IP +No external commands (e.g. +.IR system (3) +, +.IR popen (3) +, +.IR exec (3) +) +will be run. .PP \fB-deny_all\fR .IP diff --git a/x11vnc/x11vnc.c b/x11vnc/x11vnc.c index bd06c44..e09d9ca 100644 --- a/x11vnc/x11vnc.c +++ b/x11vnc/x11vnc.c @@ -436,7 +436,7 @@ int xdamage_tile_count; /* date +'lastmod: %Y-%m-%d' */ -char lastmod[] = "0.7.2 lastmod: 2005-04-11"; +char lastmod[] = "0.7.2 lastmod: 2005-04-19"; int hack_val = 0; /* X display info */ @@ -452,6 +452,7 @@ int off_x, off_y; /* offsets for -sid */ int wdpy_x, wdpy_y; /* for actual sizes in case of -clip */ int cdpy_x, cdpy_y, coff_x, coff_y; /* the -clip params */ int button_mask = 0; /* button state and info */ +int button_mask_prev = 0; int num_buttons = -1; /* image structures */ @@ -569,6 +570,7 @@ int clients_served = 0; /* more transient kludge variables: */ int cursor_x, cursor_y; /* x and y from the viewer(s) */ +int button_change_x, button_change_y; int got_user_input = 0; int got_pointer_input = 0; int got_keyboard_input = 0; @@ -683,6 +685,8 @@ void pipe_pointer(int mask, int x, int y, rfbClientPtr client); int check_pipeinput(void); void cursor_position(int, int); +void parse_wireframe(void); +void set_wirecopyrect_mode(char *); void read_vnc_connect_prop(void); void set_vnc_connect_prop(char *); char *process_remote_cmd(char *, int); @@ -725,6 +729,7 @@ int get_read_rate(void); int get_net_rate(void); int get_net_latency(void); void measure_send_rates(int); +int fb_update_sent(int *); int get_remote_port(int sock); int get_local_port(int sock); @@ -785,7 +790,10 @@ int connect_once = 0; #endif int deny_all = 0; /* global locking of new clients */ int accept_remote_cmds = 1; /* -noremote */ -int safe_remote_only = 0; /* -safer, -unsafe */ +int safe_remote_only = 1; /* -unsafe */ +int priv_remote = 0; /* -privremote */ +int more_safe = 0; /* -safer */ +int no_external_cmds = 0; /* -nocmds */ int started_as_root = 0; int host_lookup = 1; char *users_list = NULL; /* -users */ @@ -820,6 +828,7 @@ unsigned long subwin = 0x0; /* -id, -sid */ int subwin_wait_mapped = 0; int debug_xevents = 0; /* -R debug_xevents:1 */ +int debug_xdamage = 0; /* -R debug_xdamage:1 or 2 ... */ int xtrap_input = 0; /* -xtrap for user input insertion */ int xinerama = 0; /* -xinerama */ @@ -846,6 +855,20 @@ int cursor_pos_updates = 1; /* cursor position updates -cursorpos */ int cursor_shape_updates = 1; /* cursor shape updates -nocursorshape */ int use_xwarppointer = 0; /* use XWarpPointer instead of XTestFake... */ int show_dragging = 1; /* process mouse movement events */ +#ifndef WIREFRAME +#define WIREFRAME 1 +#endif +int wireframe = WIREFRAME; /* try to emulate wireframe wm moves */ +/* shade,linewidth,percent,T+B+L+R,t1+t2+t3+t4 */ +#ifndef WIREFRAME_PARMS +#define WIREFRAME_PARMS "0xff,3,0,32+8+8+8,0.15+0.35+4.0+0.1" +#endif +char *wireframe_str = NULL; +char *wireframe_copyrect = NULL; +char *wireframe_copyrect_default = "always"; +int wireframe_in_progress = 0; +Window *stack_list = NULL; +int stack_num = 0; int no_autorepeat = 1; /* turn off autorepeat with clients */ int no_repeat_countdown = 2; int watch_bell = 1; /* watch for the bell using XKEYBOARD */ @@ -923,6 +946,7 @@ int got_alwaysshared = 0; int got_nevershared = 0; int got_cursorpos = 0; int got_pointer_mode = -1; +int got_noviewonly = 0; /* threaded vs. non-threaded (default) */ #if LIBVNCSERVER_X11VNC_THREADED && ! defined(X11VNC_THREADED) @@ -1074,6 +1098,12 @@ int pick_windowid(unsigned long *num) { if (use_dpy) { set_env("DISPLAY", use_dpy); } + if (no_external_cmds) { + rfbLog("cannot run external commands in -nocmds mode:\n"); + rfbLog(" \"%s\"\n", "xwininfo"); + rfbLog(" exiting.\n"); + clean_up_exit(1); + } p = popen("xwininfo", "r"); if (! p) { @@ -2707,9 +2737,7 @@ void clean_up_exit (int ret) { /* remove the shm areas: */ clean_shm(0); - if (! dpy) { - exit(ret); /* raw_rb hack */ - } + if (! dpy) exit(ret); /* raw_rb hack */ /* X keyboard cleanups */ delete_added_keycodes(); @@ -2878,14 +2906,20 @@ void interrupted (int sig) { } /* trapping utility to check for a valid window: */ -int valid_window(Window win) { +int valid_window(Window win, XWindowAttributes *attr_ret) { XErrorHandler old_handler; - XWindowAttributes attr; + XWindowAttributes attr, *pattr; int ok = 0; + if (attr_ret == NULL) { + pattr = &attr; + } else { + pattr = attr_ret; + } + trapped_xerror = 0; old_handler = XSetErrorHandler(trap_xerror); - if (XGetWindowAttributes(dpy, win, &attr)) { + if (XGetWindowAttributes(dpy, win, pattr)) { ok = 1; } if (trapped_xerror && trapped_xerror_event && ! quiet) { @@ -2904,7 +2938,7 @@ int wait_until_mapped(Window win) { XWindowAttributes attr; while (1) { - if (! valid_window(win)) { + if (! valid_window(win, NULL)) { if (time(0) > start + waittime) { return 0; } @@ -3219,7 +3253,6 @@ void set_child_info(void) { * used by, e.g., accept_client() and client_gone() */ static int run_user_command(char *cmd, rfbClientPtr client, char *mode) { - char *dpystr = DisplayString(dpy); char *old_display = NULL; char *addr = client->host; char str[100]; @@ -3285,7 +3318,12 @@ static int run_user_command(char *cmd, rfbClientPtr client, char *mode) { if (getenv("DISPLAY")) { old_display = strdup(getenv("DISPLAY")); } - set_env("DISPLAY", dpystr); + + if (raw_fb && ! dpy) { /* raw_fb hack */ + set_env("DISPLAY", "rawfb"); + } else { + set_env("DISPLAY", DisplayString(dpy)); + } /* * work out the number of clients (have to use client_count @@ -3294,6 +3332,12 @@ static int run_user_command(char *cmd, rfbClientPtr client, char *mode) { sprintf(str, "%d", client_count); set_env("RFB_CLIENT_COUNT", str); + if (no_external_cmds) { + rfbLog("cannot run external commands in -nocmds mode:\n"); + rfbLog(" \"%s\"\n", cmd); + rfbLog(" exiting.\n"); + clean_up_exit(1); + } rfbLog("running command:\n"); rfbLog(" %s\n", cmd); @@ -3576,6 +3620,8 @@ static char t2x2_bits[] = { int No_x = 75, No_y = 0, No_w = 45, No_h = 20; int Vi_x = 130, Vi_y = 0, Vi_w = 45, Vi_h = 20; + if (raw_fb && ! dpy) return 0; /* raw_fb hack */ + if (!strcmp(mode, "mouse_only")) { str1 = str1_m; str2 = str2_m; @@ -4587,6 +4633,8 @@ void autorepeat(int restore) { XKeyboardControl kctrl; static int save_auto_repeat = -1; + if (raw_fb && ! dpy) return; /* raw_fb hack */ + if (restore) { if (save_auto_repeat < 0) { return; /* nothing to restore */ @@ -4633,6 +4681,8 @@ int add_keysym(KeySym keysym) { static int first = 1; KeySym *keymap; + if (raw_fb && ! dpy) return 0; /* raw_fb hack */ + if (first) { for (n=0; n < 0x100; n++) { added_keysyms[n] = NoSymbol; @@ -4703,6 +4753,8 @@ void delete_keycode(KeyCode kc) { KeySym ksym, new[8]; char *str; + if (raw_fb && ! dpy) return; /* raw_fb hack */ + XDisplayKeycodes(dpy, &minkey, &maxkey); keymap = XGetKeyboardMapping(dpy, minkey, (maxkey - minkey + 1), &syms_per_keycode); @@ -5728,6 +5780,7 @@ void initialize_allowed_input(void) { } void initialize_keyboard_and_pointer(void) { + if (raw_fb && ! dpy) return; /* raw_fb hack */ if (use_modifier_tweak) { @@ -6070,6 +6123,8 @@ void keyboard(rfbBool down, rfbKeySym keysym, rfbClientPtr client) { got_user_input++; got_keyboard_input++; + if (raw_fb && ! dpy) return; /* raw_fb hack */ + if (keyremaps) { keyremap_t *remap = keyremaps; while (remap != NULL) { @@ -6398,10 +6453,31 @@ void initialize_pointer_map(char *pointer_remap) { } /* + * For use in the -wireframe stuff, save the stacking order of the direct + * children of the root window. Ideally done before we send ButtonPress + * to the X server. + */ +void snapshot_stack_list(void) { + Window r, w; + if (stack_list) { + XFree(stack_list); + stack_list = NULL; + stack_num = 0; + } + XSync(dpy, False); + if (! XQueryTree(dpy, rootwin, &r, &w, &stack_list, &stack_num)) { + stack_list = NULL; + stack_num = 0; + } +} + +/* * Send a pointer position event to the X server. */ static void update_x11_pointer_position(int x, int y) { + if (raw_fb && ! dpy) return; /* raw_fb hack */ + X_LOCK; if (use_xwarppointer) { /* @@ -6426,16 +6502,6 @@ static void update_x11_pointer_position(int x, int y) { set_cursor(x, y, get_which_cursor()); last_event = last_input = time(0); - - if (nofb) { - /* - * nofb is for, e.g. Win2VNC, where fastest pointer - * updates are desired. - */ - X_LOCK; - XFlush(dpy); - X_UNLOCK; - } } /* @@ -6446,7 +6512,17 @@ static void update_x11_pointer_mask(int mask) { last_event = last_input = time(0); + if (raw_fb && ! dpy) return; /* raw_fb hack */ + X_LOCK; + if (mask && !button_mask) { + /* button down, snapshot the stacking list before flushing */ + if (wireframe && !wireframe_in_progress && + strcmp(wireframe_copyrect, "never")) { + snapshot_stack_list(); + } + } + /* look for buttons that have be clicked or released: */ for (i=0; i < MAX_BUTTONS; i++) { if ( (button_mask & (1<<i)) != (mask & (1<<i)) ) { @@ -6511,12 +6587,14 @@ static void update_x11_pointer_mask(int mask) { } } + X_UNLOCK; /* * Remember the button state for next time and also for the * -nodragging case: */ + button_mask_prev = button_mask; button_mask = mask; } @@ -6589,6 +6667,7 @@ void pipe_pointer(int mask, int x, int y, rfbClientPtr client) { */ void pointer(int mask, int x, int y, rfbClientPtr client) { allowed_input_t input; + int sent = 0; if (debug_pointer && mask >= 0) { static int show_motion = -1; @@ -6623,6 +6702,7 @@ void pointer(int mask, int x, int y, rfbClientPtr client) { } if (view_only && raw_fb) { /* raw_fb hack track button state */ + button_mask_prev = button_mask; button_mask = mask; } return; @@ -6725,7 +6805,9 @@ void pointer(int mask, int x, int y, rfbClientPtr client) { } if (nevents && dt > maxwait) { X_LOCK; - XFlush(dpy); + if (dpy) { /* raw_fb hack */ + XFlush(dpy); + } X_UNLOCK; } nevents = 0; /* reset everything */ @@ -6745,9 +6827,25 @@ void pointer(int mask, int x, int y, rfbClientPtr client) { /* update the X display with the event: */ if (input.motion) { update_x11_pointer_position(x, y); + sent = 1; } if (input.button) { + if (mask != button_mask) { + button_change_x = cursor_x; + button_change_y = cursor_y; + } update_x11_pointer_mask(mask); + sent = 1; + } + + if (nofb && sent) { + /* + * nofb is for, e.g. Win2VNC, where fastest pointer + * updates are desired. + */ + X_LOCK; + XFlush(dpy); + X_UNLOCK; } } @@ -6830,6 +6928,12 @@ void initialize_pipeinput(void) { } set_child_info(); + if (no_external_cmds) { + rfbLog("cannot run external commands in -nocmds mode:\n"); + rfbLog(" \"%s\"\n", p); + rfbLog(" exiting.\n"); + clean_up_exit(1); + } rfbLog("pipeinput: starting: \"%s\"...\n", p); pipeinput_fh = popen(p, "w"); @@ -7123,7 +7227,7 @@ int handle_subwin_resize(char *msg) { if (! subwin) { return 0; /* hmmm... */ } - if (! valid_window(subwin)) { + if (! valid_window(subwin, NULL)) { rfbLog("subwin 0x%lx went away!\n", subwin); X_UNLOCK; clean_up_exit(1); @@ -7625,9 +7729,8 @@ void check_xevents(void) { static time_t last_sync = 0; time_t now = time(0); - if (! dpy) { /* raw_fb hack */ - return; - } + if (raw_fb && ! dpy) return; /* raw_fb hack */ + if (now > last_init_check+1) { last_init_check = now; initialize_xevents(); @@ -7838,7 +7941,7 @@ void check_xevents(void) { } if (now > last_check + 1) { - int ev_max = 300, ev_size = 400; + int ev_type_max = 300, ev_size = 400; XEvent xevs[400]; int i, tot = XEventsQueued(dpy, QueuedAlready); @@ -7852,7 +7955,7 @@ void check_xevents(void) { fprintf(stderr, "Total events queued: %d\n", tot); } - for (i=1; i<ev_max; i++) { + for (i=1; i<ev_type_max; i++) { int k, n = 0; while (XCheckTypedEvent(dpy, i, xevs+n)) { if (++n >= ev_size) { @@ -7860,8 +7963,9 @@ void check_xevents(void) { } } if (n) { - fprintf(stderr, " %d events of type %d" - " queued\n", n, i); + fprintf(stderr, " %d%s events of type" + " %d queued\n", n, + (n >= ev_size) ? "+" : "", i); } for (k=n-1; k >= 0; k--) { XPutBackEvent(dpy, xevs+k); @@ -7897,6 +8001,8 @@ void check_xevents(void) { void xcut_receive(char *text, int len, rfbClientPtr cl) { allowed_input_t input; + if (raw_fb && ! dpy) return; /* raw_fb hack */ + if (!watch_selection) { return; } @@ -8326,6 +8432,105 @@ void reset_rfbport(int old, int new) { } /* + * Do some sanity checking of the permissions on the XAUTHORITY and the + * -connect file. This is -privremote. What should be done is check + * for an empty host access list, currently we lazily do not bring in + * libXau yet. + */ +int remote_control_access_ok(void) { + struct stat sbuf; + + if (client_connect_file) { + if (stat(client_connect_file, &sbuf) == 0) { + if (sbuf.st_mode & S_IWOTH) { + rfbLog("connect file is writable by others.\n"); + rfbLog(" %s\n", client_connect_file); + return 0; + } + if (sbuf.st_mode & S_IWGRP) { + rfbLog("connect file is writable by group.\n"); + rfbLog(" %s\n", client_connect_file); + return 0; + } + } + } + + if (dpy) { + char tmp[1000]; + char *home, *xauth; + char *dpy_str = DisplayString(dpy); + Display *dpy2; + + home = get_home_dir(); + if (getenv("XAUTHORITY") != NULL) { + xauth = getenv("XAUTHORITY"); + } else if (home) { + int len = 1000 - strlen("/.Xauthority") - 1; + strncpy(tmp, home, len); + strcat(tmp, "/.Xauthority"); + xauth = tmp; + } else { + rfbLog("cannot determine default XAUTHORITY.\n"); + return 0; + } + if (home) { + free(home); + } + if (stat(xauth, &sbuf) == 0) { + if (sbuf.st_mode & S_IWOTH) { + rfbLog("XAUTHORITY is writable by others!!\n"); + rfbLog(" %s\n", xauth); + return 0; + } + if (sbuf.st_mode & S_IWGRP) { + rfbLog("XAUTHORITY is writable by group!!\n"); + rfbLog(" %s\n", xauth); + return 0; + } + if (sbuf.st_mode & S_IROTH) { + rfbLog("XAUTHORITY is readable by others.\n"); + rfbLog(" %s\n", xauth); + return 0; + } + if (sbuf.st_mode & S_IRGRP) { + rfbLog("XAUTHORITY is readable by group.\n"); + rfbLog(" %s\n", xauth); + return 0; + } + } + + if (getenv("XAUTHORITY")) { + xauth = strdup(getenv("XAUTHORITY")); + } else { + xauth = NULL; + } + set_env("XAUTHORITY", "/impossible/xauthfile"); + + fprintf(stderr, "\nChecking if display %s requires " + "XAUTHORITY\n", dpy_str); + fprintf(stderr, " (ignore any Xlib: errors that follow)\n"); + dpy2 = XOpenDisplay(dpy_str); + + if (xauth) { + set_env("XAUTHORITY", xauth); + free(xauth); + } else { + xauth = getenv("XAUTHORITY"); + if (xauth) { + *(xauth-2) = '_'; /* yow */ + } + } + if (dpy2) { + rfbLog("XAUTHORITY is not required on display.\n"); + rfbLog(" %s\n", DisplayString(dpy)); + XCloseDisplay(dpy2); + return 0; + } + } + return 1; +} + +/* * Huge, ugly switch to handle all remote commands and queries * -remote/-R and -query/-Q. */ @@ -8337,12 +8542,23 @@ char *process_remote_cmd(char *cmd, int stringonly) { int bufn = VNC_CONNECT_MAX; int query = 0; static char *prev_cursors_mode = NULL; + static int first = 1; if (! accept_remote_cmds) { rfbLog("remote commands disabled: %s\n", cmd); return NULL; } + if (first && priv_remote) { + if (! remote_control_access_ok()) { + rfbLog("disabling remote commands in -privremote " + "mode.\n"); + accept_remote_cmds = 0; + return NULL; + } + } + first = 0; + strcpy(buf, ""); if (strstr(cmd, "cmd=") == cmd) { p += strlen("cmd="); @@ -8425,7 +8641,7 @@ char *process_remote_cmd(char *cmd, int stringonly) { !strcmp(p, "exit") || !strcmp(p, "shutdown")) { NOTAPP close_all_clients(); - rfbLog("process_remote_cmd: setting shut_down flag\n"); + rfbLog("remote_cmd: setting shut_down flag\n"); shut_down = 1; } else if (!strcmp(p, "ping")) { @@ -8515,7 +8731,7 @@ char *process_remote_cmd(char *cmd, int stringonly) { ok = 1; } if (ok) { - if (twin && ! valid_window(twin)) { + if (twin && ! valid_window(twin, NULL)) { rfbLog("skipping invalid sub-window: 0x%lx\n", twin); } else { @@ -8552,7 +8768,7 @@ char *process_remote_cmd(char *cmd, int stringonly) { ok = 1; } if (ok) { - if (twin && ! valid_window(twin)) { + if (twin && ! valid_window(twin, NULL)) { rfbLog("skipping invalid sub-window: 0x%lx\n", twin); } else { @@ -8596,14 +8812,14 @@ char *process_remote_cmd(char *cmd, int stringonly) { snprintf(buf, bufn, "ans=%s:%d", p, flash_cmap); goto qry; } - rfbLog("process_remote_cmd: turning on flashcmap mode.\n"); + rfbLog("remote_cmd: turning on flashcmap mode.\n"); flash_cmap = 1; } else if (!strcmp(p, "noflashcmap")) { if (query) { snprintf(buf, bufn, "ans=%s:%d", p, !flash_cmap); goto qry; } - rfbLog("process_remote_cmd: turning off flashcmap mode.\n"); + rfbLog("remote_cmd: turning off flashcmap mode.\n"); flash_cmap = 0; } else if (strstr(p, "shiftcmap") == p) { @@ -8614,7 +8830,7 @@ char *process_remote_cmd(char *cmd, int stringonly) { } p += strlen("shiftcmap:"); shift_cmap = atoi(p); - rfbLog("process_remote_cmd: set -shiftcmap %d\n", shift_cmap); + rfbLog("remote_cmd: set -shiftcmap %d\n", shift_cmap); do_new_fb(1); } else if (!strcmp(p, "truecolor")) { @@ -8624,7 +8840,7 @@ char *process_remote_cmd(char *cmd, int stringonly) { !force_indexed_color); goto qry; } - rfbLog("process_remote_cmd: turning off notruecolor mode.\n"); + rfbLog("remote_cmd: turning off notruecolor mode.\n"); force_indexed_color = 0; if (orig != force_indexed_color) { if_8bpp_do_new_fb(); @@ -8636,7 +8852,7 @@ char *process_remote_cmd(char *cmd, int stringonly) { force_indexed_color); goto qry; } - rfbLog("process_remote_cmd: turning on notruecolor mode.\n"); + rfbLog("remote_cmd: turning on notruecolor mode.\n"); force_indexed_color = 1; if (orig != force_indexed_color) { if_8bpp_do_new_fb(); @@ -8647,7 +8863,7 @@ char *process_remote_cmd(char *cmd, int stringonly) { snprintf(buf, bufn, "ans=%s:%d", p, overlay); goto qry; } - rfbLog("process_remote_cmd: turning on -overlay mode.\n"); + rfbLog("remote_cmd: turning on -overlay mode.\n"); if (!overlay_present) { rfbLog("skipping: overlay extension not present.\n"); } else if (overlay) { @@ -8669,7 +8885,7 @@ char *process_remote_cmd(char *cmd, int stringonly) { snprintf(buf, bufn, "ans=%s:%d", p, !overlay); goto qry; } - rfbLog("process_remote_cmd: turning off overlay mode\n"); + rfbLog("remote_cmd: turning off overlay mode\n"); overlay = 0; if (!overlay_present) { rfbLog("warning: overlay extension not present.\n"); @@ -8687,7 +8903,7 @@ char *process_remote_cmd(char *cmd, int stringonly) { snprintf(buf, bufn, "ans=%s:%d", p, overlay_cursor); goto qry; } - rfbLog("process_remote_cmd: turning on overlay_cursor mode.\n"); + rfbLog("remote_cmd: turning on overlay_cursor mode.\n"); overlay_cursor = 1; if (!overlay_present) { rfbLog("warning: overlay extension not present.\n"); @@ -8705,7 +8921,7 @@ char *process_remote_cmd(char *cmd, int stringonly) { snprintf(buf, bufn, "ans=%s:%d", p, !overlay_cursor); goto qry; } - rfbLog("process_remote_cmd: turning off overlay_cursor mode\n"); + rfbLog("remote_cmd: turning off overlay_cursor mode\n"); overlay_cursor = 0; if (!overlay_present) { rfbLog("warning: overlay extension not present.\n"); @@ -8768,14 +8984,14 @@ char *process_remote_cmd(char *cmd, int stringonly) { snprintf(buf, bufn, "ans=%s:%d", p, view_only); goto qry; } - rfbLog("process_remote_cmd: enable viewonly mode.\n"); + rfbLog("remote_cmd: enable viewonly mode.\n"); view_only = 1; } else if (!strcmp(p, "noviewonly")) { if (query) { snprintf(buf, bufn, "ans=%s:%d", p, !view_only); goto qry; } - rfbLog("process_remote_cmd: disable viewonly mode.\n"); + rfbLog("remote_cmd: disable viewonly mode.\n"); view_only = 0; if (raw_fb) set_raw_fb_params(0); @@ -8783,7 +8999,7 @@ char *process_remote_cmd(char *cmd, int stringonly) { if (query) { snprintf(buf, bufn, "ans=%s:%d", p, shared); goto qry; } - rfbLog("process_remote_cmd: enable sharing.\n"); + rfbLog("remote_cmd: enable sharing.\n"); shared = 1; if (screen) { screen->alwaysShared = TRUE; @@ -8793,7 +9009,7 @@ char *process_remote_cmd(char *cmd, int stringonly) { if (query) { snprintf(buf, bufn, "ans=%s:%d", p, !shared); goto qry; } - rfbLog("process_remote_cmd: disable sharing.\n"); + rfbLog("remote_cmd: disable sharing.\n"); shared = 0; if (screen) { screen->alwaysShared = FALSE; @@ -8805,14 +9021,14 @@ char *process_remote_cmd(char *cmd, int stringonly) { snprintf(buf, bufn, "ans=%s:%d", p, 1-connect_once); goto qry; } - rfbLog("process_remote_cmd: enable -forever mode.\n"); + rfbLog("remote_cmd: enable -forever mode.\n"); connect_once = 0; } else if (!strcmp(p, "noforever") || !strcmp(p, "once")) { if (query) { snprintf(buf, bufn, "ans=%s:%d", p, connect_once); goto qry; } - rfbLog("process_remote_cmd: disable -forever mode.\n"); + rfbLog("remote_cmd: disable -forever mode.\n"); connect_once = 1; } else if (strstr(p, "timeout") == p) { @@ -8829,21 +9045,21 @@ char *process_remote_cmd(char *cmd, int stringonly) { to = -to; } first_conn_timeout = to; - rfbLog("process_remote_cmd: set -timeout to %d\n", -to); + rfbLog("remote_cmd: set -timeout to %d\n", -to); } else if (!strcmp(p, "deny") || !strcmp(p, "lock")) { if (query) { snprintf(buf, bufn, "ans=%s:%d", p, deny_all); goto qry; } - rfbLog("process_remote_cmd: denying new connections.\n"); + rfbLog("remote_cmd: denying new connections.\n"); deny_all = 1; } else if (!strcmp(p, "nodeny") || !strcmp(p, "unlock")) { if (query) { snprintf(buf, bufn, "ans=%s:%d", p, !deny_all); goto qry; } - rfbLog("process_remote_cmd: allowing new connections.\n"); + rfbLog("remote_cmd: allowing new connections.\n"); deny_all = 0; } else if (strstr(p, "connect") == p) { @@ -8862,7 +9078,7 @@ char *process_remote_cmd(char *cmd, int stringonly) { } p += strlen("allowonce:"); allow_once = strdup(p); - rfbLog("process_remote_cmd: set allow_once %s\n", allow_once); + rfbLog("remote_cmd: set allow_once %s\n", allow_once); } else if (strstr(p, "allow") == p) { char *before, *old; @@ -8874,7 +9090,7 @@ char *process_remote_cmd(char *cmd, int stringonly) { } p += strlen("allow:"); if (allow_list && strchr(allow_list, '/')) { - rfbLog("process_remote_cmd: cannot use allow:host\n"); + rfbLog("remote_cmd: cannot use allow:host\n"); rfbLog("in '-allow %s' mode.\n", allow_list); goto done; } @@ -8896,7 +9112,7 @@ char *process_remote_cmd(char *cmd, int stringonly) { } if (strcmp(before, allow_list)) { - rfbLog("process_remote_cmd: modified allow_list:\n"); + rfbLog("remote_cmd: modified allow_list:\n"); rfbLog(" from: \"%s\"\n", before); rfbLog(" to: \"%s\"\n", allow_list); } @@ -8925,7 +9141,7 @@ char *process_remote_cmd(char *cmd, int stringonly) { allow_list = strdup("127.0.0.1"); if (strcmp(before, allow_list)) { - rfbLog("process_remote_cmd: modified allow_list:\n"); + rfbLog("remote_cmd: modified allow_list:\n"); rfbLog(" from: \"%s\"\n", before); rfbLog(" to: \"%s\"\n", allow_list); } @@ -8966,7 +9182,7 @@ char *process_remote_cmd(char *cmd, int stringonly) { allow_list = strdup(""); if (strcmp(before, allow_list)) { - rfbLog("process_remote_cmd: modified allow_list:\n"); + rfbLog("remote_cmd: modified allow_list:\n"); rfbLog(" from: \"%s\"\n", before); rfbLog(" to: \"%s\"\n", allow_list); } @@ -9006,7 +9222,7 @@ char *process_remote_cmd(char *cmd, int stringonly) { listen_str = strdup(p); if (strcmp(before, listen_str)) { - rfbLog("process_remote_cmd: modified listen_str:\n"); + rfbLog("remote_cmd: modified listen_str:\n"); rfbLog(" from: \"%s\"\n", before); rfbLog(" to: \"%s\"\n", listen_str); mod = 1; @@ -9079,14 +9295,14 @@ char *process_remote_cmd(char *cmd, int stringonly) { snprintf(buf, bufn, "ans=%s:%d", p, host_lookup); goto qry; } - rfbLog("process_remote_cmd: enabling hostname lookup.\n"); + rfbLog("remote_cmd: enabling hostname lookup.\n"); host_lookup = 1; } else if (!strcmp(p, "nolookup")) { if (query) { snprintf(buf, bufn, "ans=%s:%d", p, !host_lookup); goto qry; } - rfbLog("process_remote_cmd: disabling hostname lookup.\n"); + rfbLog("remote_cmd: disabling hostname lookup.\n"); host_lookup = 0; } else if (strstr(p, "accept") == p) { @@ -9125,7 +9341,7 @@ char *process_remote_cmd(char *cmd, int stringonly) { snprintf(buf, bufn, "ans=%s:%d", p, using_shm); goto qry; } - rfbLog("process_remote_cmd: turning off noshm mode.\n"); + rfbLog("remote_cmd: turning off noshm mode.\n"); using_shm = 1; if (raw_fb) set_raw_fb_params(0); @@ -9140,7 +9356,7 @@ char *process_remote_cmd(char *cmd, int stringonly) { snprintf(buf, bufn, "ans=%s:%d", p, !using_shm); goto qry; } - rfbLog("process_remote_cmd: turning on noshm mode.\n"); + rfbLog("remote_cmd: turning on noshm mode.\n"); using_shm = 0; if (orig != using_shm) { do_new_fb(1); @@ -9154,7 +9370,7 @@ char *process_remote_cmd(char *cmd, int stringonly) { snprintf(buf, bufn, "ans=%s:%d", p, flip_byte_order); goto qry; } - rfbLog("process_remote_cmd: turning on flipbyteorder mode.\n"); + rfbLog("remote_cmd: turning on flipbyteorder mode.\n"); flip_byte_order = 1; if (orig != flip_byte_order) { if (! using_shm) { @@ -9169,7 +9385,7 @@ char *process_remote_cmd(char *cmd, int stringonly) { snprintf(buf, bufn, "ans=%s:%d", p, !flip_byte_order); goto qry; } - rfbLog("process_remote_cmd: turning off flipbyteorder mode.\n"); + rfbLog("remote_cmd: turning off flipbyteorder mode.\n"); flip_byte_order = 0; if (orig != flip_byte_order) { if (! using_shm) { @@ -9184,14 +9400,14 @@ char *process_remote_cmd(char *cmd, int stringonly) { snprintf(buf, bufn, "ans=%s:%d", p, single_copytile); goto qry; } - rfbLog("process_remote_cmd: enable -onetile mode.\n"); + rfbLog("remote_cmd: enable -onetile mode.\n"); single_copytile = 1; } else if (!strcmp(p, "noonetile")) { if (query) { snprintf(buf, bufn, "ans=%s:%d", p, !single_copytile); goto qry; } - rfbLog("process_remote_cmd: disable -onetile mode.\n"); + rfbLog("remote_cmd: disable -onetile mode.\n"); if (tile_shm_count < ntiles_x) { rfbLog(" this has no effect: tile_shm_count=%d" " ntiles_x=%d\n", tile_shm_count, ntiles_x); @@ -9200,6 +9416,11 @@ char *process_remote_cmd(char *cmd, int stringonly) { single_copytile = 0; } else if (strstr(p, "solid_color") == p) { + /* + * n.b. this solid stuff perhaps should reflect + * safe_remote_only but at least the command names + * are fixed. + */ char *new; int doit = 1; COLON_CHECK("solid_color:") @@ -9214,8 +9435,7 @@ char *process_remote_cmd(char *cmd, int stringonly) { } else { new = strdup(solid_default); } - rfbLog("process_remote_cmd: solid %s -> %s\n", - NONUL(solid_str), new); + rfbLog("remote_cmd: solid %s -> %s\n", NONUL(solid_str), new); if (solid_str) { if (!strcmp(solid_str, new)) { @@ -9236,7 +9456,7 @@ char *process_remote_cmd(char *cmd, int stringonly) { snprintf(buf, bufn, "ans=%s:%d", p, use_solid_bg); goto qry; } - rfbLog("process_remote_cmd: enable -solid mode\n"); + rfbLog("remote_cmd: enable -solid mode\n"); if (! solid_str) { solid_str = strdup(solid_default); } @@ -9251,7 +9471,7 @@ char *process_remote_cmd(char *cmd, int stringonly) { snprintf(buf, bufn, "ans=%s:%d", p, !use_solid_bg); goto qry; } - rfbLog("process_remote_cmd: disable -solid mode\n"); + rfbLog("remote_cmd: disable -solid mode\n"); use_solid_bg = 0; if (client_count && orig) { solid_bg(1); @@ -9282,7 +9502,7 @@ char *process_remote_cmd(char *cmd, int stringonly) { blackout_str = strdup(p); } if (strcmp(before, blackout_str)) { - rfbLog("process_remote_cmd: changing -blackout\n"); + rfbLog("remote_cmd: changing -blackout\n"); rfbLog(" from: %s\n", before); rfbLog(" to: %s\n", blackout_str); if (0 && !strcmp(blackout_str, "") && @@ -9301,8 +9521,7 @@ char *process_remote_cmd(char *cmd, int stringonly) { snprintf(buf, bufn, "ans=%s:%d", p, xinerama); goto qry; } - rfbLog("process_remote_cmd: enable xinerama mode." - "(if applicable).\n"); + rfbLog("remote_cmd: enable xinerama mode. (if applicable).\n"); xinerama = 1; initialize_blackouts_and_xinerama(); } else if (!strcmp(p, "noxinerama")) { @@ -9310,8 +9529,7 @@ char *process_remote_cmd(char *cmd, int stringonly) { snprintf(buf, bufn, "ans=%s:%d", p, !xinerama); goto qry; } - rfbLog("process_remote_cmd: disable xinerama mode." - "(if applicable).\n"); + rfbLog("remote_cmd: disable xinerama mode. (if applicable).\n"); xinerama = 0; initialize_blackouts_and_xinerama(); @@ -9320,7 +9538,7 @@ char *process_remote_cmd(char *cmd, int stringonly) { snprintf(buf, bufn, "ans=%s:%d", p, xtrap_input); goto qry; } - rfbLog("process_remote_cmd: enable xtrap input mode." + rfbLog("remote_cmd: enable xtrap input mode." "(if applicable).\n"); if (! xtrap_input) { xtrap_input = 1; @@ -9332,7 +9550,7 @@ char *process_remote_cmd(char *cmd, int stringonly) { snprintf(buf, bufn, "ans=%s:%d", p, !xtrap_input); goto qry; } - rfbLog("process_remote_cmd: disable xtrap input mode." + rfbLog("remote_cmd: disable xtrap input mode." "(if applicable).\n"); if (xtrap_input) { xtrap_input = 0; @@ -9345,7 +9563,7 @@ char *process_remote_cmd(char *cmd, int stringonly) { snprintf(buf, bufn, "ans=%s:%d", p, xrandr); goto qry; } if (xrandr_present) { - rfbLog("process_remote_cmd: enable xrandr mode.\n"); + rfbLog("remote_cmd: enable xrandr mode.\n"); xrandr = 1; if (raw_fb) set_raw_fb_params(0); if (! xrandr_mode) { @@ -9355,8 +9573,7 @@ char *process_remote_cmd(char *cmd, int stringonly) { initialize_xrandr(); } } else { - rfbLog("process_remote_cmd: XRANDR ext. not " - "present.\n"); + rfbLog("remote_cmd: XRANDR ext. not present.\n"); } } else if (!strcmp(p, "noxrandr")) { int orig = xrandr; @@ -9365,13 +9582,12 @@ char *process_remote_cmd(char *cmd, int stringonly) { } xrandr = 0; if (xrandr_present) { - rfbLog("process_remote_cmd: disable xrandr mode.\n"); + rfbLog("remote_cmd: disable xrandr mode.\n"); if (orig != xrandr) { initialize_xrandr(); } } else { - rfbLog("process_remote_cmd: XRANDR ext. not " - "present.\n"); + rfbLog("remote_cmd: XRANDR ext. not present.\n"); } } else if (strstr(p, "xrandr_mode") == p) { int orig = xrandr; @@ -9396,11 +9612,9 @@ char *process_remote_cmd(char *cmd, int stringonly) { } if (xrandr_present) { if (xrandr) { - rfbLog("process_remote_cmd: enable xrandr" - " mode.\n"); + rfbLog("remote_cmd: enable xrandr mode.\n"); } else { - rfbLog("process_remote_cmd: disable xrandr" - " mode.\n"); + rfbLog("remote_cmd: disable xrandr mode.\n"); } if (! xrandr_mode) { xrandr_mode = strdup("default"); @@ -9409,8 +9623,7 @@ char *process_remote_cmd(char *cmd, int stringonly) { initialize_xrandr(); } } else { - rfbLog("process_remote_cmd: XRANDR ext. not " - "present.\n"); + rfbLog("remote_cmd: XRANDR ext. not present.\n"); } } else if (strstr(p, "padgeom") == p) { @@ -9422,13 +9635,12 @@ char *process_remote_cmd(char *cmd, int stringonly) { } p += strlen("padgeom:"); if (!strcmp("force", p) || !strcmp("do",p) || !strcmp("go",p)) { - rfbLog("process_remote_cmd: invoking " - "install_padded_fb()\n"); + rfbLog("remote_cmd: invoking install_padded_fb()\n"); install_padded_fb(pad_geometry); } else { if (pad_geometry) free(pad_geometry); pad_geometry = strdup(p); - rfbLog("process_remote_cmd: set padgeom to: %s\n", + rfbLog("remote_cmd: set padgeom to: %s\n", pad_geometry); } @@ -9436,13 +9648,13 @@ char *process_remote_cmd(char *cmd, int stringonly) { if (query) { snprintf(buf, bufn, "ans=%s:%d", p, quiet); goto qry; } - rfbLog("process_remote_cmd: turning on quiet mode.\n"); + rfbLog("remote_cmd: turning on quiet mode.\n"); quiet = 1; } else if (!strcmp(p, "noquiet")) { if (query) { snprintf(buf, bufn, "ans=%s:%d", p, !quiet); goto qry; } - rfbLog("process_remote_cmd: turning off quiet mode.\n"); + rfbLog("remote_cmd: turning off quiet mode.\n"); quiet = 0; } else if (!strcmp(p, "modtweak")) { @@ -9450,7 +9662,7 @@ char *process_remote_cmd(char *cmd, int stringonly) { snprintf(buf, bufn, "ans=%s:%d", p, use_modifier_tweak); goto qry; } - rfbLog("process_remote_cmd: enabling -modtweak mode.\n"); + rfbLog("remote_cmd: enabling -modtweak mode.\n"); if (! use_modifier_tweak) { use_modifier_tweak = 1; initialize_modtweak(); @@ -9463,7 +9675,7 @@ char *process_remote_cmd(char *cmd, int stringonly) { !use_modifier_tweak); goto qry; } - rfbLog("process_remote_cmd: enabling -nomodtweak mode.\n"); + rfbLog("remote_cmd: enabling -nomodtweak mode.\n"); use_modifier_tweak = 0; } else if (!strcmp(p, "xkb")) { @@ -9472,11 +9684,11 @@ char *process_remote_cmd(char *cmd, int stringonly) { goto qry; } if (! xkb_present) { - rfbLog("process_remote_cmd: cannot enable -xkb " + rfbLog("remote_cmd: cannot enable -xkb " "modtweak mode (not supported on X display)\n"); goto done; } - rfbLog("process_remote_cmd: enabling -xkb modtweak mode" + rfbLog("remote_cmd: enabling -xkb modtweak mode" " (if supported).\n"); if (! use_modifier_tweak || ! use_xkb_modtweak) { use_modifier_tweak = 1; @@ -9492,11 +9704,11 @@ char *process_remote_cmd(char *cmd, int stringonly) { goto qry; } if (! xkb_present) { - rfbLog("process_remote_cmd: cannot disable -xkb " + rfbLog("remote_cmd: cannot disable -xkb " "modtweak mode (not supported on X display)\n"); goto done; } - rfbLog("process_remote_cmd: disabling -xkb modtweak mode.\n"); + rfbLog("remote_cmd: disabling -xkb modtweak mode.\n"); use_xkb_modtweak = 0; } else if (strstr(p, "skip_keycodes") == p) { @@ -9507,16 +9719,15 @@ char *process_remote_cmd(char *cmd, int stringonly) { goto qry; } p += strlen("skip_keycodes:"); - rfbLog("process_remote_cmd: setting xkb -skip_keycodes" + rfbLog("remote_cmd: setting xkb -skip_keycodes" " to:\n\t'%s'\n", p); if (! xkb_present) { - rfbLog("process_remote_cmd: warning xkb not present\n"); + rfbLog("remote_cmd: warning xkb not present\n"); } else if (! use_xkb_modtweak) { - rfbLog("process_remote_cmd: turning on xkb.\n"); + rfbLog("remote_cmd: turning on xkb.\n"); use_xkb_modtweak = 1; if (! use_modifier_tweak) { - rfbLog("process_remote_cmd: turning on " - "modtweak.\n"); + rfbLog("remote_cmd: turning on modtweak.\n"); use_modifier_tweak = 1; } } @@ -9529,7 +9740,7 @@ char *process_remote_cmd(char *cmd, int stringonly) { snprintf(buf, bufn, "ans=%s:%d", p, add_keysyms); goto qry; } - rfbLog("process_remote_cmd: enabling -add_keysyms mode.\n"); + rfbLog("remote_cmd: enabling -add_keysyms mode.\n"); add_keysyms = 1; } else if (!strcmp(p, "noadd_keysyms")) { @@ -9537,7 +9748,7 @@ char *process_remote_cmd(char *cmd, int stringonly) { snprintf(buf, bufn, "ans=%s:%d", p, !add_keysyms); goto qry; } - rfbLog("process_remote_cmd: disabling -add_keysyms mode.\n"); + rfbLog("remote_cmd: disabling -add_keysyms mode.\n"); add_keysyms = 0; } else if (!strcmp(p, "clear_mods")) { @@ -9545,7 +9756,7 @@ char *process_remote_cmd(char *cmd, int stringonly) { snprintf(buf, bufn, "ans=%s:%d", p, clear_mods == 1); goto qry; } - rfbLog("process_remote_cmd: enabling -clear_mods mode.\n"); + rfbLog("remote_cmd: enabling -clear_mods mode.\n"); clear_mods = 1; clear_modifiers(0); @@ -9555,7 +9766,7 @@ char *process_remote_cmd(char *cmd, int stringonly) { !(clear_mods == 1)); goto qry; } - rfbLog("process_remote_cmd: disabling -clear_mods mode.\n"); + rfbLog("remote_cmd: disabling -clear_mods mode.\n"); clear_mods = 0; } else if (!strcmp(p, "clear_keys")) { @@ -9564,7 +9775,7 @@ char *process_remote_cmd(char *cmd, int stringonly) { clear_mods == 2); goto qry; } - rfbLog("process_remote_cmd: enabling -clear_keys mode.\n"); + rfbLog("remote_cmd: enabling -clear_keys mode.\n"); clear_mods = 2; clear_keys(); @@ -9574,7 +9785,7 @@ char *process_remote_cmd(char *cmd, int stringonly) { !(clear_mods == 2)); goto qry; } - rfbLog("process_remote_cmd: disabling -clear_keys mode.\n"); + rfbLog("remote_cmd: disabling -clear_keys mode.\n"); clear_mods = 0; } else if (strstr(p, "remap") == p) { @@ -9588,7 +9799,7 @@ char *process_remote_cmd(char *cmd, int stringonly) { p += strlen("remap:"); if ((*p == '+' || *p == '-') && remap_file && strchr(remap_file, '/')) { - rfbLog("process_remote_cmd: cannot use remap:+/-\n"); + rfbLog("remote_cmd: cannot use remap:+/-\n"); rfbLog("in '-remap %s' mode.\n", remap_file); goto done; } @@ -9611,7 +9822,7 @@ char *process_remote_cmd(char *cmd, int stringonly) { remap_file = strdup(p); } if (strcmp(before, remap_file)) { - rfbLog("process_remote_cmd: changed -remap\n"); + rfbLog("remote_cmd: changed -remap\n"); rfbLog(" from: %s\n", before); rfbLog(" to: %s\n", remap_file); initialize_remap(remap_file); @@ -9624,7 +9835,7 @@ char *process_remote_cmd(char *cmd, int stringonly) { snprintf(buf, bufn, "ans=%s:%d", p, !no_autorepeat); goto qry; } - rfbLog("process_remote_cmd: enabling -repeat mode.\n"); + rfbLog("remote_cmd: enabling -repeat mode.\n"); autorepeat(1); /* restore initial setting */ no_autorepeat = 0; @@ -9633,7 +9844,7 @@ char *process_remote_cmd(char *cmd, int stringonly) { snprintf(buf, bufn, "ans=%s:%d", p, no_autorepeat); goto qry; } - rfbLog("process_remote_cmd: enabling -norepeat mode.\n"); + rfbLog("remote_cmd: enabling -norepeat mode.\n"); no_autorepeat = 1; if (no_repeat_countdown >= 0) { no_repeat_countdown = 2; @@ -9648,7 +9859,7 @@ char *process_remote_cmd(char *cmd, int stringonly) { goto qry; } if (nofb) { - rfbLog("process_remote_cmd: disabling nofb mode.\n"); + rfbLog("remote_cmd: disabling nofb mode.\n"); rfbLog(" you may need to these turn back on:\n"); rfbLog(" xfixes, xdamage, solid, flashcmap\n"); rfbLog(" overlay, shm, noonetile, nap, cursor\n"); @@ -9662,7 +9873,7 @@ char *process_remote_cmd(char *cmd, int stringonly) { goto qry; } if (!nofb) { - rfbLog("process_remote_cmd: enabling nofb mode.\n"); + rfbLog("remote_cmd: enabling nofb mode.\n"); if (main_fb) { push_black_screen(4); } @@ -9678,7 +9889,7 @@ char *process_remote_cmd(char *cmd, int stringonly) { snprintf(buf, bufn, "ans=%s:%d", p, sound_bell); goto qry; } - rfbLog("process_remote_cmd: enabling bell (if supported).\n"); + rfbLog("remote_cmd: enabling bell (if supported).\n"); initialize_watch_bell(); sound_bell = 1; @@ -9687,7 +9898,7 @@ char *process_remote_cmd(char *cmd, int stringonly) { snprintf(buf, bufn, "ans=%s:%d", p, !sound_bell); goto qry; } - rfbLog("process_remote_cmd: disabling bell.\n"); + rfbLog("remote_cmd: disabling bell.\n"); initialize_watch_bell(); sound_bell = 0; @@ -9696,8 +9907,7 @@ char *process_remote_cmd(char *cmd, int stringonly) { snprintf(buf, bufn, "ans=%s:%d", p, watch_selection); goto qry; } - rfbLog("process_remote_cmd: enabling watch " - "selection+primary.\n"); + rfbLog("remote_cmd: enabling watch selection+primary.\n"); watch_selection = 1; watch_primary = 1; @@ -9706,8 +9916,7 @@ char *process_remote_cmd(char *cmd, int stringonly) { snprintf(buf, bufn, "ans=%s:%d", p, !watch_selection); goto qry; } - rfbLog("process_remote_cmd: disabling watch " - "selection+primary.\n"); + rfbLog("remote_cmd: disabling watch selection+primary.\n"); watch_selection = 0; watch_primary = 0; @@ -9716,7 +9925,7 @@ char *process_remote_cmd(char *cmd, int stringonly) { snprintf(buf, bufn, "ans=%s:%d", p, watch_primary); goto qry; } - rfbLog("process_remote_cmd: enabling watch_primary.\n"); + rfbLog("remote_cmd: enabling watch_primary.\n"); watch_primary = 1; } else if (!strcmp(p, "noprimary")) { @@ -9724,11 +9933,11 @@ char *process_remote_cmd(char *cmd, int stringonly) { snprintf(buf, bufn, "ans=%s:%d", p, !watch_primary); goto qry; } - rfbLog("process_remote_cmd: disabling watch_primary.\n"); + rfbLog("remote_cmd: disabling watch_primary.\n"); watch_primary = 0; } else if (!strcmp(p, "set_no_cursor")) { /* skip-cmd-list */ - rfbLog("process_remote_cmd: calling set_no_cursor()\n"); + rfbLog("remote_cmd: calling set_no_cursor()\n"); set_no_cursor(); } else if (!strcmp(p, "cursorshape")) { @@ -9737,7 +9946,7 @@ char *process_remote_cmd(char *cmd, int stringonly) { cursor_shape_updates); goto qry; } - rfbLog("process_remote_cmd: turning on cursorshape mode.\n"); + rfbLog("remote_cmd: turning on cursorshape mode.\n"); set_no_cursor(); cursor_shape_updates = 1; @@ -9750,7 +9959,7 @@ char *process_remote_cmd(char *cmd, int stringonly) { !cursor_shape_updates); goto qry; } - rfbLog("process_remote_cmd: turning off cursorshape mode.\n"); + rfbLog("remote_cmd: turning off cursorshape mode.\n"); set_no_cursor(); for (i=0; i<max; i++) { @@ -9767,7 +9976,7 @@ char *process_remote_cmd(char *cmd, int stringonly) { cursor_pos_updates); goto qry; } - rfbLog("process_remote_cmd: turning on cursorpos mode.\n"); + rfbLog("remote_cmd: turning on cursorpos mode.\n"); cursor_pos_updates = 1; } else if (!strcmp(p, "nocursorpos")) { if (query) { @@ -9775,7 +9984,7 @@ char *process_remote_cmd(char *cmd, int stringonly) { !cursor_pos_updates); goto qry; } - rfbLog("process_remote_cmd: turning off cursorpos mode.\n"); + rfbLog("remote_cmd: turning off cursorpos mode.\n"); cursor_pos_updates = 0; } else if (strstr(p, "cursor") == p) { @@ -9793,12 +10002,12 @@ char *process_remote_cmd(char *cmd, int stringonly) { } multiple_cursors_mode = strdup(p); - rfbLog("process_remote_cmd: changed -cursor mode " + rfbLog("remote_cmd: changed -cursor mode " "to: %s\n", multiple_cursors_mode); if (strcmp(multiple_cursors_mode, "none") && !show_cursor) { show_cursor = 1; - rfbLog("process_remote_cmd: changed show_cursor " + rfbLog("remote_cmd: changed show_cursor " "to: %d\n", show_cursor); } initialize_cursors_mode(); @@ -9809,7 +10018,7 @@ char *process_remote_cmd(char *cmd, int stringonly) { snprintf(buf, bufn, "ans=%s:%d", p, show_cursor); goto qry; } - rfbLog("process_remote_cmd: enabling show_cursor.\n"); + rfbLog("remote_cmd: enabling show_cursor.\n"); show_cursor = 1; if (multiple_cursors_mode && !strcmp(multiple_cursors_mode, "none")) { @@ -9820,7 +10029,7 @@ char *process_remote_cmd(char *cmd, int stringonly) { } else { multiple_cursors_mode = strdup("default"); } - rfbLog("process_remote_cmd: changed -cursor mode " + rfbLog("remote_cmd: changed -cursor mode " "to: %s\n", multiple_cursors_mode); } initialize_cursors_mode(); @@ -9833,7 +10042,7 @@ char *process_remote_cmd(char *cmd, int stringonly) { if (prev_cursors_mode) free(prev_cursors_mode); prev_cursors_mode = strdup(multiple_cursors_mode); - rfbLog("process_remote_cmd: disabling show_cursor.\n"); + rfbLog("remote_cmd: disabling show_cursor.\n"); show_cursor = 0; initialize_cursors_mode(); first_cursor(); @@ -9846,8 +10055,7 @@ char *process_remote_cmd(char *cmd, int stringonly) { } p += strlen("arrow:"); alt_arrow = atoi(p); - rfbLog("process_remote_cmd: setting alt_arrow: %d.\n", - alt_arrow); + rfbLog("remote_cmd: setting alt_arrow: %d.\n", alt_arrow); setup_cursors_and_push(); } else if (!strcmp(p, "xfixes")) { @@ -9856,11 +10064,11 @@ char *process_remote_cmd(char *cmd, int stringonly) { goto qry; } if (! xfixes_present) { - rfbLog("process_remote_cmd: cannot enable xfixes " + rfbLog("remote_cmd: cannot enable xfixes " "(not supported on X display)\n"); goto done; } - rfbLog("process_remote_cmd: enabling -xfixes" + rfbLog("remote_cmd: enabling -xfixes" " (if supported).\n"); use_xfixes = 1; initialize_xfixes(); @@ -9871,11 +10079,11 @@ char *process_remote_cmd(char *cmd, int stringonly) { goto qry; } if (! xfixes_present) { - rfbLog("process_remote_cmd: disabling xfixes " + rfbLog("remote_cmd: disabling xfixes " "(but not supported on X display)\n"); goto done; } - rfbLog("process_remote_cmd: disabling -xfixes.\n"); + rfbLog("remote_cmd: disabling -xfixes.\n"); use_xfixes = 0; initialize_xfixes(); first_cursor(); @@ -9887,11 +10095,11 @@ char *process_remote_cmd(char *cmd, int stringonly) { goto qry; } if (! xdamage_present) { - rfbLog("process_remote_cmd: cannot enable xdamage hints " + rfbLog("remote_cmd: cannot enable xdamage hints " "(not supported on X display)\n"); goto done; } - rfbLog("process_remote_cmd: enabling xdamage hints" + rfbLog("remote_cmd: enabling xdamage hints" " (if supported).\n"); use_xdamage = 1; if (use_xdamage != orig) { @@ -9905,11 +10113,11 @@ char *process_remote_cmd(char *cmd, int stringonly) { goto qry; } if (! xdamage_present) { - rfbLog("process_remote_cmd: disabling xdamage hints " + rfbLog("remote_cmd: disabling xdamage hints " "(but not supported on X display)\n"); goto done; } - rfbLog("process_remote_cmd: disabling xdamage hints.\n"); + rfbLog("remote_cmd: disabling xdamage hints.\n"); use_xdamage = 0; if (use_xdamage != orig) { initialize_xdamage(); @@ -9927,7 +10135,7 @@ char *process_remote_cmd(char *cmd, int stringonly) { p += strlen("xd_area:"); a = atoi(p); if (a >= 0) { - rfbLog("process_remote_cmd: setting xdamage_max_area " + rfbLog("remote_cmd: setting xdamage_max_area " "%d -> %d.\n", xdamage_max_area, a); xdamage_max_area = a; } @@ -9942,7 +10150,7 @@ char *process_remote_cmd(char *cmd, int stringonly) { p += strlen("xd_mem:"); a = atof(p); if (a >= 0.0) { - rfbLog("process_remote_cmd: setting xdamage_memory " + rfbLog("remote_cmd: setting xdamage_memory " "%.3f -> %.3f.\n", xdamage_memory, a); xdamage_memory = a; } @@ -9960,7 +10168,7 @@ char *process_remote_cmd(char *cmd, int stringonly) { if (a < 0) a = 0; if (a > 256) a = 256; /* allow 256 for testing. */ if (alpha_threshold != a) { - rfbLog("process_remote_cmd: setting alphacut " + rfbLog("remote_cmd: setting alphacut " "%d -> %d.\n", alpha_threshold, a); if (a == 256) { rfbLog("note: alphacut=256 leads to completely" @@ -9982,7 +10190,7 @@ char *process_remote_cmd(char *cmd, int stringonly) { if (a < 0.0) a = 0.0; if (a > 1.0) a = 1.0; if (alpha_frac != a) { - rfbLog("process_remote_cmd: setting alphafrac " + rfbLog("remote_cmd: setting alphafrac " "%f -> %f.\n", alpha_frac, a); alpha_frac = a; setup_cursors_and_push(); @@ -9993,7 +10201,7 @@ char *process_remote_cmd(char *cmd, int stringonly) { goto qry; } if (!alpha_remove) { - rfbLog("process_remote_cmd: enable alpharemove\n"); + rfbLog("remote_cmd: enable alpharemove\n"); alpha_remove = 1; setup_cursors_and_push(); } @@ -10003,7 +10211,7 @@ char *process_remote_cmd(char *cmd, int stringonly) { goto qry; } if (alpha_remove) { - rfbLog("process_remote_cmd: disable alpharemove\n"); + rfbLog("remote_cmd: disable alpharemove\n"); alpha_remove = 0; setup_cursors_and_push(); } @@ -10013,7 +10221,7 @@ char *process_remote_cmd(char *cmd, int stringonly) { goto qry; } if (!alpha_blend) { - rfbLog("process_remote_cmd: enable alphablend\n"); + rfbLog("remote_cmd: enable alphablend\n"); alpha_remove = 0; alpha_blend = 1; setup_cursors_and_push(); @@ -10024,7 +10232,7 @@ char *process_remote_cmd(char *cmd, int stringonly) { goto qry; } if (alpha_blend) { - rfbLog("process_remote_cmd: disable alphablend\n"); + rfbLog("remote_cmd: disable alphablend\n"); alpha_blend = 0; setup_cursors_and_push(); } @@ -10034,7 +10242,7 @@ char *process_remote_cmd(char *cmd, int stringonly) { snprintf(buf, bufn, "ans=%s:%d", p, use_xwarppointer); goto qry; } - rfbLog("process_remote_cmd: turning on xwarppointer mode.\n"); + rfbLog("remote_cmd: turning on xwarppointer mode.\n"); use_xwarppointer = 1; } else if (strstr(p, "noxwarp") == p || strstr(p, "noxwarppointer") == p) { @@ -10042,7 +10250,7 @@ char *process_remote_cmd(char *cmd, int stringonly) { snprintf(buf, bufn, "ans=%s:%d", p, !use_xwarppointer); goto qry; } - rfbLog("process_remote_cmd: turning off xwarppointer mode.\n"); + rfbLog("remote_cmd: turning off xwarppointer mode.\n"); use_xwarppointer = 0; } else if (strstr(p, "buttonmap") == p) { @@ -10056,8 +10264,7 @@ char *process_remote_cmd(char *cmd, int stringonly) { if (pointer_remap) free(pointer_remap); pointer_remap = strdup(p); - rfbLog("process_remote_cmd: setting -buttonmap to:\n" - "\t'%s'\n", p); + rfbLog("remote_cmd: setting -buttonmap to:\n\t'%s'\n", p); initialize_pointer_map(p); } else if (!strcmp(p, "dragging")) { @@ -10065,16 +10272,87 @@ char *process_remote_cmd(char *cmd, int stringonly) { snprintf(buf, bufn, "ans=%s:%d", p, show_dragging); goto qry; } - rfbLog("process_remote_cmd: enabling mouse dragging mode.\n"); + rfbLog("remote_cmd: enabling mouse dragging mode.\n"); show_dragging = 1; } else if (!strcmp(p, "nodragging")) { if (query) { snprintf(buf, bufn, "ans=%s:%d", p, !show_dragging); goto qry; } - rfbLog("process_remote_cmd: enabling mouse nodragging mode.\n"); + rfbLog("remote_cmd: enabling mouse nodragging mode.\n"); show_dragging = 0; + } else if (strstr(p, "wireframe_mode") == p) { + COLON_CHECK("wireframe_mode:") + if (query) { + snprintf(buf, bufn, "ans=%s%s%s", p, co, + wireframe_str ? wireframe_str : WIREFRAME_PARMS); + goto qry; + } + p += strlen("wireframe_mode:"); + if (*p) { + if (wireframe_str) { + free(wireframe_str); + } + wireframe_str = strdup(p); + parse_wireframe(); + } + rfbLog("remote_cmd: enabling -wireframe mode.\n"); + wireframe = 1; + } else if (strstr(p, "wireframe:") == p) { /* skip-cmd-list */ + COLON_CHECK("wireframe:") + if (query) { + snprintf(buf, bufn, "ans=%s%s%d", p, co, wireframe); + goto qry; + } + p += strlen("wireframe:"); + if (*p) { + if (wireframe_str) { + free(wireframe_str); + } + wireframe_str = strdup(p); + parse_wireframe(); + } + rfbLog("remote_cmd: enabling -wireframe mode.\n"); + wireframe = 1; + } else if (!strcmp(p, "wireframe")) { + if (query) { + snprintf(buf, bufn, "ans=%s:%d", p, wireframe); + goto qry; + } + rfbLog("remote_cmd: enabling -wireframe mode.\n"); + wireframe = 1; + } else if (!strcmp(p, "nowireframe")) { + if (query) { + snprintf(buf, bufn, "ans=%s:%d", p, !wireframe); + goto qry; + } + rfbLog("remote_cmd: enabling -nowireframe mode.\n"); + wireframe = 0; + + } else if (strstr(p, "wirecopyrect") == p) { + COLON_CHECK("wirecopyrect:") + if (query) { + snprintf(buf, bufn, "ans=%s%s%s", p, co, + NONUL(wireframe_copyrect)); + goto qry; + } + p += strlen("wirecopyrect:"); + + set_wirecopyrect_mode(p); + rfbLog("remote_cmd: changed -wirecopyrect mode " + "to: %s\n", NONUL(wireframe_copyrect)); + } else if (!strcmp(p, "nowirecopyrect")) { + if (query) { + snprintf(buf, bufn, "ans=%s:%s", p, + NONUL(wireframe_copyrect)); + goto qry; + } + + set_wirecopyrect_mode("never"); + rfbLog("remote_cmd: changed -wirecopyrect mode " + "to: %s\n", NONUL(wireframe_copyrect)); + } else if (strstr(p, "pointer_mode") == p) { int pm; COLON_CHECK("pointer_mode:") @@ -10085,11 +10363,10 @@ char *process_remote_cmd(char *cmd, int stringonly) { p += strlen("pointer_mode:"); pm = atoi(p); if (pm < 0 || pm > pointer_mode_max) { - rfbLog("process_remote_cmd: pointer_mode out of range:" + rfbLog("remote_cmd: pointer_mode out of range:" " 1-%d: %d\n", pointer_mode_max, pm); } else { - rfbLog("process_remote_cmd: setting pointer_mode %d\n", - pm); + rfbLog("remote_cmd: setting pointer_mode %d\n", pm); pointer_mode = pm; } } else if (strstr(p, "pm") == p) { @@ -10102,11 +10379,10 @@ char *process_remote_cmd(char *cmd, int stringonly) { p += strlen("pm:"); pm = atoi(p); if (pm < 0 || pm > pointer_mode_max) { - rfbLog("process_remote_cmd: pointer_mode out of range:" + rfbLog("remote_cmd: pointer_mode out of range:" " 1-%d: %d\n", pointer_mode_max, pm); } else { - rfbLog("process_remote_cmd: setting pointer_mode %d\n", - pm); + rfbLog("remote_cmd: setting pointer_mode %d\n", pm); pointer_mode = pm; } @@ -10119,7 +10395,7 @@ char *process_remote_cmd(char *cmd, int stringonly) { } p += strlen("input_skip:"); is = atoi(p); - rfbLog("process_remote_cmd: setting input_skip %d\n", is); + rfbLog("remote_cmd: setting input_skip %d\n", is); ui_skip = is; } else if (strstr(p, "input") == p) { @@ -10134,7 +10410,7 @@ char *process_remote_cmd(char *cmd, int stringonly) { if (allowed_input_str && !strcmp(p, allowed_input_str)) { doit = 0; } - rfbLog("process_remote_cmd: setting input %s\n", p); + rfbLog("remote_cmd: setting input %s\n", p); if (allowed_input_str) free(allowed_input_str); if (*p == '\0') { allowed_input_str = NULL; @@ -10161,8 +10437,7 @@ char *process_remote_cmd(char *cmd, int stringonly) { if (speeds_str) free(speeds_str); speeds_str = strdup(p); - rfbLog("process_remote_cmd: setting -speeds to:\n" - "\t'%s'\n", p); + rfbLog("remote_cmd: setting -speeds to:\n\t'%s'\n", p); initialize_speeds(); } else if (!strcmp(p, "debug_pointer") || !strcmp(p, "dp")) { @@ -10170,14 +10445,14 @@ char *process_remote_cmd(char *cmd, int stringonly) { snprintf(buf, bufn, "ans=%s:%d", p, debug_pointer); goto qry; } - rfbLog("process_remote_cmd: turning on debug_pointer.\n"); + rfbLog("remote_cmd: turning on debug_pointer.\n"); debug_pointer = 1; } else if (!strcmp(p, "nodebug_pointer") || !strcmp(p, "nodp")) { if (query) { snprintf(buf, bufn, "ans=%s:%d", p, !debug_pointer); goto qry; } - rfbLog("process_remote_cmd: turning off debug_pointer.\n"); + rfbLog("remote_cmd: turning off debug_pointer.\n"); debug_pointer = 0; } else if (!strcmp(p, "debug_keyboard") || !strcmp(p, "dk")) { @@ -10185,14 +10460,14 @@ char *process_remote_cmd(char *cmd, int stringonly) { snprintf(buf, bufn, "ans=%s:%d", p, debug_keyboard); goto qry; } - rfbLog("process_remote_cmd: turning on debug_keyboard.\n"); + rfbLog("remote_cmd: turning on debug_keyboard.\n"); debug_keyboard = 1; } else if (!strcmp(p, "nodebug_keyboard") || !strcmp(p, "nodk")) { if (query) { snprintf(buf, bufn, "ans=%s:%d", p, !debug_keyboard); goto qry; } - rfbLog("process_remote_cmd: turning off debug_keyboard.\n"); + rfbLog("remote_cmd: turning off debug_keyboard.\n"); debug_keyboard = 0; } else if (strstr(p, "deferupdate") == p) { @@ -10206,7 +10481,7 @@ char *process_remote_cmd(char *cmd, int stringonly) { p += strlen("deferupdate:"); d = atoi(p); if (d < 0) d = 0; - rfbLog("process_remote_cmd: setting defer to %d ms.\n", d); + rfbLog("remote_cmd: setting defer to %d ms.\n", d); screen->deferUpdateTime = d; } else if (strstr(p, "defer") == p) { @@ -10220,7 +10495,7 @@ char *process_remote_cmd(char *cmd, int stringonly) { p += strlen("defer:"); d = atoi(p); if (d < 0) d = 0; - rfbLog("process_remote_cmd: setting defer to %d ms.\n", d); + rfbLog("remote_cmd: setting defer to %d ms.\n", d); /* XXX not part of API? */ screen->deferUpdateTime = d; @@ -10234,8 +10509,7 @@ char *process_remote_cmd(char *cmd, int stringonly) { p += strlen("wait:"); w = atoi(p); if (w < 0) w = 0; - rfbLog("process_remote_cmd: setting wait %d -> %d ms.\n", - waitms, w); + rfbLog("remote_cmd: setting wait %d -> %d ms.\n", waitms, w); waitms = w; } else if (strstr(p, "rfbwait") == p) { @@ -10249,7 +10523,7 @@ char *process_remote_cmd(char *cmd, int stringonly) { p += strlen("rfbwait:"); w = atoi(p); if (w < 0) w = 0; - rfbLog("process_remote_cmd: setting rfbMaxClientWait %d -> " + rfbLog("remote_cmd: setting rfbMaxClientWait %d -> " "%d ms.\n", orig, w); rfbMaxClientWait = w; if (screen) { @@ -10262,14 +10536,14 @@ char *process_remote_cmd(char *cmd, int stringonly) { snprintf(buf, bufn, "ans=%s:%d", p, take_naps); goto qry; } - rfbLog("process_remote_cmd: turning on nap mode.\n"); + rfbLog("remote_cmd: turning on nap mode.\n"); take_naps = 1; } else if (!strcmp(p, "nonap")) { if (query) { snprintf(buf, bufn, "ans=%s:%d", p, !take_naps); goto qry; } - rfbLog("process_remote_cmd: turning off nap mode.\n"); + rfbLog("remote_cmd: turning off nap mode.\n"); take_naps = 0; } else if (strstr(p, "sb") == p) { @@ -10282,8 +10556,8 @@ char *process_remote_cmd(char *cmd, int stringonly) { p += strlen("sb:"); w = atoi(p); if (w < 0) w = 0; - rfbLog("process_remote_cmd: setting screen_blank %d -> %d" - " sec.\n", screen_blank, w); + rfbLog("remote_cmd: setting screen_blank %d -> %d sec.\n", + screen_blank, w); screen_blank = w; } else if (strstr(p, "screen_blank") == p) { int w; @@ -10295,8 +10569,8 @@ char *process_remote_cmd(char *cmd, int stringonly) { p += strlen("screen_blank:"); w = atoi(p); if (w < 0) w = 0; - rfbLog("process_remote_cmd: setting screen_blank %d -> %d" - " sec.\n", screen_blank, w); + rfbLog("remote_cmd: setting screen_blank %d -> %d sec.\n", + screen_blank, w); screen_blank = w; } else if (strstr(p, "fs") == p) { @@ -10307,7 +10581,7 @@ char *process_remote_cmd(char *cmd, int stringonly) { } p += strlen("fs:"); fs_frac = atof(p); - rfbLog("process_remote_cmd: setting -fs frac to %f\n", fs_frac); + rfbLog("remote_cmd: setting -fs frac to %f\n", fs_frac); } else if (strstr(p, "gaps") == p) { int g; @@ -10319,7 +10593,7 @@ char *process_remote_cmd(char *cmd, int stringonly) { p += strlen("gaps:"); g = atoi(p); if (g < 0) g = 0; - rfbLog("process_remote_cmd: setting gaps_fill %d -> %d.\n", + rfbLog("remote_cmd: setting gaps_fill %d -> %d.\n", gaps_fill, g); gaps_fill = g; } else if (strstr(p, "grow") == p) { @@ -10332,7 +10606,7 @@ char *process_remote_cmd(char *cmd, int stringonly) { p += strlen("grow:"); g = atoi(p); if (g < 0) g = 0; - rfbLog("process_remote_cmd: setting grow_fill %d -> %d.\n", + rfbLog("remote_cmd: setting grow_fill %d -> %d.\n", grow_fill, g); grow_fill = g; } else if (strstr(p, "fuzz") == p) { @@ -10345,7 +10619,7 @@ char *process_remote_cmd(char *cmd, int stringonly) { p += strlen("fuzz:"); f = atoi(p); if (f < 0) f = 0; - rfbLog("process_remote_cmd: setting tile_fuzz %d -> %d.\n", + rfbLog("remote_cmd: setting tile_fuzz %d -> %d.\n", tile_fuzz, f); grow_fill = f; @@ -10355,7 +10629,7 @@ char *process_remote_cmd(char *cmd, int stringonly) { snprintf(buf, bufn, "ans=%s:%d", p, use_snapfb); goto qry; } - rfbLog("process_remote_cmd: turning on snapfb mode.\n"); + rfbLog("remote_cmd: turning on snapfb mode.\n"); use_snapfb = 1; if (orig != use_snapfb) { do_new_fb(1); @@ -10366,7 +10640,7 @@ char *process_remote_cmd(char *cmd, int stringonly) { snprintf(buf, bufn, "ans=%s:%d", p, !use_snapfb); goto qry; } - rfbLog("process_remote_cmd: turning off snapfb mode.\n"); + rfbLog("remote_cmd: turning off snapfb mode.\n"); use_snapfb = 0; if (orig != use_snapfb) { do_new_fb(1); @@ -10382,14 +10656,13 @@ char *process_remote_cmd(char *cmd, int stringonly) { p += strlen("rawfb:"); if (raw_fb_str) free(raw_fb_str); raw_fb_str = strdup(p); - if (safe_remote_only && strstr(p, "setup:") == p) { + if (safe_remote_only && strstr(p, "setup:") == p) { /* skip-cmd-list */ /* n.b. we still allow filename, shm, of rawfb */ fprintf(stderr, "unsafe rawfb setup: %s\n", p); exit(1); } - rfbLog("process_remote_cmd: setting -rawfb to:\n" - "\t'%s'\n", p); + rfbLog("remote_cmd: setting -rawfb to:\n\t'%s'\n", p); if (*raw_fb_str == '\0') { free(raw_fb_str); @@ -10411,7 +10684,7 @@ char *process_remote_cmd(char *cmd, int stringonly) { p += strlen("progressive:"); f = atoi(p); if (f < 0) f = 0; - rfbLog("process_remote_cmd: setting progressive %d -> %d.\n", + rfbLog("remote_cmd: setting progressive %d -> %d.\n", screen->progressiveSliceHeight, f); screen->progressiveSliceHeight = f; @@ -10569,7 +10842,7 @@ char *process_remote_cmd(char *cmd, int stringonly) { } rfb_desktop_name = strdup(p); screen->desktopName = rfb_desktop_name; - rfbLog("process_remote_cmd: setting desktop name to %s\n", + rfbLog("remote_cmd: setting desktop name to %s\n", rfb_desktop_name); } else if (!strcmp(p, "noremote")) { @@ -10578,10 +10851,10 @@ char *process_remote_cmd(char *cmd, int stringonly) { !accept_remote_cmds); goto qry; } - rfbLog("process_remote_cmd: disabling remote commands.\n"); + rfbLog("remote_cmd: disabling remote commands.\n"); accept_remote_cmds = 0; /* cannot be turned back on. */ - } else if (strstr(p, "debug_xevents:") == p) { + } else if (strstr(p, "debug_xevents") == p) { COLON_CHECK("debug_xevents:") if (query) { snprintf(buf, bufn, "ans=%s%s%d", p, co, debug_xevents); @@ -10591,7 +10864,17 @@ char *process_remote_cmd(char *cmd, int stringonly) { debug_xevents = atoi(p); rfbLog("set debug_xevents to: %d\n", debug_xevents); - } else if (strstr(p, "hack:") == p) { /* skip-cmd-list */ + } else if (strstr(p, "debug_xdamage") == p) { + COLON_CHECK("debug_xdamage:") + if (query) { + snprintf(buf, bufn, "ans=%s%s%d", p, co, debug_xdamage); + goto qry; + } + p += strlen("debug_xdamage:"); + debug_xdamage = atoi(p); + rfbLog("set debug_xdamage to: %d\n", debug_xdamage); + + } else if (strstr(p, "hack") == p) { /* skip-cmd-list */ COLON_CHECK("hack:") if (query) { snprintf(buf, bufn, "ans=%s%s%d", p, co, hack_val); @@ -10667,10 +10950,14 @@ char *process_remote_cmd(char *cmd, int stringonly) { scaling_interpolate); } else if (!strcmp(p, "inetd")) { snprintf(buf, bufn, "aro=%s:%d", p, inetd); - } else if (!strcmp(p, "safer")) { - snprintf(buf, bufn, "aro=%s:%d", p, safe_remote_only); + } else if (!strcmp(p, "privremote")) { + snprintf(buf, bufn, "aro=%s:%d", p, priv_remote); } else if (!strcmp(p, "unsafe")) { snprintf(buf, bufn, "aro=%s:%d", p, !safe_remote_only); + } else if (!strcmp(p, "safer")) { + snprintf(buf, bufn, "aro=%s:%d", p, more_safe); + } else if (!strcmp(p, "nocmds")) { + snprintf(buf, bufn, "aro=%s:%d", p, no_external_cmds); } else if (!strcmp(p, "passwdfile")) { snprintf(buf, bufn, "aro=%s:%s", p, NONUL(passwdfile)); } else if (!strcmp(p, "using_shm")) { @@ -10770,7 +11057,7 @@ char *process_remote_cmd(char *cmd, int stringonly) { } else { char tmp[100]; NOTAPP - rfbLog("process_remote_cmd: warning unknown\n"); + rfbLog("remote_cmd: warning unknown\n"); strncpy(tmp, p, 90); rfbLog("command \"%s\"\n", tmp); goto done; @@ -10839,10 +11126,10 @@ void record_desired_xdamage_rect(int x, int y, int w, int h) { dt_x = w / tile_x; dt_y = h / tile_y; - if (!always_accept && dt_y >= 2 && area > 1000) { + if (!always_accept && dt_y >= 3 && area > 2000) { /* - * should be caught by a normal scanline poll, but we might - * as well keep if small. + * if it is real it should be caught by a normal scanline + * poll, but we might as well keep if small (tall line?). */ return; } @@ -10852,6 +11139,7 @@ void record_desired_xdamage_rect(int x, int y, int w, int h) { nt_y1 = nfix( (y)/tile_y, ntiles_y); nt_y2 = nfix((y+h)/tile_y, ntiles_y); + /* loop over the rectangle of tiles (1 tile for a small input rect */ for (ix = nt_x1; ix <= nt_x2; ix++) { for (iy = nt_y1; iy <= nt_y2; iy++) { @@ -10865,6 +11153,11 @@ void record_desired_xdamage_rect(int x, int y, int w, int h) { xdamage_tile_count++; } } + if (debug_xdamage > 1) { + fprintf(stderr, "xdamage: desired: %dx%d+%d+%d\tA: %6d tiles=" + "%02d-%02d/%02d-%02d tilecnt: %d\n", w, h, x, y, + w * h, nt_x1, nt_x2, nt_y1, nt_y2, cnt); + } } void collect_xdamage(int scancnt) { @@ -10973,6 +11266,11 @@ void collect_xdamage(int scancnt) { continue; } } + if (debug_xdamage > 2) { + fprintf(stderr, "xdamage: -> event %dx%d+%d+%d area:" + " %d dups: %d %s\n", w, h, x, y, w*h, dcount, + (w*h > xdamage_max_area) ? "TOO_BIG" : ""); + } record_desired_xdamage_rect(x, y, w, h); @@ -10996,6 +11294,11 @@ void collect_xdamage(int scancnt) { if (XD_tot) { rat = ((double) XD_skip)/XD_tot; } + if (debug_xdamage) { + fprintf(stderr, "xdamage: == scanline skip/tot: " + "%04d/%04d =%.3f rects: %d desired: %d\n", + XD_skip, XD_tot, rat, rect_count, XD_des); + } XD_skip = 0; XD_tot = 0; @@ -11081,6 +11384,9 @@ void initialize_xdamage(void) { } void create_xdamage_if_needed(void) { + + if (raw_fb && ! dpy) return; /* raw_fb hack */ + #if LIBVNCSERVER_HAVE_LIBXDAMAGE if (! xdamage) { X_LOCK; @@ -11093,6 +11399,9 @@ void create_xdamage_if_needed(void) { } void destroy_xdamage_if_needed(void) { + + if (raw_fb && ! dpy) return; /* raw_fb hack */ + #if LIBVNCSERVER_HAVE_LIBXDAMAGE if (xdamage) { XEvent ev; @@ -12422,6 +12731,7 @@ int get_which_cursor(void) { int mode = 0; if (drag_in_progress || button_mask) { + /* XXX not exactly what we want for menus */ return -1; } @@ -12878,7 +13188,7 @@ void check_x11_pointer(void) { int x, y; unsigned int mask; - if (raw_fb) return; /* raw_fb hack */ + if (raw_fb && ! dpy) return; /* raw_fb hack */ X_LOCK; ret = XQueryPointer(dpy, rootwin, &root_w, &child_w, &root_x, &root_y, @@ -13228,32 +13538,34 @@ void set_raw_fb_params(int restore) { if (first) { /* at least save the initial settings... */ vo0 = view_only; - us0 = use_snapfb; - sm0 = using_shm; ws0 = watch_selection; wp0 = watch_primary; wb0 = watch_bell; na0 = no_autorepeat; + sb0 = use_solid_bg; + + us0 = use_snapfb; + sm0 = using_shm; tn0 = take_naps; - mc0 = multiple_cursors_mode; xr0 = xrandr; - sb0 = use_solid_bg; + mc0 = multiple_cursors_mode; first = 0; } if (restore) { view_only = vo0; - use_snapfb = us0; - using_shm = sm0; watch_selection = ws0; watch_primary = wp0; watch_bell = wb0; no_autorepeat = na0; + use_solid_bg = sb0; + + use_snapfb = us0; + using_shm = sm0; take_naps = tn0; - multiple_cursors_mode = mc0; xrandr = xr0; - use_solid_bg = sb0; + multiple_cursors_mode = mc0; if (! dpy && raw_fb_orig_dpy) { dpy = XOpenDisplay(raw_fb_orig_dpy); @@ -13268,9 +13580,44 @@ void set_raw_fb_params(int restore) { return; } - if (! view_only) { - rfbLog("rawfb: setting view_only\n"); - view_only = 1; + rfbLog("set_raw_fb_params: modifying settings for -rawfb mode.\n"); + + if (got_noviewonly) { + /* + * The user input parameters are not unset under + * -noviewonly... this usage should be very rare + * (i.e. rawfb but also send user input to the X + * display, most likely using /dev/fb0 for some reason...) + */ + rfbLog("rawfb: -noviewonly mode: still sending mouse and\n"); + rfbLog("rawfb: keyboard input to the X DISPLAY!!\n"); + } else { + /* Normal case: */ + if (! view_only) { + rfbLog("rawfb: setting view_only\n"); + view_only = 1; + } + if (watch_selection) { + rfbLog("rawfb: turning off watch_selection\n"); + watch_selection = 0; + } + if (watch_primary) { + rfbLog("rawfb: turning off watch_primary\n"); + watch_primary = 0; + } + if (watch_bell) { + rfbLog("rawfb: turning off watch_bell\n"); + watch_bell = 0; + } + if (no_autorepeat) { + rfbLog("rawfb: turning off no_autorepeat\n"); + no_autorepeat = 0; + } + if (use_solid_bg) { + rfbLog("rawfb: turning off use_solid_bg\n"); + use_solid_bg = 0; + } + multiple_cursors_mode = strdup("arrow"); } if (use_snapfb) { rfbLog("rawfb: turning off use_snapfb\n"); @@ -13280,35 +13627,14 @@ void set_raw_fb_params(int restore) { rfbLog("rawfb: turning off using_shm\n"); using_shm = 0; } - if (watch_selection) { - rfbLog("rawfb: turning off watch_selection\n"); - watch_selection = 0; - } - if (watch_primary) { - rfbLog("rawfb: turning off watch_primary\n"); - watch_primary = 0; - } - if (watch_bell) { - rfbLog("rawfb: turning off watch_bell\n"); - watch_bell = 0; - } - if (no_autorepeat) { - rfbLog("rawfb: turning off no_autorepeat\n"); - no_autorepeat = 0; - } if (take_naps) { rfbLog("rawfb: turning off take_naps\n"); take_naps = 0; } - multiple_cursors_mode = strdup("arrow"); if (xrandr) { rfbLog("rawfb: turning off xrandr\n"); xrandr = 0; } - if (use_solid_bg) { - rfbLog("rawfb: turning off use_solid_bg\n"); - use_solid_bg = 0; - } } /* @@ -13477,6 +13803,13 @@ XImage *initialize_raw_fb(void) { set_child_info(); q += strlen("setup:"); + if (no_external_cmds) { + rfbLog("cannot run external commands in -nocmds " + "mode:\n"); + rfbLog(" \"%s\"\n", q); + rfbLog(" exiting.\n"); + clean_up_exit(1); + } rfbLog("running command to setup rawfb: %s\n", q); pipe = popen(q, "r"); if (! pipe) { @@ -13521,6 +13854,14 @@ XImage *initialize_raw_fb(void) { closedpy = 0; } + if (closedpy && !view_only && got_noviewonly) { + rfbLog("not closing X DISPLAY under -noviewonly option.\n"); + closedpy = 0; + if (! window) { + window = rootwin; + } + } + if (! raw_fb_orig_dpy && dpy) { raw_fb_orig_dpy = strdup(DisplayString(dpy)); } @@ -13530,6 +13871,8 @@ XImage *initialize_raw_fb(void) { #if BOLDLY_CLOSE_DISPLAY if (closedpy) { if (dpy) { + rfbLog("closing X DISPLAY: %s in rawfb mode.\n", + DisplayString(dpy)); XCloseDisplay(dpy); /* yow! */ } dpy = 0; @@ -13575,6 +13918,25 @@ XImage *initialize_raw_fb(void) { rfbLog("invalid rawfb str: %s\n", str); clean_up_exit(1); } + *q = '\0'; + + if (strstr(str, "shm:") != str && strstr(str, "mmap:") != str && + strstr(str, "map:") != str && strstr(str, "file:") != str) { + /* hmmm, not following directions, see if map: applies */ + struct stat sbuf; + if (stat(str, &sbuf) == 0) { + char *new; + int len = strlen("map:") + strlen(str) + 1; + rfbLog("no type prefix: %s\n", raw_fb_str); + rfbLog(" but file exists, so assuming: map:%s\n", + raw_fb_str); + new = (char *)malloc(len); + strcpy(new, "map:"); + strcat(new, str); + free(str); + str = new; + } + } dpy_x = wdpy_x = w; dpy_y = wdpy_y = h; @@ -13587,7 +13949,6 @@ XImage *initialize_raw_fb(void) { raw_fb_fd = -1; raw_fb_addr = NULL; - *q = '\0'; if (sscanf(str, "shm:%d", &shmid) == 1) { /* shm:N */ raw_fb_addr = (char *) shmat(shmid, 0, SHM_RDONLY); @@ -13625,7 +13986,7 @@ XImage *initialize_raw_fb(void) { if (S_ISREG(sbuf.st_mode)) { if (0) size = sbuf.st_size; } else { - rfbLog("non-regular file: %s\n", q); + rfbLog("raw fb is non-regular file: %s\n", q); } } @@ -13790,7 +14151,7 @@ XImage *initialize_xdisplay_fb(void) { if (subwin_wait_mapped) { wait_until_mapped(subwin); } - if (!valid_window((Window) subwin)) { + if (!valid_window((Window) subwin, NULL)) { rfbLog("invalid sub-window: 0x%lx\n", subwin); X_UNLOCK; clean_up_exit(1); @@ -14198,6 +14559,7 @@ void initialize_screen(int *argc, char **argv, XImage *fb) { main_bytes_per_line = fb->bytes_per_line; setup_scaling(&width, &height); + if (scaling) { rfbLog("scaling screen: %dx%d -> %dx%d scale_fac=%.5f\n", @@ -14452,7 +14814,6 @@ void initialize_screen(int *argc, char **argv, XImage *fb) { rfbLog("\n"); } #endif - /* nofb is for pointer/keyboard only handling. */ if (nofb) { main_fb = NULL; @@ -14477,6 +14838,9 @@ void initialize_screen(int *argc, char **argv, XImage *fb) { bpp = screen->serverFormat.bitsPerPixel; depth = screen->serverFormat.depth; + /* may need, bpp, main_red_max, etc. */ + parse_wireframe(); + setup_cursors_and_push(); if (scaling) { @@ -14597,6 +14961,13 @@ int dt_cmd(char *cmd) { return 0; } + if (no_external_cmds) { + rfbLog("cannot run external commands in -nocmds mode:\n"); + rfbLog(" \"%s\"\n", cmd); + rfbLog(" dt_cmd: returning 1\n"); + return 1; + } + rfbLog("running command:\n %s\n", cmd); usr_bin_path(0); rc = system(cmd); @@ -14618,6 +14989,13 @@ char *cmd_output(char *cmd) { return ""; } + if (no_external_cmds) { + rfbLog("cannot run external commands in -nocmds mode:\n"); + rfbLog(" \"%s\"\n", cmd); + rfbLog(" cmd_output: null string.\n"); + return ""; + } + rfbLog("running pipe:\n %s\n", cmd); usr_bin_path(0); p = popen(cmd, "r"); @@ -14786,7 +15164,7 @@ void solid_cde(char *color) { if (! twin) { twin = rootwin; } - if (! valid_window(twin)) { + if (! valid_window(twin, NULL)) { continue; } @@ -15123,6 +15501,10 @@ void solid_kde(char *color) { char *guess_desktop() { Atom prop; + prop = XInternAtom(dpy, "XFCE_DESKTOP_WINDOW", True); + if (prop != None) { + return "xfce"; + } prop = XInternAtom(dpy, "_QT_DESKTOP_PROPERTIES", True); if (prop != None) { return "kde"; @@ -15448,6 +15830,8 @@ void initialize_xinerama (void) { char *bstr, *tstr; int ev, er, i, n, rcnt; + if (raw_fb && ! dpy) return; /* raw_fb hack */ + if (! XineramaQueryExtension(dpy, &ev, &er)) { rfbLog("Xinerama: disabling: display does not support it.\n"); xinerama = 0; @@ -15875,7 +16259,7 @@ void shm_clean(XShmSegmentInfo *shm, XImage *xim) { X_LOCK; #if LIBVNCSERVER_HAVE_XSHM - if (shm != NULL && shm->shmid != -1 && dpy) { + if (shm != NULL && shm->shmid != -1 && dpy) { /* raw_fb hack */ XShmDetach_wr(dpy, shm); } #endif @@ -18217,6 +18601,15 @@ void run_gui(char *gui_xdisplay, int connect_to_x11vnc, int simple_gui, set_env("X11VNC_SIMPLE_GUI", "1"); } + if (no_external_cmds) { + fprintf(stderr, "cannot run external commands in -nocmds " + "mode:\n"); + fprintf(stderr, " \"%s\"\n", "gui + wish"); + fprintf(stderr, " exiting.\n"); + fflush(stderr); + exit(1); + } + sprintf(cmd, "%s -", wish); tmpf = tmpfile(); if (tmpf == NULL) { @@ -18357,12 +18750,1141 @@ void do_gui(char *opts) { } } -/* -- x11vnc.c -- */ +/* -- userinput.c -- */ /* - * main routine for the x11vnc program + * user input handling heuristics + */ + +/* + * For -wireframe: find the direct child of rootwin that has the + * pointer, assume that is the WM frame that contains the application + * (i.e. wm reparents the app toplevel) return frame position and size + * if successful. */ +int get_wm_frame_pos(int *px, int *py, int *x, int *y, int *w, int *h, Window *win) { + Window r, c; + XWindowAttributes attr; + Bool ret; + int rootx, rooty, wx, wy; + unsigned int mask; + + ret = XQueryPointer(dpy, rootwin, &r, &c, &rootx, &rooty, &wx, &wy, &mask); + + *win = c; + + /* current pointer position is returned too */ + *px = rootx; + *py = rooty; + + if (!ret || ! c || c == rootwin) { + /* no immediate child */ + return 0; + } + + /* child window position and size */ + if (! valid_window(c, &attr)) { + return 0; + } +#if 0 + XTranslateCoordinates(dpy, c, rootwin, 0, 0, &rootx, &rooty, &c2); + *x = rootx; + *y = rooty; +#endif + *x = attr.x; + *y = attr.y; + *w = attr.width; + *h = attr.height; + + return 1; +} + static int defer_update_nofb = 6; /* defer a shorter time under -nofb */ +static Window maybe_scrolling = 0; + +/* +WIREFRAME_PARMS "0xff,2,0,30+6+6+6,0.05+0.3+2.0,8" +shade,linewidth,percent,T+B+L+R,t1+t2+t3 + */ +#define LW_MAX 8 +unsigned long wireframe_shade; +int wireframe_lw; +double wireframe_frac; +int wireframe_top, wireframe_bot, wireframe_left, wireframe_right; +double wireframe_t1, wireframe_t2, wireframe_t3, wireframe_t4; + +/* + * Parse the gory -wireframe string for parameters. + */ +void parse_wireframe_str(char *wf) { + char *p, *str; + int i; + char *part[10]; + + for (i=0; i<10; i++) { + part[i] = NULL; + } + + if (wf == NULL || *wf == '\0') { + return; + } + + str = strdup(wf); + + /* leading ",", make it start with ignorable string "z" */ + if (*str == ',') { + char *tmp = (char *) malloc(strlen(str)+2); + strcpy(tmp, "z"); + strcat(tmp, str); + free(str); + str = tmp; + } + + p = strtok(str, ","); + i = 0; + while (p) { + part[i++] = strdup(p); + p = strtok(NULL, ","); + } + free(str); + + + /* Wireframe shade, color, RGB: */ + if ((str = part[0]) != NULL) { + unsigned long n; + int r, g, b, ok = 0; + XColor cdef; + Colormap cmap; + if (dpy && (bpp == 32 || bpp == 16)) { + cmap = DefaultColormap (dpy, scr); + if (XParseColor(dpy, cmap, str, &cdef) && + XAllocColor(dpy, cmap, &cdef)) { + r = cdef.red >> 8; + g = cdef.green >> 8; + b = cdef.blue >> 8; + if (r == 0 && g == 0) { + g = 1; /* need to be > 255 */ + } + n = 0; + n |= (r << main_red_shift); + n |= (g << main_green_shift); + n |= (b << main_blue_shift); + wireframe_shade = n; + ok = 1; + } + } + if (ok) { + ; + } else if (sscanf(str, "0x%lx", &n) == 1) { + wireframe_shade = n; + } else if (sscanf(str, "%ld", &n) == 1) { + wireframe_shade = n; + } else if (sscanf(str, "%lx", &n) == 1) { + wireframe_shade = n; + } + free(str); + } + + /* linewidth: # of pixels wide for the wireframe lines */ + if ((str = part[1]) != NULL) { + int n; + if (sscanf(str, "%d", &n) == 1) { + wireframe_lw = n; + if (wireframe_lw < 1) { + wireframe_lw = 1; + } + if (wireframe_lw > LW_MAX) { + wireframe_lw = LW_MAX; + } + } + free(str); + } + + /* percentage cutoff for opaque move/resize (like WM's) */ + if ((str = part[2]) != NULL) { + if (*str == '\0') { + ; + } else if (strchr(str, '.')) { + wireframe_frac = atof(str); + } else { + wireframe_frac = ((double) atoi(str))/100.0; + } + free(str); + } + + /* + * Top, Bottom, Left, Right tolerances to guess the wm frame is + * being grabbed (Top is traditionally bigger, i.e. titlebar): + */ + if ((str = part[3]) != NULL) { + int t, b, l, r; + if (sscanf(str, "%d+%d+%d+%d", &t, &b, &l, &r) == 4) { + wireframe_top = t; + wireframe_bot = b; + wireframe_left = l; + wireframe_right = r; + } + free(str); + } + + /* check_wireframe() timing heuristics. */ + if ((str = part[4]) != NULL) { + double t1, t2, t3, t4; + if (sscanf(str, "%lf+%lf+%lf+%lf", &t1, &t2, &t3, &t4) == 4) { + wireframe_t1 = t1; + wireframe_t2 = t2; + wireframe_t3 = t3; + wireframe_t4 = t4; + } + free(str); + } +} + +/* + * First parse the defaults and apply any user supplied ones (may be a subset) + */ +void parse_wireframe(void) { + parse_wireframe_str(WIREFRAME_PARMS); + if (! wireframe_str) { + wireframe_str = strdup(WIREFRAME_PARMS); + } + parse_wireframe_str(wireframe_str); +} + +/* + * Set wireframe_copyrect based on desired mode. + */ +void set_wirecopyrect_mode(char *str) { + char *orig = wireframe_copyrect; + if (str == NULL || *str == '\0') { + wireframe_copyrect = strdup(wireframe_copyrect_default); + } else if (!strcmp(str, "always") || !strcmp(str, "all")) { + wireframe_copyrect = strdup("always"); + } else if (!strcmp(str, "top")) { + wireframe_copyrect = strdup("top"); + } else if (!strcmp(str, "never") || !strcmp(str, "none")) { + wireframe_copyrect = strdup("never"); + } else { + if (! wireframe_copyrect) { + wireframe_copyrect = strdup(wireframe_copyrect_default); + } + rfbLog("unknown -wirecopyrect mode: %s, using: %s\n", str, + wireframe_copyrect); + } + if (orig) { + free(orig); + } +} + +typedef struct saveline { + int x0, y0, x1, y1; + int shift; + int vert; + int saved; + char *data; +} saveline_t; + +/* + * Draw the wireframe box onto the framebuffer. Saves the real + * framebuffer data to some storage lines. Restores previous lines. + * use restore = 1 to clean up (done with animation). + * This works with -scale. + */ +void draw_box(int x, int y, int w, int h, int restore) { + int x0, y0, x1, y1, i, pixelsize = bpp/8; + char *dst, *src; + static saveline_t *save[4]; + static int first = 1, len = 0; + int max = dpy_x > dpy_y ? dpy_x : dpy_y; + int sz, lw = wireframe_lw; + unsigned long shade = wireframe_shade; + int color = 0; + unsigned short us; + unsigned long ul; + + if (max > len) { + /* create/resize storage lines: */ + for (i=0; i<4; i++) { + len = max; + if (! first && save[i]) { + if (save[i]->data) { + free(save[i]->data); + } + free(save[i]); + } + save[i] = (saveline_t *) malloc(sizeof(saveline_t)); + save[i]->saved = 0; + sz = (LW_MAX+1)*len*pixelsize; + save[i]->data = (char *)malloc(sz); + + /* + * Four types of lines: + * 0) top horizontal + * 1) bottom horizontal + * 2) left vertical + * 3) right vertical + * + * shift means shifted by width or height. + */ + if (i == 0) { + save[i]->vert = 0; + save[i]->shift = 0; + } else if (i == 1) { + save[i]->vert = 0; + save[i]->shift = 1; + } else if (i == 2) { + save[i]->vert = 1; + save[i]->shift = 0; + } else if (i == 3) { + save[i]->vert = 1; + save[i]->shift = 1; + } + } + } + first = 0; + + /* + * restore any saved lines. see below for algorithm and + * how x0, etc. are used. we just reverse those steps. + */ + for (i=0; i<4; i++) { + int s = save[i]->shift; + int yu, y_min = -1, y_max = -1; + int y_start, y_stop, y_step; + + if (! save[i]->saved) { + continue; + } + x0 = save[i]->x0; + y0 = save[i]->y0; + x1 = save[i]->x1; + y1 = save[i]->y1; + if (save[i]->vert) { + y_start = y0+lw; + y_stop = y1-lw; + y_step = lw*pixelsize; + } else { + y_start = y0 - s*lw; + y_stop = y_start + lw; + y_step = max*pixelsize; + } + for (yu = y_start; yu < y_stop; yu++) { + if (x0 == x1) { + continue; + } + if (yu < 0 || yu >= dpy_y) { + continue; + } + if (y_min < 0 || yu < y_min) { + y_min = yu; + } + if (y_max < 0 || yu > y_max) { + y_max = yu; + } + src = save[i]->data + (yu-y_start)*y_step; + dst = main_fb + yu*main_bytes_per_line + + x0*pixelsize; + memcpy(dst, src, (x1-x0)*pixelsize); + } + if (y_min >= 0) { + mark_rect_as_modified(x0, y_min, x1, y_max+1, 0); + } + save[i]->saved = 0; + } + + if (restore) { + return; + } + +if (0) fprintf(stderr, " DrawBox: %dx%d+%d+%d\n", w, h, x, y); + + /* + * work out shade/color for the wireframe line, could be a color + * for 16bpp or 24bpp. + */ + if (shade > 255) { + if (pixelsize == 2) { + us = (unsigned short) (shade & 0xffff); + color = 1; + } else if (pixelsize == 4) { + ul = (unsigned long) shade; + color = 1; + } else { + shade = shade % 256; + } + } + + for (i=0; i<4; i++) { + int s = save[i]->shift; + int yu, y_min = -1, y_max = -1; + int yblack = -1, xblack1 = -1, xblack2 = -1; + int y_start, y_stop, y_step; + + if (save[i]->vert) { + /* + * make the narrow x's be on the screen, let + * the y's hang off (not drawn). + */ + save[i]->x0 = x0 = nfix(x + s*w - s*lw, dpy_x); + save[i]->y0 = y0 = y; + save[i]->x1 = x1 = nfix(x + s*w - s*lw + lw, dpy_x); + save[i]->y1 = y1 = y + h; + + /* + * start and stop a linewidth away from true edge, + * to avoid interfering with horizontal lines. + */ + y_start = y0+lw; + y_stop = y1-lw; + y_step = lw*pixelsize; + + /* draw a black pixel for the border if lw > 1 */ + if (s) { + xblack1 = x1-1; + } else { + xblack1 = x0; + } + } else { + /* + * make the wide x's be on the screen, let the y's + * hang off (not drawn). + */ + save[i]->x0 = x0 = nfix(x, dpy_x); + save[i]->y0 = y0 = y + s*h; + save[i]->x1 = x1 = nfix(x + w, dpy_x); + save[i]->y1 = y1 = y0 + lw; + y_start = y0 - s*lw; + y_stop = y_start + lw; + y_step = max*pixelsize; + + /* draw a black pixels for the border if lw > 1 */ + if (s) { + yblack = y_stop - 1; + } else { + yblack = y_start; + } + xblack1 = x0; + xblack2 = x1-1; + } + + /* now loop over the allowed y's for either case */ + for (yu = y_start; yu < y_stop; yu++) { + if (x0 == x1) { + continue; + } + if (yu < 0 || yu >= dpy_y) { + continue; + } + + /* record min and max y's for marking rectangle: */ + if (y_min < 0 || yu < y_min) { + y_min = yu; + } + if (y_max < 0 || yu > y_max) { + y_max = yu; + } + + /* save fb data for this line: */ + save[i]->saved = 1; + src = main_fb + yu*main_bytes_per_line + + x0*pixelsize; + dst = save[i]->data + (yu-y_start)*y_step; + memcpy(dst, src, (x1-x0)*pixelsize); + + /* apply the shade/color to make the wireframe line: */ + if (! color) { + memset(src, shade, (x1-x0)*pixelsize); + } else { + char *csrc = src; + unsigned short *usp; + unsigned long *ulp; + int k; + for (k=0; k < x1 - x0; k++) { + if (pixelsize == 4) { + ulp = (unsigned long *)csrc; + *ulp = ul; + } else if (pixelsize == 2) { + usp = (unsigned short *)csrc; + *usp = us; + } + csrc += pixelsize; + } + } + + /* apply black border for lw >= 2 */ + if (lw > 1) { + if (yu == yblack) { + memset(src, 0, (x1-x0)*pixelsize); + } + if (xblack1 >= 0) { + src = src + (xblack1 - x0)*pixelsize; + memset(src, 0, pixelsize); + } + if (xblack2 >= 0) { + src = src + (xblack2 - x0)*pixelsize; + memset(src, 0, pixelsize); + } + } + } + /* mark it for sending: */ + if (save[i]->saved) { + mark_rect_as_modified(x0, y_min, x1, y_max+1, 0); + } + } +} + +/* + * utility routine for CopyRect of the window (but not CopyRegion) + */ +int crfix(int x, int dx, int Lx) { + /* adjust x so that copy source is on screen */ + if (dx > 0) { + if (x-dx < 0) { + /* off on the left */ + x = dx; + } + } else { + if (x-dx >= Lx) { + /* off on the right */ + x = Lx + dx - 1; + } + } + return x; +} + +/* + * Applied just before any check_user_input() modes. Look for a + * ButtonPress; find window it happened in; find the wm frame window + * for it; watch for that window moving or resizing. If it does, do the + * wireframe animation. Do this until ButtonRelease or timeouts occur. + * Remove wireframe. + * + * Under -nowirecopyrect, return control to base scheme + * (check_user_input() ...) that will repaint the screen with the window + * in the new postion or size. Under -wirecopyrect, apply rfbDoCopyRect + * or rfbDoCopyRegion: this "pollutes" our framebuffer, but the normal + * polling will quickly repair it. Under happy circumstances, this + * reduces actual XShmGetImage work (i.e. if we correctly predicted how + * the X fb has changed. + * + * -scale doesn't work under -wirecopyrect, but the wireframe does. + * + * testing of this mode under -threads is incomplete. + * + * returns 1 if it did an animation, 0 if no move/resize triggers + * went off. + * + * TBD: see if we can select StructureNotify ConfigureNotify events for + * the toplevel windows to get better info on moves and resizes. + */ +int check_wireframe(void) { + Window frame, orig_frame; + XWindowAttributes attr; + int dx, dy; + + int orig_px, orig_py, orig_x, orig_y, orig_w, orig_h; + int px, py, x, y, w, h; + int box_x, box_y, box_w, box_h; + int orig_cursor_x, orig_cursor_y, g, g_in; + int already_down = 0, win_gone = 0, win_unmapped = 0; + double spin = 0.0, tm = 0.0, last_ptr, last_draw; + int frame_changed = 0, drew_box = 0, got_2nd_pointer = 0; + int break_reason = 0; + static double first_dt_ave = 0.0; + static int first_dt_cnt = 0; + static time_t last_save_stacklist = 0; + + /* heuristics: */ + int wf_t = wireframe_top; + int wf_b = wireframe_bot; + int wf_l = wireframe_left; + int wf_r = wireframe_right; + double first_event_spin = wireframe_t1; + double frame_changed_spin = wireframe_t2; + double max_spin = wireframe_t3; + double min_draw = wireframe_t4; + + int db = 0; + int db2 = 0; + + if (subwin) { + return 0; /* don't even bother for -id case */ + } + if (! button_mask) { + return 0; /* no button pressed down */ + } + if (!use_threads && !got_pointer_input) { + return 0; /* need ptr input, e.g. button down, motion */ + } + +if (db || db2) fprintf(stderr, "\n*** button down!! x: %d y: %d\n", cursor_x, cursor_y); + + /* + * Query where the pointer is and which child of the root + * window. We will assume this is the frame the window manager + * makes when it reparents the toplevel window. + */ + X_LOCK; + if (! get_wm_frame_pos(&px, &py, &x, &y, &w, &h, &frame)) { +if (db) fprintf(stderr, "NO get_wm_frame_pos: 0x%lx\n", frame); + X_UNLOCK; + return 0; + } + X_UNLOCK; +if (db) fprintf(stderr, "a: %d wf: %.3f A: %d\n", w*h, wireframe_frac, (dpy_x*dpy_y)); + + if (nabs(x + w - px) < 35) { + maybe_scrolling = frame; /* not yet used... */ + } + + /* + * apply the percentage size criterion (allow opaque moves for + * small windows) + */ + if ((double) w*h < wireframe_frac * (dpy_x * dpy_y)) { +if (db) fprintf(stderr, "small window %.3f\n", ((double) w*h)/(dpy_x * dpy_y)); + return 0; + } +if (db) fprintf(stderr, " frame: x: %d y: %d w: %d h: %d px: %d py: %d fr: 0x%lx\n", x, y, w, h, px, py, orig_frame); + + /* + * see if the pointer is within range of the assumed wm frame + * decorations on the edge of the window. + */ + if (wf_t || wf_b || wf_l || wf_r) { + int near_edge = 0; + if (nabs(y - py) < wf_t) { + near_edge = 1; + } + if (nabs(y + h - py) < wf_b) { + near_edge = 1; + } + if (nabs(x - px) < wf_l) { + near_edge = 1; + } + if (nabs(x + w - px) < wf_r) { + near_edge = 1; + } + if (! near_edge) { +if (db) fprintf(stderr, "INTERIOR %d %d %d %d\n", wf_t, wf_b, wf_l, wf_r); + return 0; + } + } + + wireframe_in_progress = 1; + + if (button_mask_prev) { + already_down = 1; + } + + /* + * pointer() should have snapped the stacking list for us, if + * not, do it now (if the XFakeButtonEvent has been flushed by + * now the stacking order may be incorrect). + */ + if (strcmp(wireframe_copyrect, "never")) { + if (already_down) { + /* + * see if we can reuse the stack list (pause + * with button down) + */ + if (stack_list) { + int k, got_me = 0; + for (k = stack_num -1; k >=0; k--) { + if (frame == stack_list[k]) { + got_me = 1; + break; + } + } + if (! got_me) { + last_save_stacklist = 0; + } + } + if (stack_list && time(0) > last_save_stacklist + 1) { + /* stack_list too old */ + X_LOCK; + XFree(stack_list); + stack_list = NULL; + stack_num = 0; + X_UNLOCK; + } + } else if (! stack_list) { + /* ! already_down, might as well get a copy */ + X_LOCK; + snapshot_stack_list(); + X_UNLOCK; + } + } + + /* store initial parameters, we look for changes in them */ + orig_frame = frame; + orig_px = px; /* pointer position */ + orig_py = py; + orig_x = x; /* frame position */ + orig_y = y; + orig_w = w; /* frame size */ + orig_h = h; + + orig_cursor_x = cursor_x; + orig_cursor_y = cursor_y; + + /* this is the box frame we would draw */ + box_x = x; + box_y = y; + box_w = w; + box_h = h; + + dtime(&tm); + + last_draw = spin; + + /* -threads support for check_wireframe() is rough... crash? */ + if (use_threads) { + /* purge any stored up pointer events: */ + pointer(-1, 0, 0, NULL); + } + + g = g_in = got_pointer_input; + + while (1) { + + X_LOCK; + XFlush(dpy); + X_UNLOCK; + + /* try do induce/waitfor some more user input */ + if (use_threads) { + usleep(1000); + } else if (drew_box) { + rfbPE(screen, 1000); + } else { + rfbCFD(screen, 1000); + } + + spin += dtime(&tm); + + /* check for any timeouts: */ + if (frame_changed) { + /* max time we play this game: */ + if (spin > max_spin) { +if (db || db2) fprintf(stderr, " SPIN-OUT-MAX: %.3f\n", spin); + break_reason = 1; + break; + } + /* pointer events slowing down: */ + if (spin > last_ptr + frame_changed_spin) { +if (db || db2) fprintf(stderr, " SPIN-OUT-NOT-FAST: %.3f\n", spin); + break_reason = 2; + break; + } + } else if(got_2nd_pointer) { + /* + * pointer is moving, max time we wait for wm + * move or resize to be detected + */ + if (spin > frame_changed_spin) { +if (db || db2) fprintf(stderr, " SPIN-OUT-NOFRAME-SPIN: %.3f\n", spin); + break_reason = 3; + break; + } + } else { + /* max time we wait for any pointer input */ + if (spin > first_event_spin) { +if (db || db2) fprintf(stderr, " SPIN-OUT-NO2ND_PTR: %.3f\n", spin); + break_reason = 4; + break; + } + } + + /* see if some pointer input occurred: */ + if (got_pointer_input > g) { +if (db) fprintf(stderr, " ++pointer event!! [%02d] dt: %.3f x: %d y: %d mask: %d\n", got_2nd_pointer+1, spin, cursor_x, cursor_y, button_mask); + + g = got_pointer_input; + + /* periodically try to let the wm get moving: */ + if (!frame_changed && got_2nd_pointer % 4 == 0) { +#if 0 + X_LOCK; + XSync(dpy, False); + X_UNLOCK; +#endif + if (got_2nd_pointer == 0) { + usleep(50 * 1000); + } else { + usleep(25 * 1000); + } + } + got_2nd_pointer++; + last_ptr = spin; + + /* + * see where the pointer currently is. It may + * not be our starting frame (i.e. mouse now + * outside of the moving window). + */ + frame = 0x0; + X_LOCK; + + if (! get_wm_frame_pos(&px, &py, &x, &y, &w, &h, + &frame)) { + frame = 0x0; +if (db) fprintf(stderr, "NO get_wm_frame_pos: 0x%lx\n", frame); + } + + if (frame != orig_frame) { + /* see if our original frame is still there */ + if (!valid_window(orig_frame, &attr)) { + X_UNLOCK; + /* our window frame went away! */ + win_gone = 1; +if (db) fprintf(stderr, "FRAME-GONE: 0x%lx\n", orig_frame); + break_reason = 5; + break; + } + if (attr.map_state == IsUnmapped) { + X_UNLOCK; + /* our window frame is now unmapped! */ + win_unmapped = 1; +if (db) fprintf(stderr, "FRAME-UNMAPPED: 0x%lx\n", orig_frame); + break_reason = 5; + break; + } + +if (db) fprintf(stderr, "OUT-OF-FRAME: old: x: %d y: %d px: %d py: %d 0x%lx\n", x, y, px, py, frame); + + /* new parameters for our frame */ + x = attr.x; /* n.b. rootwin is parent */ + y = attr.y; + w = attr.width; + h = attr.height; + } + X_UNLOCK; + + /* debugging output, to be removed: */ +if (db) fprintf(stderr, " frame: x: %d y: %d w: %d h: %d px: %d py: %d fr: 0x%lx\n", x, y, w, h, px, py, frame); +if (db) fprintf(stderr, " MO,PT,FR: %d/%d %d/%d %d/%d\n", cursor_x - orig_cursor_x, cursor_y - orig_cursor_y, px - orig_px, py - orig_py, x - orig_x, y - orig_y); + + if (frame_changed && frame != orig_frame) { +if (db) fprintf(stderr, "CHANGED and window switch: 0x%lx\n", frame); + } + if (frame_changed && px - orig_px != x - orig_x) { +if (db) fprintf(stderr, "MOVED and diff DX\n"); + } + if (frame_changed && py - orig_py != y - orig_y) { +if (db) fprintf(stderr, "MOVED and diff DY\n"); + } + + /* check and see if our frame has been resized: */ + if (!frame_changed && (w != orig_w || h != orig_h)) { + int n; + if (!already_down) { + first_dt_ave += spin; + first_dt_cnt++; + } + n = first_dt_cnt ? first_dt_cnt : 1; + frame_changed = 2; + +if (db) fprintf(stderr, "WIN RESIZE 1st-dt: %.3f\n", first_dt_ave/n); + } + + /* check and see if our frame has been moved: */ + if (!frame_changed && (x != orig_x || y != orig_y)) { + int n; + if (!already_down) { + first_dt_ave += spin; + first_dt_cnt++; + } + n = first_dt_cnt ? first_dt_cnt : 1; + frame_changed = 1; +if (db) fprintf(stderr, "FRAME MOVE 1st-dt: %.3f\n", first_dt_ave/n); + } + + /* + * see if it is time to draw any or a new wireframe box + */ + if (frame_changed) { + int drawit = 0; + if (x != box_x || y != box_y) { + /* moved since last */ + drawit = 1; + } else if (w != box_w || h != box_h) { + /* resize since last */ + drawit = 1; + } + if (drawit) { + /* + * check time (to avoid too much + * animations on slow machines + * or links). + */ + if (spin > last_draw + min_draw || + ! drew_box) { + draw_box(x, y, w, h, 0); + drew_box = 1; + rfbPE(screen, 1000); + last_draw = spin; + } + } + box_x = x; + box_y = y; + box_w = w; + box_h = h; + } + } + + /* + * Now (not earlier) check if the button has come back up. + * we check here to get a better location and size of + * the final window. + */ + if (! button_mask) { +if (db || db2) fprintf(stderr, "NO button_mask\n"); + break_reason = 6; + break; + } + } + + if (! drew_box) { + /* nice try, but no move or resize detected. cleanup. */ + if (stack_list) { + X_LOCK; + XFree(stack_list); + X_UNLOCK; + stack_list = NULL; + stack_num = 0; + } + wireframe_in_progress = 0; + return 0; + } + + /* remove the wireframe */ + draw_box(0, 0, 0, 0, 1); + + dx = x - orig_x; + dy = y - orig_y; + + /* + * see if we can apply CopyRect or CopyRegion to the change: + */ + if (!scaling && w == orig_w && h == orig_h && (dx != 0 || dy != 0) && + !win_gone && !win_unmapped && strcmp(wireframe_copyrect, "never")) { + + int x1, y1, x2, y2, t, tmax = 50; + int spin_ms = (int) (spin * 1000 * 1000); + int sent_copyrect = 0; + int obscured = 0; + static int dt_bad = 0; + static time_t dt_bad_check = 0; + + /* + * set a timescale comparable to the spin time, + * but not too short or too long. + */ + if (spin_ms < 30) { + spin_ms = 30; + } else if (spin_ms > 400) { + spin_ms = 400; + } + + /* try to flush the wireframe removal: */ + fb_update_sent(NULL); + rfbPE(screen, spin_ms/3); /* long select */ + for (t=0; t<tmax; t++) { + if (fb_update_sent(NULL)) { +if (db2) fprintf(stderr, "A-FB_UPDATE_SENT: t=%d\n", t); + break; + } + rfbPE(screen, 1000); /* short selects. */ + } + + /* + * XXX KDE and xfce do some weird things with the + * stacking, it does not match XQueryTree. Work around + * it for now by CopyRect-ing the *whole* on-screen + * rectangle (whether obscured or not!) + */ + if (time(0) > dt_bad_check + 5) { + if (!strcmp(guess_desktop(), "kde")) { + dt_bad = 1; + } else if (!strcmp(guess_desktop(), "xfce")) { + dt_bad = 1; + } else { + dt_bad = 0; + } + dt_bad_check = time(0); + } + + if (dt_bad) { + /* send the whole thing... */ + x1 = crfix(nfix(x, dpy_x), dx, dpy_x); + y1 = crfix(nfix(y, dpy_y), dy, dpy_y); + x2 = crfix(nfix(x+w, dpy_x), dx, dpy_x); + y2 = crfix(nfix(y+h, dpy_y), dy, dpy_y); + + rfbDoCopyRect(screen, x1, y1, x2, y2, dx, dy); + + sent_copyrect = 1; + obscured = 1; /* set to avoid an aggressive push */ + +if (db2) fprintf(stderr, "CopyRect: x1: %d y1: %d x2: %d y2: %d dx: %d dy: %d spin: %.3f\n", x1, y1, x2, y2, dx, dy, spin); + + } else if (stack_list) { + int k, tx1, tx2, ty1, ty2; + sraRegionPtr moved_win, tmp_win; + int saw_me = 0; + + tx1 = nfix(orig_x, dpy_x); + ty1 = nfix(orig_y, dpy_y); + tx2 = nfix(orig_x+w, dpy_x); + ty2 = nfix(orig_y+h, dpy_y); + +if (db2) fprintf(stderr, "moved_win: %4d %3d, %4d %3d 0x%lx ---\n", tx1, ty1, tx2, ty2, frame); + + moved_win = sraRgnCreateRect(tx1, ty1, tx2, ty2); + + X_LOCK; + + /* + * loop over the stack, top to bottom until we + * find our wm frame: + */ + for (k = stack_num - 1; k >= 0; k--) { + Window win = stack_list[k]; + if (win == frame) { +if (db2) { + saw_me = 1; + fprintf(stderr, " ----------\n"); +} else { + break; +} + } + + /* skip some unwanted cases: */ + if (win == None) { + continue; + } + if (!valid_window(win, &attr)) { + continue; + } + if (attr.map_state != IsViewable) { + continue; + } + + /* clip the window to the visable screen: */ + tx1 = nfix(attr.x, dpy_x); + ty1 = nfix(attr.y, dpy_y); + tx2 = nfix(attr.x + attr.width, dpy_x); + ty2 = nfix(attr.y + attr.height, dpy_y); + +if (db2) fprintf(stderr, " tmp_win: %4d %3d, %4d %3d 0x%lx\n", tx1, ty1, tx2, ty2, win); +if (db2 && saw_me) continue; + + /* see if window clips us: */ + tmp_win = sraRgnCreateRect(tx1, ty1, tx2, ty2); + if (sraRgnAnd(tmp_win, moved_win)) { + obscured = 1; +if (db2) fprintf(stderr, " : clips it.\n"); + } + sraRgnDestroy(tmp_win); + + /* subtract it from our region: */ + tmp_win = sraRgnCreateRect(tx1, ty1, tx2, ty2); + sraRgnSubtract(moved_win, tmp_win); + sraRgnDestroy(tmp_win); + } + X_UNLOCK; + + if (obscured && !strcmp(wireframe_copyrect, "top")) { + ; /* cannot send CopyRegion */ + } else if (! sraRgnEmpty(moved_win)) { + sraRectangleIterator *iter; + sraRegionPtr whole, shifted_region; + sraRect rect; + + /* + * prepare for CopyRegion, apply dx and + * dy to each rectangle in the region. + * keep only the part on the screen. + */ + whole = sraRgnCreateRect(0, 0, dpy_x, dpy_y); + shifted_region = sraRgnCreate(); + +if (db2) fprintf(stderr, "\n"); + + iter = sraRgnGetIterator(moved_win); + while (sraRgnIteratorNext(iter, &rect)) { + tx1 = rect.x1 + dx; + ty1 = rect.y1 + dy; + tx2 = rect.x2 + dx; + ty2 = rect.y2 + dy; + +if (db2) fprintf(stderr, " shf_win: %4d %3d, %4d %3d\n", tx1, ty1, tx2, ty2); + + tmp_win = sraRgnCreateRect(tx1, ty1, + tx2, ty2); + sraRgnAnd(tmp_win, whole); + if (! sraRgnEmpty(tmp_win)) { + sraRgnOr(shifted_region, + tmp_win); + } + sraRgnDestroy(tmp_win); + } + sraRgnReleaseIterator(iter); + sraRgnDestroy(whole); + + /* now send the CopyRegion: */ + if (! sraRgnEmpty(shifted_region)) { + rfbDoCopyRegion(screen, shifted_region, + dx, dy); + sent_copyrect = 1; +if (db2) fprintf(stderr, " rfbDoCopyRegion\n"); + } + sraRgnDestroy(shifted_region); + } + sraRgnDestroy(moved_win); + } + + if (sent_copyrect) { + + /* try to push the changes to viewers: */ + fb_update_sent(NULL); + rfbPE(screen, spin_ms/3); + if (! obscured) { + for (t=0; t<tmax; t++) { + if (fb_update_sent(NULL)) { +if (db2) fprintf(stderr, "B-FB_UPDATE_SENT: t=%d\n", t); + break; + } + rfbPE(screen, 1000); + } + } + } + } + + if (stack_list) { + /* clean up stack_list for next time: */ + if (break_reason == 1 || break_reason == 2) { + /* + * save the stack list, perhaps the user has + * paused with button down. XXX unstable if + * windows in the list go away? + */ + last_save_stacklist = time(0); + } else { + X_LOCK; + XFree(stack_list); + X_UNLOCK; + stack_list = NULL; + stack_num = 0; + } + } + + /* final push (for -nowirecopyrect) */ + rfbPE(screen, 1000); + wireframe_in_progress = 0; + return 1; +} /* * We need to handle user input, particularly pointer input, carefully. @@ -18416,7 +19938,9 @@ static void check_user_input2(double dt) { } else { rfbCFD(screen, 1000); } + X_LOCK; XFlush(dpy); + X_UNLOCK; spin += dtime(&tm); @@ -18481,7 +20005,9 @@ static void check_user_input2(double dt) { } spin += dtime(&tm); if (got_pointer_input > g) { + X_LOCK; XFlush(dpy); + X_UNLOCK; miss = 0; } else { miss++; @@ -18533,7 +20059,9 @@ static void check_user_input3(double dt) { } else { rfbCFD(screen, 1000); } + X_LOCK; XFlush(dpy); + X_UNLOCK; spin += dtime(&tm); @@ -18614,7 +20142,9 @@ static void check_user_input3(double dt) { } spin += dtime(&tm); if (got_pointer_input > g) { + X_LOCK; XFlush(dpy); + X_UNLOCK; miss = 0; } else { miss++; @@ -18984,6 +20514,17 @@ static void check_user_input5(double dt, double dtr, int tile_diffs) { } static int check_user_input(double dt, double dtr, int tile_diffs, int *cnt) { + + if (raw_fb && ! dpy) return 0; /* raw_fb hack */ + + maybe_scrolling = None; + + if (wireframe) { + if (check_wireframe()) { + return 0; + } + } + if (pointer_mode == 1) { if ((got_user_input || ui_skip < 0) && *cnt % ui_skip != 0) { /* every ui_skip-th drops thru to scan */ @@ -19022,6 +20563,11 @@ static int check_user_input(double dt, double dtr, int tile_diffs, int *cnt) { return 0; } +/* -- x11vnc.c -- */ +/* + * main routine for the x11vnc program + */ + /* * simple function for measuring sub-second time differences, using * a double to hold the value. @@ -19351,6 +20897,8 @@ static void watch_loop(void) { /* true means loop back for more input */ continue; } + } else if (use_threads && wireframe && button_mask) { + check_wireframe(); } if (shut_down) { @@ -20146,6 +21694,62 @@ static void print_help(int mode) { " slow setups, but you lose all visual feedback for drags,\n" " text selection, and some menu traversals. It overrides\n" " any -pointer_mode setting\n" +"\n" +"-wireframe [str] Try to detect window moves or resizes when a mouse\n" +"-nowireframe button is held down and show a wireframe instead of\n" +" the full opaque window. This is based completely on\n" +" heuristics and may not always work: it depends on your\n" +" window manager and even how you move things around.\n" +" See -pointer_mode below for discussion of the \"bogging\n" +" down\" problem this tries to avoid. Default: %s\n" +"\n" +" The value \"str\" is optional and, of course, is\n" +" packed with many tunable parameters for this scheme:\n" +"\n" +" Format: shade,linewidth,percent,T+B+L+R,t1+t2+t3+t4\n" +" Default: %s\n" +"\n" +" If you leave nothing between commas: \",,\" the default\n" +" value is used. If you don't specify enough commas,\n" +" the trailing parameters are set to their defaults.\n" +"\n" +" \"shade\" indicate the \"color\" for the wireframe,\n" +" usually a greyscale: 0-255, however for 16 and 32bpp you\n" +" can specify an rgb.txt X color (e.g. \"dodgerblue\") or\n" +" a value > 255 is treated as RGB (e.g. red is 0xff0000).\n" +" \"linewidth\" sets the width of the wireframe in pixels.\n" +" \"percent\" indicates to not apply the wireframe scheme\n" +" to windows with area less than this percent of the\n" +" full screen.\n" +"\n" +" \"T+B+L+R\" indicates four integers for how close in\n" +" pixels the pointer has to be from the Top, Bottom, Left,\n" +" or Right edges of the window to consider wireframing.\n" +" This is a speedup to quickly exclude a window from being\n" +" wireframed: set them all to zero to not try the speedup\n" +" (scrolling and selecting text will likely be slower).\n" +"\n" +" \"t1+t2+t3+t4\" specify four floating point times in\n" +" seconds: t1 is how long to wait for the pointer to move,\n" +" t2 is how long to wait for the window to start moving\n" +" or being resized (for some window managers this can be\n" +" rather long), t3 is how long to keep a wireframe moving\n" +" before repainting the window. t4 is the minimum time\n" +" between sending wireframe \"animations\". For a slow\n" +" link this might be a better choice: 0.25+0.6+6.0+0.15\n" +"\n" +"-wirecopyrect mode Since the -wireframe mechanism evidently tracks moving\n" +"-nowirecopyrect windows, a speedup can be obtained by telling the VNC\n" +" viewers to locally copy the translated window region.\n" +" This is the VNC CopyRect encoding: the framebuffer\n" +" update doesn't need to send the actual new image data.\n" +" \"mode\" can be \"never\" (same as -nowirecopyrect)\n" +" to never try the copyrect, \"top\" means only do it if\n" +" the window was not covered by any other windows, and\n" +" \"always\" means to translate the orginally unobscured\n" +" region (this may look odd as the remaining pieces come\n" +" in, but helps on a slow link) Default: %s\n" +"\n" "-pointer_mode n Various pointer motion update schemes. \"-pm\" is\n" " an alias. The problem is pointer motion can cause\n" " rapid changes on the screen: consider the rapid changes\n" @@ -20169,7 +21773,6 @@ static void print_help(int mode) { " n=2 is an improved scheme: by watching the current rate\n" " of input events it tries to detect if it should try to\n" " \"eat\" additional pointer events before continuing.\n" -" This mode was the default until Apr 2005.\n" "\n" " n=3 is basically the same as n=2 except with slightly\n" " tweaked parameters. We made this a new one so one\n" @@ -20311,8 +21914,9 @@ static void print_help(int mode) { " which specifies a shmid N and framebuffer Width, Height,\n" " and Bits per pixel. To memory map mmap(2) a file use:\n" " \"map:/path/to/a/file@WxHxB\". If there is trouble\n" -" with mmap, use \"file:/...\" for slower lseek(2) based\n" -" reading.\n" +" with mmap, use \"file:/...\" for slower lseek(2)\n" +" based reading. If you do not supply a type \"map\"\n" +" is assumed if the file exists.\n" "\n" " If string is \"setup:cmd\", then the command \"cmd\"\n" " is run and the first line from it is read and used\n" @@ -20336,10 +21940,16 @@ static void print_help(int mode) { " All user input is discarded. Most of the X11 (screen,\n" " keyboard, mouse) options do not make sense and many\n" " will cause this mode to crash, so please think twice\n" -" before setting/changing them. If you don't want x11vnc\n" -" to close the DISPLAY in rawfb mode, then capitalize\n" -" the prefix, SHM:, MAP: etc. Keeping the display open\n" -" enables default remote-control channel.\n" +" before setting/changing them.\n" +"\n" +" If you don't want x11vnc to close the X DISPLAY in\n" +" rawfb mode, then capitalize the prefix, SHM:, MAP:,\n" +" FILE: Keeping the display open enables the default\n" +" remote-control channel, which could be useful. Also,\n" +" if you also specify -noviewonly, then the mouse and\n" +" keyboard input are still sent to the X display, this\n" +" usage should be very rare, i.e. doing something strange\n" +" with /dev/fb0.\n" "\n" "-pipeinput cmd Another experimental option: it lets you supply\n" " an extern command in \"cmd\" that x11vnc will pipe\n" @@ -20594,6 +22204,11 @@ static void print_help(int mode) { " buttonmap:str set -buttonmap \"str\", empty to disable\n" " dragging disable -nodragging mode.\n" " nodragging enable -nodragging mode.\n" +" wireframe enable -wireframe mode.\n" +" nowireframe disable -wireframe mode.\n" +" wireframe:str enable -wireframe mode string.\n" +" wireframe_mode:str enable -wireframe mode string.\n" +" wirecopyrect:str set -wirecopyrect string.\n" " pointer_mode:n set -pointer_mode to n. same as \"pm\"\n" " input_skip:n set -input_skip to n.\n" " speeds:str set -speeds to str.\n" @@ -20690,31 +22305,33 @@ static void print_help(int mode) { " noxtrap xrandr noxrandr xrandr_mode padgeom quiet q\n" " noquiet modtweak nomodtweak xkb noxkb skip_keycodes\n" " add_keysyms noadd_keysyms clear_mods noclear_mods\n" -" clear_keys noclear_keys remap repeat norepeat fb nofb\n" -" bell nobell sel nosel primary noprimary cursorshape\n" -" nocursorshape cursorpos nocursorpos cursor show_cursor\n" -" noshow_cursor nocursor arrow xfixes noxfixes xdamage\n" -" noxdamage xd_area xd_mem alphacut alphafrac alpharemove\n" -" noalpharemove alphablend noalphablend xwarp xwarppointer\n" -" noxwarp noxwarppointer buttonmap dragging nodragging\n" +" clear_keys noclear_keys remap repeat norepeat\n" +" fb nofb bell nobell sel nosel primary noprimary\n" +" cursorshape nocursorshape cursorpos nocursorpos\n" +" cursor show_cursor noshow_cursor nocursor arrow\n" +" xfixes noxfixes xdamage noxdamage xd_area xd_mem\n" +" alphacut alphafrac alpharemove noalpharemove alphablend\n" +" noalphablend xwarp xwarppointer noxwarp noxwarppointer\n" +" buttonmap dragging nodragging wireframe_mode\n" +" wireframe nowireframe wirecopyrect nowirecopyrect\n" " pointer_mode pm input_skip input client_input speeds\n" " debug_pointer dp nodebug_pointer nodp debug_keyboard dk\n" -" nodebug_keyboard nodk deferupdate defer wait rfbwait nap\n" -" nonap sb screen_blank fs gaps grow fuzz snapfb nosnapfb\n" -" rawfb setup: progressive rfbport http nohttp httpport\n" +" nodebug_keyboard nodk deferupdate defer wait rfbwait\n" +" nap nonap sb screen_blank fs gaps grow fuzz snapfb\n" +" nosnapfb rawfb progressive rfbport http nohttp httpport\n" " httpdir enablehttpproxy noenablehttpproxy alwaysshared\n" " noalwaysshared nevershared noalwaysshared dontdisconnect\n" " nodontdisconnect desktop noremote\n" "\n" -" aro= debug_xevents: display vncdisplay desktopname\n" -" http_url auth users rootshift clipshift scale_str\n" -" scaled_x scaled_y scale_numer scale_denom\n" +" aro= debug_xevents debug_xdamage display vncdisplay\n" +" desktopname http_url auth users rootshift clipshift\n" +" scale_str scaled_x scaled_y scale_numer scale_denom\n" " scale_fac scaling_blend scaling_nomult4 scaling_pad\n" -" scaling_interpolate inetd safer unsafe passwdfile\n" -" using_shm logfile o flag rc norc h help V version\n" -" lastmod bg sigpipe threads pipeinput clients\n" -" client_count pid ext_xtest ext_xtrap ext_xkb ext_xshm\n" -" ext_xinerama ext_overlay ext_xfixes ext_xdamage\n" +" scaling_interpolate inetd privremote unsafe safer\n" +" nocmds passwdfile using_shm logfile o flag rc norc h\n" +" help V version lastmod bg sigpipe threads pipeinput\n" +" clients client_count pid ext_xtest ext_xtrap ext_xkb\n" +" ext_xshm ext_xinerama ext_overlay ext_xfixes ext_xdamage\n" " ext_xrandr rootwin num_buttons button_mask mouse_x\n" " mouse_y bpp depth indexed_color dpy_x dpy_y wdpy_x\n" " wdpy_y off_x off_y cdpy_x cdpy_y coff_x coff_y rfbauth\n" @@ -20752,22 +22369,29 @@ static void print_help(int mode) { " channel is being used, obviously anyone who can write\n" " to /path/to/file can remotely control x11vnc. So be\n" " sure to protect the X display and that file's write\n" -" permissions.\n" +" permissions. See -privremote below.\n" "\n" " If you are paranoid and do not think -noremote is\n" " enough, to disable the VNC_CONNECT property channel\n" -" completely use -novncconnect.\n" +" completely use -novncconnect, or use the -safer\n" +" option that shuts many things off.\n" "\n" -"-unsafe If x11vnc is running as root (e.g. inetd or Xsetup for\n" -" a display manager) a few remote commands are disabled\n" -" (currently: id:pick, accept:<cmd>, and gone:<cmd>)\n" -" because they are associated with running external\n" -" programs. If you specify -unsafe, then these remote\n" -" control commands are allowed when running as root.\n" -" When running as non-root all commands are allowed.\n" -" See -safer below.\n" -"-safer Even if not running as root, disable the above unsafe\n" -" remote control commands.\n" +"-unsafe A few remote commands are disabled by default\n" +" (currently: id:pick, accept:<cmd>, gone:<cmd>, and\n" +" rawfb:setup:<cmd>) because they are associated with\n" +" running external programs. If you specify -unsafe, then\n" +" these remote-control commands are allowed. Note that\n" +" you can still specify these parameters on the command\n" +" line, they just cannot be changed via remote-control.\n" +"-safer Equivalent to: -novncconnect -noremote and prohibiting\n" +" -gui and the -connect file. Shuts off communcation\n" +" channels.\n" +"-privremote Perform some sanity checks and only allow remote-control\n" +" commands if it appears that the X DISPLAY and/or\n" +" connectfile cannot be accessed by other users. (not\n" +" complete, does not check for empty access control list)\n" +"-nocmds No external commands (e.g. system(3), popen(3), exec(3))\n" +" will be run.\n" "\n" "-deny_all For use with -remote nodeny: start out denying all\n" " incoming clients until \"-remote nodeny\" is used to\n" @@ -20814,6 +22438,9 @@ static void print_help(int mode) { alpha_threshold, alpha_frac, cursor_pos_updates ? "-cursorpos":"-nocursorpos", + wireframe ? "-wireframe":"-nowireframe", + WIREFRAME_PARMS, + wireframe_copyrect_default, pointer_mode_max, pointer_mode, ui_skip, defer_update, @@ -20942,7 +22569,7 @@ static char *choose_title(char *display) { } } strncat(title, display, MAXN - strlen(title)); - if (subwin && valid_window(subwin)) { + if (subwin && valid_window(subwin, NULL)) { char *name; if (XFetchName(dpy, subwin, &name)) { strncat(title, " ", MAXN - strlen(title)); @@ -21204,9 +22831,7 @@ int main(int argc, char* argv[]) { /* used to pass args we do not know about to rfbGetScreen(): */ int argc_vnc = 1; char *argv_vnc[128]; - /* if we are root limit some remote commands, etc: */ if (!getuid() || !geteuid()) { - safe_remote_only = 1; started_as_root = 1; /* check for '-users =bob' */ @@ -21270,7 +22895,7 @@ int main(int argc, char* argv[]) { } i++; if (!strcmp("pick", argv[i])) { - if (safe_remote_only) { + if (started_as_root) { fprintf(stderr, "unsafe: %s pick\n", arg); exit(1); @@ -21314,6 +22939,9 @@ int main(int argc, char* argv[]) { scale_cursor_str = strdup(argv[++i]); } else if (!strcmp(arg, "-viewonly")) { view_only = 1; + } else if (!strcmp(arg, "-noviewonly")) { + view_only = 0; + got_noviewonly = 1; } else if (!strcmp(arg, "-shared")) { shared = 1; } else if (!strcmp(arg, "-once")) { @@ -21532,6 +23160,21 @@ int main(int argc, char* argv[]) { pointer_remap = strdup(argv[++i]); } else if (!strcmp(arg, "-nodragging")) { show_dragging = 0; + } else if (!strcmp(arg, "-wireframe")) { + wireframe = 1; + if (i < argc-1) { + char *s = argv[i+1]; + if (*s != '-') { + wireframe_str = strdup(argv[++i]); + } + } + } else if (!strcmp(arg, "-nowireframe")) { + wireframe = 0; + } else if (!strcmp(arg, "-wirecopyrect")) { + CHECK_ARGC + set_wirecopyrect_mode(argv[++i]); + } else if (!strcmp(arg, "-nowirecopyrect")) { + set_wirecopyrect_mode("never"); } else if (!strcmp(arg, "-pointer_mode") || !strcmp(arg, "-pm")) { char *p, *s; @@ -21658,8 +23301,12 @@ int main(int argc, char* argv[]) { accept_remote_cmds = 0; } else if (!strcmp(arg, "-unsafe")) { safe_remote_only = 0; + } else if (!strcmp(arg, "-privremote")) { + priv_remote = 1; } else if (!strcmp(arg, "-safer")) { - safe_remote_only = 1; + more_safe = 1; + } else if (!strcmp(arg, "-nocmds")) { + no_external_cmds = 1; } else if (!strcmp(arg, "-deny_all")) { deny_all = 1; } else if (!strcmp(arg, "-httpdir")) { @@ -21857,6 +23504,20 @@ int main(int argc, char* argv[]) { exit(1); } + if (more_safe) { + if (! quiet) { + rfbLog("-safer mode:\n"); + rfbLog(" vnc_connect=0\n"); + rfbLog(" accept_remote_cmds=0\n"); + rfbLog(" safe_remote_only=1\n"); + rfbLog(" launch_gui=0\n"); + } + vnc_connect = 0; + accept_remote_cmds = 0; + safe_remote_only = 1; + launch_gui = 0; + } + /* fixup settings that do not make sense */ if (use_threads && nofb && cursor_pos_updates) { @@ -21898,6 +23559,10 @@ int main(int argc, char* argv[]) { rfbLog("warning: -flipbyte order only works with -noshm\n"); } + if (! wireframe_copyrect) { + set_wirecopyrect_mode(NULL); + } + /* increase rfbwait if threaded */ if (use_threads && ! got_rfbwait) { if (0) { @@ -22055,6 +23720,8 @@ int main(int argc, char* argv[]) { fprintf(stderr, " buttonmap: %s\n", pointer_remap ? pointer_remap : "null"); fprintf(stderr, " dragging: %d\n", show_dragging); + fprintf(stderr, " wireframe: %s\n", wireframe_str ? + wireframe_str : WIREFRAME_PARMS); fprintf(stderr, " ptr_mode: %d\n", pointer_mode); fprintf(stderr, " inputskip: %d\n", ui_skip); fprintf(stderr, " speeds: %s\n", speeds_str @@ -22085,6 +23752,9 @@ int main(int argc, char* argv[]) { ? gui_str : "null"); fprintf(stderr, " noremote: %d\n", !accept_remote_cmds); fprintf(stderr, " safemode: %d\n", safe_remote_only); + fprintf(stderr, " privremote: %d\n", priv_remote); + fprintf(stderr, " safer: %d\n", more_safe); + fprintf(stderr, " nocmds: %d\n", no_external_cmds); fprintf(stderr, " deny_all: %d\n", deny_all); fprintf(stderr, "\n"); rfbLog("x11vnc version: %s\n", lastmod); |