some -ncache performance improvements, rootpixmap watching, gnome wm heuristics

pull/1/head
runge 18 years ago
parent 5b3e420c1f
commit 7717d245af

@ -1,5 +1,5 @@
x11vnc README file Date: Tue Jan 9 09:38:28 EST 2007 x11vnc README file Date: Wed Jan 10 12:06:50 EST 2007
The following information is taken from these URLs: The following information is taken from these URLs:
@ -1145,7 +1145,8 @@ make
[201]Q-62: How can I make x11vnc use MORE system resources? [201]Q-62: How can I make x11vnc use MORE system resources?
[202]Q-63: I use x11vnc over a slow link with high latency (e.g. [202]Q-63: I use x11vnc over a slow link with high latency (e.g.
dialup modem), is there anything I can do to speed things up? dialup modem or broadband), is there anything I can do to speed things
up?
[203]Q-64: Does x11vnc support the X DAMAGE Xserver extension to find [203]Q-64: Does x11vnc support the X DAMAGE Xserver extension to find
modified regions of the screen quickly and efficiently? modified regions of the screen quickly and efficiently?
@ -4070,7 +4071,7 @@ ied)
Q-63: I use x11vnc over a slow link with high latency (e.g. dialup Q-63: I use x11vnc over a slow link with high latency (e.g. dialup
modem), is there anything I can do to speed things up? modem or broadband), is there anything I can do to speed things up?
Some things you might want to experiment with (many of which will help Some things you might want to experiment with (many of which will help
performance on faster links as well): performance on faster links as well):
@ -9349,7 +9350,7 @@ x11vnc: a VNC server for real X displays
Here are all of x11vnc command line options: Here are all of x11vnc command line options:
% x11vnc -opts (see below for -help long descriptions) % x11vnc -opts (see below for -help long descriptions)
x11vnc: allow VNC connections to real X11 displays. 0.8.4 lastmod: 2007-01-09 x11vnc: allow VNC connections to real X11 displays. 0.8.4 lastmod: 2007-01-10
x11vnc options: x11vnc options:
-display disp -auth file -id windowid -display disp -auth file -id windowid
@ -9396,33 +9397,34 @@ x11vnc options:
-nocursorpos -xwarppointer -noxwarppointer -nocursorpos -xwarppointer -noxwarppointer
-buttonmap string -nodragging -ncache n -buttonmap string -nodragging -ncache n
-ncache_cr -ncache_no_moveraise -ncache_no_dtchange -ncache_cr -ncache_no_moveraise -ncache_no_dtchange
-ncache_pad n -wireframe [str] -nowireframe -ncache_no_rootpixmap -ncache_pad n -wireframe [str]
-nowireframelocal -wirecopyrect mode -nowirecopyrect -nowireframe -nowireframelocal -wirecopyrect mode
-debug_wireframe -scrollcopyrect mode -noscrollcopyrect -nowirecopyrect -debug_wireframe -scrollcopyrect mode
-scr_area n -scr_skip list -scr_inc list -noscrollcopyrect -scr_area n -scr_skip list
-scr_keys list -scr_term list -scr_keyrepeat lo-hi -scr_inc list -scr_keys list -scr_term list
-scr_parms string -fixscreen string -debug_scroll -scr_keyrepeat lo-hi -scr_parms string -fixscreen string
-noxrecord -grab_buster -nograb_buster -debug_scroll -noxrecord -grab_buster
-debug_grabs -debug_sel -pointer_mode n -nograb_buster -debug_grabs -debug_sel
-input_skip n -allinput -speeds rd,bw,lat -pointer_mode n -input_skip n -allinput
-wmdt string -debug_pointer -debug_keyboard -speeds rd,bw,lat -wmdt string -debug_pointer
-defer time -wait time -wait_ui factor -debug_keyboard -defer time -wait time
-nowait_bog -slow_fb time -readtimeout n -wait_ui factor -nowait_bog -slow_fb time
-nap -nonap -sb time -readtimeout n -nap -nonap
-nofbpm -fbpm -nodpms -sb time -nofbpm -fbpm
-dpms -noxdamage -xd_area A -nodpms -dpms -noxdamage
-xd_mem f -sigpipe string -threads -xd_area A -xd_mem f -sigpipe string
-nothreads -fs f -gaps n -threads -nothreads -fs f
-grow n -fuzz n -debug_tiles -gaps n -grow n -fuzz n
-snapfb -rawfb string -freqtab file -debug_tiles -snapfb -rawfb string
-pipeinput cmd -macnodim -macnosleep -freqtab file -pipeinput cmd -macnodim
-macnosaver -macnowait -macwheel n -macnosleep -macnosaver -macnowait
-macnoswap -macnoresize -maciconanim n -macwheel n -macnoswap -macnoresize
-macmenu -gui [gui-opts] -remote command -maciconanim n -macmenu -gui [gui-opts]
-query variable -QD variable -sync -remote command -query variable -QD variable
-noremote -yesremote -unsafe -sync -noremote -yesremote
-safer -privremote -nocmds -unsafe -safer -privremote
-allowedcmds list -deny_all -nocmds -allowedcmds list -deny_all
libvncserver options: libvncserver options:
-rfbport port TCP port for RFB protocol -rfbport port TCP port for RFB protocol
@ -9456,7 +9458,7 @@ libvncserver-tight-extension options:
% x11vnc -help % x11vnc -help
x11vnc: allow VNC connections to real X11 displays. 0.8.4 lastmod: 2007-01-09 x11vnc: allow VNC connections to real X11 displays. 0.8.4 lastmod: 2007-01-10
(type "x11vnc -opts" to just list the options.) (type "x11vnc -opts" to just list the options.)
@ -11501,6 +11503,10 @@ Options:
workarea). The default is to try to guess and when workarea). The default is to try to guess and when
detected try to make the transistion more smoothly. detected try to make the transistion more smoothly.
-ncache_no_rootpixmap In -ncache mode, do not try to snapshot the desktop
background to use in guessing or reconstructing window
save-unders..
-ncache_pad n In -ncache mode, pad each window with n pixels for the -ncache_pad n In -ncache mode, pad each window with n pixels for the
caching rectangles. This can be used to try to improve caching rectangles. This can be used to try to improve
the situation with dropshadows or other compositing the situation with dropshadows or other compositing
@ -12758,8 +12764,13 @@ n
ncache_size:n set -ncache size to n. ncache_size:n set -ncache size to n.
ncache_cr enable -ncache_cr mode. ncache_cr enable -ncache_cr mode.
noncache_cr disable -ncache_cr mode. noncache_cr disable -ncache_cr mode.
ncache_no_moveraise enable no_moveraise mode. ncache_no_moveraise enable no_moveraise mode.
noncache_no_moveraise disable no_moveraise mode. noncache_no_moveraise disable no_moveraise mode.
ncache_no_dtchange enable ncache_no_dtchange mode.
noncache_no_dtchange disable ncache_no_dtchange mode.
ncache_no_rootpixmap enable ncache_no_rootpixmap.
noncache_no_rootpixmap disable ncache_no_rootpixmap.
ncache_reset_rootpixmap recheck the root pixmap
wireframe enable -wireframe mode. same as "wf" wireframe enable -wireframe mode. same as "wf"
nowireframe disable -wireframe mode. same as "nowf" nowireframe disable -wireframe mode. same as "nowf"
wireframe:str enable -wireframe mode string. wireframe:str enable -wireframe mode string.
@ -12921,29 +12932,31 @@ n
bell nobell sel nosel primary noprimary setprimary bell nobell sel nosel primary noprimary setprimary
nosetprimary clipboard noclipboard setclipboard nosetprimary clipboard noclipboard setclipboard
nosetclipboard seldir cursorshape nocursorshape nosetclipboard seldir cursorshape nocursorshape
cursorpos nocursorpos cursor_drag nocursor_drag cursorpos nocursorpos cursor_drag nocursor_drag cursor
cursor show_cursor noshow_cursor nocursor arrow show_cursor noshow_cursor nocursor arrow xfixes
xfixes noxfixes xdamage noxdamage xd_area xd_mem noxfixes xdamage noxdamage xd_area xd_mem alphacut
alphacut alphafrac alpharemove noalpharemove alphablend alphafrac alpharemove noalpharemove alphablend
noalphablend xwarppointer xwarp noxwarppointer noxwarp noalphablend xwarppointer xwarp noxwarppointer
buttonmap dragging nodragging ncache_cr noncache_cr noxwarp buttonmap dragging nodragging ncache_cr
ncache_no_moveraise noncache_no_moveraise ncache noncache_cr ncache_no_moveraise noncache_no_moveraise
noncache ncache_size wireframe_mode wireframe wf ncache_no_dtchange noncache_no_dtchange
nowireframe nowf wireframelocal wfl nowireframelocal ncache_no_rootpixmap noncache_no_rootpixmap
nowfl wirecopyrect wcr nowirecopyrect nowcr scr_area ncache_reset_rootpixmap ncache noncache ncache_size
scr_skip scr_inc scr_keys scr_term scr_keyrepeat wireframe_mode wireframe wf nowireframe nowf
scr_parms scrollcopyrect scr noscrollcopyrect noscr wireframelocal wfl nowireframelocal nowfl wirecopyrect
fixscreen noxrecord xrecord reset_record pointer_mode wcr nowirecopyrect nowcr scr_area scr_skip scr_inc
pm input_skip allinput noallinput input grabkbd scr_keys scr_term scr_keyrepeat scr_parms scrollcopyrect
nograbkbd grabptr nograbptr client_input ssltimeout scr noscrollcopyrect noscr fixscreen noxrecord xrecord
speeds wmdt debug_pointer dp nodebug_pointer nodp reset_record pointer_mode pm input_skip allinput
debug_keyboard dk nodebug_keyboard nodk deferupdate noallinput input grabkbd nograbkbd grabptr nograbptr
defer wait_ui wait_bog nowait_bog slow_fb wait client_input ssltimeout speeds wmdt debug_pointer dp
readtimeout nap nonap sb screen_blank fbpm nofbpm nodebug_pointer nodp debug_keyboard dk nodebug_keyboard
dpms nodpms fs gaps grow fuzz snapfb nosnapfb rawfb nodk deferupdate defer wait_ui wait_bog nowait_bog
uinput_accel uinput_thresh uinput_reset uinput_always slow_fb wait readtimeout nap nonap sb screen_blank
progressive rfbport http nohttp httpport httpdir fbpm nofbpm dpms nodpms fs gaps grow fuzz snapfb
enablehttpproxy noenablehttpproxy alwaysshared nosnapfb rawfb uinput_accel uinput_thresh uinput_reset
uinput_always progressive rfbport http nohttp httpport
httpdir enablehttpproxy noenablehttpproxy alwaysshared
noalwaysshared nevershared noalwaysshared dontdisconnect noalwaysshared nevershared noalwaysshared dontdisconnect
nodontdisconnect desktop debug_xevents nodebug_xevents nodontdisconnect desktop debug_xevents nodebug_xevents
debug_xevents debug_xdamage nodebug_xdamage debug_xevents debug_xdamage nodebug_xdamage

@ -2079,6 +2079,10 @@ void print_help(int mode) {
" workarea). The default is to try to guess and when\n" " workarea). The default is to try to guess and when\n"
" detected try to make the transistion more smoothly.\n" " detected try to make the transistion more smoothly.\n"
"\n" "\n"
"-ncache_no_rootpixmap In -ncache mode, do not try to snapshot the desktop\n"
" background to use in guessing or reconstructing window\n"
" save-unders..\n"
"\n"
"-ncache_pad n In -ncache mode, pad each window with n pixels for the\n" "-ncache_pad n In -ncache mode, pad each window with n pixels for the\n"
" caching rectangles. This can be used to try to improve\n" " caching rectangles. This can be used to try to improve\n"
" the situation with dropshadows or other compositing\n" " the situation with dropshadows or other compositing\n"
@ -3344,8 +3348,13 @@ void print_help(int mode) {
" ncache_size:n set -ncache size to n.\n" " ncache_size:n set -ncache size to n.\n"
" ncache_cr enable -ncache_cr mode.\n" " ncache_cr enable -ncache_cr mode.\n"
" noncache_cr disable -ncache_cr mode.\n" " noncache_cr disable -ncache_cr mode.\n"
" ncache_no_moveraise enable no_moveraise mode.\n" " ncache_no_moveraise enable no_moveraise mode.\n"
" noncache_no_moveraise disable no_moveraise mode.\n" " noncache_no_moveraise disable no_moveraise mode.\n"
" ncache_no_dtchange enable ncache_no_dtchange mode.\n"
" noncache_no_dtchange disable ncache_no_dtchange mode.\n"
" ncache_no_rootpixmap enable ncache_no_rootpixmap.\n"
" noncache_no_rootpixmap disable ncache_no_rootpixmap.\n"
" ncache_reset_rootpixmap recheck the root pixmap\n"
" wireframe enable -wireframe mode. same as \"wf\"\n" " wireframe enable -wireframe mode. same as \"wf\"\n"
" nowireframe disable -wireframe mode. same as \"nowf\"\n" " nowireframe disable -wireframe mode. same as \"nowf\"\n"
" wireframe:str enable -wireframe mode string.\n" " wireframe:str enable -wireframe mode string.\n"
@ -3505,29 +3514,31 @@ void print_help(int mode) {
" bell nobell sel nosel primary noprimary setprimary\n" " bell nobell sel nosel primary noprimary setprimary\n"
" nosetprimary clipboard noclipboard setclipboard\n" " nosetprimary clipboard noclipboard setclipboard\n"
" nosetclipboard seldir cursorshape nocursorshape\n" " nosetclipboard seldir cursorshape nocursorshape\n"
" cursorpos nocursorpos cursor_drag nocursor_drag\n" " cursorpos nocursorpos cursor_drag nocursor_drag cursor\n"
" cursor show_cursor noshow_cursor nocursor arrow\n" " show_cursor noshow_cursor nocursor arrow xfixes\n"
" xfixes noxfixes xdamage noxdamage xd_area xd_mem\n" " noxfixes xdamage noxdamage xd_area xd_mem alphacut\n"
" alphacut alphafrac alpharemove noalpharemove alphablend\n" " alphafrac alpharemove noalpharemove alphablend\n"
" noalphablend xwarppointer xwarp noxwarppointer noxwarp\n" " noalphablend xwarppointer xwarp noxwarppointer\n"
" buttonmap dragging nodragging ncache_cr noncache_cr\n" " noxwarp buttonmap dragging nodragging ncache_cr\n"
" ncache_no_moveraise noncache_no_moveraise ncache\n" " noncache_cr ncache_no_moveraise noncache_no_moveraise\n"
" noncache ncache_size wireframe_mode wireframe wf\n" " ncache_no_dtchange noncache_no_dtchange\n"
" nowireframe nowf wireframelocal wfl nowireframelocal\n" " ncache_no_rootpixmap noncache_no_rootpixmap\n"
" nowfl wirecopyrect wcr nowirecopyrect nowcr scr_area\n" " ncache_reset_rootpixmap ncache noncache ncache_size\n"
" scr_skip scr_inc scr_keys scr_term scr_keyrepeat\n" " wireframe_mode wireframe wf nowireframe nowf\n"
" scr_parms scrollcopyrect scr noscrollcopyrect noscr\n" " wireframelocal wfl nowireframelocal nowfl wirecopyrect\n"
" fixscreen noxrecord xrecord reset_record pointer_mode\n" " wcr nowirecopyrect nowcr scr_area scr_skip scr_inc\n"
" pm input_skip allinput noallinput input grabkbd\n" " scr_keys scr_term scr_keyrepeat scr_parms scrollcopyrect\n"
" nograbkbd grabptr nograbptr client_input ssltimeout\n" " scr noscrollcopyrect noscr fixscreen noxrecord xrecord\n"
" speeds wmdt debug_pointer dp nodebug_pointer nodp\n" " reset_record pointer_mode pm input_skip allinput\n"
" debug_keyboard dk nodebug_keyboard nodk deferupdate\n" " noallinput input grabkbd nograbkbd grabptr nograbptr\n"
" defer wait_ui wait_bog nowait_bog slow_fb wait\n" " client_input ssltimeout speeds wmdt debug_pointer dp\n"
" readtimeout nap nonap sb screen_blank fbpm nofbpm\n" " nodebug_pointer nodp debug_keyboard dk nodebug_keyboard\n"
" dpms nodpms fs gaps grow fuzz snapfb nosnapfb rawfb\n" " nodk deferupdate defer wait_ui wait_bog nowait_bog\n"
" uinput_accel uinput_thresh uinput_reset uinput_always\n" " slow_fb wait readtimeout nap nonap sb screen_blank\n"
" progressive rfbport http nohttp httpport httpdir\n" " fbpm nofbpm dpms nodpms fs gaps grow fuzz snapfb\n"
" enablehttpproxy noenablehttpproxy alwaysshared\n" " nosnapfb rawfb uinput_accel uinput_thresh uinput_reset\n"
" uinput_always progressive rfbport http nohttp httpport\n"
" httpdir enablehttpproxy noenablehttpproxy alwaysshared\n"
" noalwaysshared nevershared noalwaysshared dontdisconnect\n" " noalwaysshared nevershared noalwaysshared dontdisconnect\n"
" nodontdisconnect desktop debug_xevents nodebug_xevents\n" " nodontdisconnect desktop debug_xevents nodebug_xevents\n"
" debug_xevents debug_xdamage nodebug_xdamage\n" " debug_xevents debug_xdamage nodebug_xdamage\n"

@ -208,7 +208,10 @@ int ncache_pad = 24;
int ncache = NCACHE; int ncache = NCACHE;
int ncache_pad = 0; int ncache_pad = 0;
#endif #endif
int ncache_xrootpmap = 1; #ifndef NCACHE_XROOTPMAP
#define NCACHE_XROOTPMAP 1
#endif
int ncache_xrootpmap = NCACHE_XROOTPMAP;
int ncache0 = 0; int ncache0 = 0;
int ncache_copyrect = 0; int ncache_copyrect = 0;
int ncache_wf_raises = 1; int ncache_wf_raises = 1;
@ -219,9 +222,11 @@ int ncache_beta_tester = 0;
Atom atom_NET_ACTIVE_WINDOW = None; Atom atom_NET_ACTIVE_WINDOW = None;
Atom atom_NET_CURRENT_DESKTOP = None; Atom atom_NET_CURRENT_DESKTOP = None;
Atom atom_NET_CLIENT_LIST_STACKING = None; Atom atom_NET_CLIENT_LIST_STACKING = None;
Atom atom_XROOTPMAP_ID = None;
double got_NET_ACTIVE_WINDOW = 0.0; double got_NET_ACTIVE_WINDOW = 0.0;
double got_NET_CURRENT_DESKTOP = 0.0; double got_NET_CURRENT_DESKTOP = 0.0;
double got_NET_CLIENT_LIST_STACKING = 0.0; double got_NET_CLIENT_LIST_STACKING = 0.0;
double got_XROOTPMAP_ID = 0.0;
/* T+B+L+R,tkey+presist_key,tmouse+persist_mouse */ /* T+B+L+R,tkey+presist_key,tmouse+persist_mouse */
char *scroll_copyrect_str = NULL; char *scroll_copyrect_str = NULL;

@ -169,9 +169,11 @@ extern int ncache_beta_tester;
extern Atom atom_NET_ACTIVE_WINDOW; extern Atom atom_NET_ACTIVE_WINDOW;
extern Atom atom_NET_CURRENT_DESKTOP; extern Atom atom_NET_CURRENT_DESKTOP;
extern Atom atom_NET_CLIENT_LIST_STACKING; extern Atom atom_NET_CLIENT_LIST_STACKING;
extern Atom atom_XROOTPMAP_ID;
extern double got_NET_ACTIVE_WINDOW; extern double got_NET_ACTIVE_WINDOW;
extern double got_NET_CURRENT_DESKTOP; extern double got_NET_CURRENT_DESKTOP;
extern double got_NET_CLIENT_LIST_STACKING; extern double got_NET_CLIENT_LIST_STACKING;
extern double got_XROOTPMAP_ID;
extern char *scroll_copyrect_str; extern char *scroll_copyrect_str;
extern char *scroll_copyrect; extern char *scroll_copyrect;

@ -2779,6 +2779,40 @@ char *process_remote_cmd(char *cmd, int stringonly) {
ncache_dt_change = 1; ncache_dt_change = 1;
rfbLog("remote_cmd: disabled -ncache_no_dt_change\n"); rfbLog("remote_cmd: disabled -ncache_no_dt_change\n");
} else if (!strcmp(p, "ncache_no_rootpixmap")) {
int orig = ncache_xrootpmap;
if (query) {
snprintf(buf, bufn, "ans=%s:%d", p, !ncache_xrootpmap);
goto qry;
}
ncache_xrootpmap = 0;
rfbLog("remote_cmd: set -ncache_no_rootpixmap\n");
if (orig != ncache_xrootpmap) {
do_new_fb(1);
}
} else if (!strcmp(p, "noncache_no_rootpixmap")) {
int orig = ncache_xrootpmap;
if (query) {
snprintf(buf, bufn, "ans=%s:%d", p, ncache_xrootpmap);
goto qry;
}
ncache_xrootpmap = 1;
rfbLog("remote_cmd: disabled -ncache_no_rootpixmap\n");
if (orig != ncache_xrootpmap) {
do_new_fb(1);
}
} else if (!strcmp(p, "ncache_reset_rootpixmap")) {
if (query) {
snprintf(buf, bufn, "ans=%s:%d", p, !ncache_xrootpmap);
goto qry;
}
if (ncache_xrootpmap) {
rfbLog("remote_cmd: resetting root pixmap.\n");
set_ncache_xrootpmap();
}
} else if (!strcmp(p, "ncache")) { } else if (!strcmp(p, "ncache")) {
if (query) { if (query) {
snprintf(buf, bufn, "ans=%s:%d", p, !!ncache); snprintf(buf, bufn, "ans=%s:%d", p, !!ncache);

@ -2846,11 +2846,15 @@ static int scan_display(int ystart, int rescan) {
y = ystart; y = ystart;
g_now = dnow();
if (! main_fb) { if (! main_fb) {
rfbLog("scan_display: no main_fb!\n"); rfbLog("scan_display: no main_fb!\n");
return 0; return 0;
} }
X_LOCK;
while (y < dpy_y) { while (y < dpy_y) {
if (use_xdamage) { if (use_xdamage) {
@ -2863,7 +2867,6 @@ static int scan_display(int ystart, int rescan) {
} }
/* grab the horizontal scanline from the display: */ /* grab the horizontal scanline from the display: */
X_LOCK;
#ifndef NO_NCACHE #ifndef NO_NCACHE
/* XXX Y test */ /* XXX Y test */
@ -2878,12 +2881,18 @@ if (ncache > 0) {
XEvent ev; XEvent ev;
if (raw_fb_str) { if (raw_fb_str) {
; ;
} else if (XEventsQueued(dpy, QueuedAlready) == 0) {
; /* XXX Y resp */
} else if (XCheckTypedEvent(dpy, MapNotify, &ev)) { } else if (XCheckTypedEvent(dpy, MapNotify, &ev)) {
gotone = 1; gotone = 1;
} else if (XCheckTypedEvent(dpy, UnmapNotify, &ev)) { } else if (XCheckTypedEvent(dpy, UnmapNotify, &ev)) {
gotone = 2; gotone = 2;
} else if (XCheckTypedEvent(dpy, CreateNotify, &ev)) { } else if (XCheckTypedEvent(dpy, CreateNotify, &ev)) {
gotone = 3; gotone = 3;
} else if (XCheckTypedEvent(dpy, ConfigureNotify, &ev)) {
gotone = 4;
} else if (XCheckTypedEvent(dpy, VisibilityNotify, &ev)) {
gotone = 5;
} }
if (gotone) { if (gotone) {
XPutBackEvent(dpy, &ev); XPutBackEvent(dpy, &ev);
@ -2909,7 +2918,6 @@ fprintf(stderr, "\n*** SCAN_DISPLAY CHECK_NCACHE/%d *** %d rescan=%d\n", gotone,
XRANDR_SET_TRAP_RET(-1, "scan_display-set"); XRANDR_SET_TRAP_RET(-1, "scan_display-set");
copy_image(scanline, 0, y, 0, 0); copy_image(scanline, 0, y, 0, 0);
XRANDR_CHK_TRAP_RET(-1, "scan_display-chk"); XRANDR_CHK_TRAP_RET(-1, "scan_display-chk");
X_UNLOCK;
/* for better memory i/o try the whole line at once */ /* for better memory i/o try the whole line at once */
src = scanline->data; src = scanline->data;
@ -2979,6 +2987,9 @@ fprintf(stderr, "\n*** SCAN_DISPLAY CHECK_NCACHE/%d *** %d rescan=%d\n", gotone,
} }
y += NSCAN; y += NSCAN;
} }
X_UNLOCK;
return tile_count; return tile_count;
} }

@ -746,6 +746,9 @@ void do_new_fb(int reset_mem) {
initialize_blackouts_and_xinerama(); initialize_blackouts_and_xinerama();
initialize_polling_images(); initialize_polling_images();
} }
if (ncache) {
check_ncache(1, 0);
}
} }
static void remove_fake_fb(void) { static void remove_fake_fb(void) {

@ -55,6 +55,8 @@ catch {rename send {}}
# 0 means to skip the item. # 0 means to skip the item.
# -- means add a separator # -- means add a separator
# #
# The =GAL ... =GAL LOFF stuff is to provide submenus.
#
global env started time_count global env started time_count
set started "" set started ""
@ -366,6 +368,8 @@ Tuning
ncache_cr ncache_cr
ncache_no_moveraise ncache_no_moveraise
ncache_no_dtchange ncache_no_dtchange
ncache_no_rootpixmap
=A ncache_reset_rootpixmap
=GAL LOFF =GAL LOFF
-- --
=GAL SharedMemory:: =GAL SharedMemory::

@ -66,6 +66,8 @@ char gui_code[] = "";
"# 0 means to skip the item.\n" "# 0 means to skip the item.\n"
"# -- means add a separator\n" "# -- means add a separator\n"
"#\n" "#\n"
"# The =GAL ... =GAL LOFF stuff is to provide submenus.\n"
"#\n"
"\n" "\n"
"global env started time_count\n" "global env started time_count\n"
"set started \"\"\n" "set started \"\"\n"
@ -377,6 +379,8 @@ char gui_code[] = "";
" ncache_cr\n" " ncache_cr\n"
" ncache_no_moveraise\n" " ncache_no_moveraise\n"
" ncache_no_dtchange\n" " ncache_no_dtchange\n"
" ncache_no_rootpixmap\n"
" =A ncache_reset_rootpixmap\n"
" =GAL LOFF\n" " =GAL LOFF\n"
" --\n" " --\n"
" =GAL SharedMemory::\n" " =GAL SharedMemory::\n"

@ -66,6 +66,8 @@ int bs_restore(int idx, int *nbatch, sraRegionPtr rmask, XWindowAttributes *attr
int try_to_fix_su(Window win, int idx, Window above, int *nbatch, char *mode); int try_to_fix_su(Window win, int idx, Window above, int *nbatch, char *mode);
int try_to_fix_resize_su(Window orig_frame, int orig_x, int orig_y, int orig_w, int orig_h, int try_to_fix_resize_su(Window orig_frame, int orig_x, int orig_y, int orig_w, int orig_h,
int x, int y, int w, int h, int try_batch); int x, int y, int w, int h, int try_batch);
int lookup_win_index(Window);
void set_ncache_xrootpmap(void);
static void get_client_regions(int *req, int *mod, int *cpy, int *num) ; static void get_client_regions(int *req, int *mod, int *cpy, int *num) ;
static void parse_scroll_copyrect_str(char *scr); static void parse_scroll_copyrect_str(char *scr);
@ -93,7 +95,6 @@ static void check_user_input3(double dt, double dtr, int tile_diffs);
static void check_user_input4(double dt, double dtr, int tile_diffs); static void check_user_input4(double dt, double dtr, int tile_diffs);
winattr_t *cache_list; winattr_t *cache_list;
int lookup_win_index(Window);
/* /*
* For -wireframe: find the direct child of rootwin that has the * For -wireframe: find the direct child of rootwin that has the
@ -1977,8 +1978,6 @@ void batch_copyregion(sraRegionPtr* region, int *dx, int *dy, int ncr, double de
int k, direct, mode, nrects = 0, bad = 0; int k, direct, mode, nrects = 0, bad = 0;
double start = dnow(); double start = dnow();
/* XXX Y */
for (k=0; k < ncr; k++) { for (k=0; k < ncr; k++) {
sraRectangleIterator *iter; sraRectangleIterator *iter;
sraRect rect; sraRect rect;
@ -2012,13 +2011,28 @@ void batch_copyregion(sraRegionPtr* region, int *dx, int *dy, int ncr, double de
} }
fb_push_wait(delay, FB_COPY|FB_MOD); fb_push_wait(delay, FB_COPY|FB_MOD);
#if 0
i = rfbGetClientIterator(screen);
while( (cl = rfbClientIteratorNext(i)) ) {
if (cl->ublen != 0) {
fprintf(stderr, "batch_copyregion: *** BAD ublen != 0: %d\n", cl->ublen);
bad++;
}
}
rfbReleaseClientIterator(i);
if (bad) {
return;
}
#endif
i = rfbGetClientIterator(screen); i = rfbGetClientIterator(screen);
while( (cl = rfbClientIteratorNext(i)) ) { while( (cl = rfbClientIteratorNext(i)) ) {
rfbFramebufferUpdateMsg *fu = (rfbFramebufferUpdateMsg *)cl->updateBuf; rfbFramebufferUpdateMsg *fu = (rfbFramebufferUpdateMsg *)cl->updateBuf;
fu->nRects = Swap16IfLE((uint16_t)(nrects)); fu->nRects = Swap16IfLE((uint16_t)(nrects));
fu->type = rfbFramebufferUpdate; fu->type = rfbFramebufferUpdate;
if (cl->ublen != 0) fprintf(stderr, "batch_copyregion: *** ublen != 0: %d\n", cl->ublen); if (cl->ublen != 0) fprintf(stderr, "batch_copyregion: *** BAD ublen != 0: %d\n", cl->ublen);
cl->ublen = sz_rfbFramebufferUpdateMsg; cl->ublen = sz_rfbFramebufferUpdateMsg;
} }
@ -2091,9 +2105,6 @@ void fb_push(void) {
rfbClientIteratorPtr i; rfbClientIteratorPtr i;
rfbClientPtr cl; rfbClientPtr cl;
/* XXX Y */
db = 0;
if (db) get_client_regions(&req0, &mod0, &cpy0, &ncli); if (db) get_client_regions(&req0, &mod0, &cpy0, &ncli);
i = rfbGetClientIterator(screen); i = rfbGetClientIterator(screen);
@ -5605,6 +5616,9 @@ int try_to_fix_resize_su(Window orig_frame, int orig_x, int orig_y, int orig_w,
if (!orig_frame || !orig_x || !orig_y || !orig_w || !orig_h || !x || !y || !w || !h || !try_batch) {} if (!orig_frame || !orig_x || !orig_y || !orig_w || !orig_h || !x || !y || !w || !h || !try_batch) {}
return 0; return 0;
} }
void set_ncache_xrootpmap(void) {
return;
}
#else #else
/* maybe ncache.c it if works */ /* maybe ncache.c it if works */
@ -6673,7 +6687,7 @@ fprintf(stderr, "free_rect: bad index: %d\n", idx);
if (w * h > fac2 * (dpy_x * dpy_y)) { if (w * h > fac2 * (dpy_x * dpy_y)) {
big2 = 1; big2 = 1;
} }
/* XXX Y */
if (nobigs < 0) { if (nobigs < 0) {
if (getenv("NOBIGS")) { if (getenv("NOBIGS")) {
nobigs = 1; nobigs = 1;
@ -7965,12 +7979,38 @@ sraRegionPtr idx_create_rgn(sraRegionPtr r0, int idx) {
return rtmp; return rtmp;
} }
void scale_mark_xrootpmap(void) {
char *dst_fb, *src_fb = main_fb;
int dst_bpl, Bpp = bpp/8, fac = 1;
int yn = (ncache+1) * dpy_y;
int yfac = (ncache+2);
int mark = 1;
if (!scaling || !rfb_fb || rfb_fb == main_fb) {
mark_rect_as_modified(0, yn, dpy_x, yn + dpy_y, 0);
return;
}
if (cmap8to24 && cmap8to24_fb) {
src_fb = cmap8to24_fb;
if (scaling && depth == 8) {
fac = 4;
}
}
dst_fb = rfb_fb;
dst_bpl = rfb_bytes_per_line;
scale_rect(scale_fac, scaling_blend, scaling_interpolate, fac * Bpp,
src_fb, fac * main_bytes_per_line, dst_fb, dst_bpl, dpy_x, yfac * dpy_y,
scaled_x, yfac * scaled_y, 0, yn, dpy_x, yn + dpy_y, mark);
}
void set_ncache_xrootpmap(void) { void set_ncache_xrootpmap(void) {
Atom pmap, type; Atom pmap, type;
int format; int format;
unsigned long length, after; unsigned long length, after;
XImage *image = NULL; XImage *image = NULL;
XErrorHandler old_handler;
RAWFB_RET_VOID RAWFB_RET_VOID
#if !NO_X11 #if !NO_X11
@ -7978,6 +8018,8 @@ void set_ncache_xrootpmap(void) {
return; return;
} }
X_LOCK; X_LOCK;
old_handler = XSetErrorHandler(trap_xerror);
trapped_xerror = 0;
pmap = XInternAtom(dpy, "_XROOTPMAP_ID", True); pmap = XInternAtom(dpy, "_XROOTPMAP_ID", True);
if (pmap != None) { if (pmap != None) {
Pixmap pixmap; Pixmap pixmap;
@ -7992,6 +8034,12 @@ void set_ncache_xrootpmap(void) {
image = XGetImage(dpy, pixmap, 0, 0, dpy_x, dpy_y, AllPlanes, ZPixmap); image = XGetImage(dpy, pixmap, 0, 0, dpy_x, dpy_y, AllPlanes, ZPixmap);
} }
} }
if (!quiet) {
rfbLog("set_ncache_xrootpmap: loading background pixmap: 0x%lx\n", pixmap);
}
} else {
rfbLog("set_ncache_xrootpmap: trying root background\n");
} }
if (image == NULL) { if (image == NULL) {
image = solid_root((char *) 0x1); image = solid_root((char *) 0x1);
@ -8011,10 +8059,12 @@ void set_ncache_xrootpmap(void) {
dst += main_bytes_per_line; dst += main_bytes_per_line;
} }
XDestroyImage(image); XDestroyImage(image);
scale_mark_xrootpmap();
} else { } else {
int yn = (ncache+1) * dpy_y; int yn = (ncache+1) * dpy_y;
zero_fb(0, yn, dpy_x, yn + dpy_y); zero_fb(0, yn, dpy_x, yn + dpy_y);
} }
XSetErrorHandler(old_handler);
X_UNLOCK; X_UNLOCK;
#endif #endif
} }
@ -8229,7 +8279,7 @@ fprintf(stderr, "----- skip %s\n", Etype(type));
*n_in = n; *n_in = n;
} }
int try_to_synthesize_su(int force, int *nbatch) { int try_to_synthesize_su(int force, int urgent, int *nbatch) {
int i, idx, idx2, n = 0; int i, idx, idx2, n = 0;
sraRegionPtr r0, r1, r2; sraRegionPtr r0, r1, r2;
Window win = None; Window win = None;
@ -8246,12 +8296,30 @@ int try_to_synthesize_su(int force, int *nbatch) {
X_LOCK; X_LOCK;
for (i = old_stack_n - 1; i >= 0; i--) { for (i = old_stack_n - 1; i >= 0; i--) {
win = old_stack[i]; win = old_stack[i];
if (!valid_window(win, &attr, 1)) { if (urgent) { /* XXX Y resp */
continue; if (!valid_window(win, &attr, 1)) {
} continue;
idx = lookup_win_index(win); }
if (idx >= 0) { idx = lookup_win_index(win);
STORE(idx, win, attr); if (idx >= 0) {
STORE(idx, win, attr);
}
} else {
idx = lookup_win_index(win);
if (idx >= 0) {
attr.map_state = cache_list[idx].map_state;
attr.x = cache_list[idx].x;
attr.y = cache_list[idx].y;
attr.width = cache_list[idx].width;
attr.height = cache_list[idx].height;
} else {
attr.map_state = IsUnmapped;
attr.x = 0;
attr.y = 0;
attr.width = 0;
attr.height = 0;
}
} }
if (attr.map_state != IsViewable) { if (attr.map_state != IsViewable) {
continue; continue;
@ -8384,6 +8452,7 @@ static int saw_desktop_change = 0;
void check_sched(int try_batch, int *did_sched) { void check_sched(int try_batch, int *did_sched) {
static double last_root = 0.0; static double last_root = 0.0;
static double last_pixmap = 0.0;
double refresh = 60.0; double refresh = 60.0;
int i, k, valid; int i, k, valid;
Window win; Window win;
@ -8504,10 +8573,12 @@ fprintf(stderr, "*SCHED LOOKUP FAIL: i=%d 0x%lx\n", i, win);
} else if (now > last_sched_vis + 3.0 && now > last_wireframe + 2.0) { } else if (now > last_sched_vis + 3.0 && now > last_wireframe + 2.0) {
static double last_vis = 0.0; static double last_vis = 0.0;
int vis_now[32], top_now[32]; int vis_now[32], top_now[32];
static int vis_prev[32]; static int vis_prev[32], freq = 0;
int diff, nv = 32, vis_now_n = 0; int diff, nv = 32, vis_now_n = 0;
Window win; Window win;
freq++;
for (i=0; i < cache_list_num; i++) { for (i=0; i < cache_list_num; i++) {
int ok = 0; int ok = 0;
int top_only = 1; int top_only = 1;
@ -8524,10 +8595,13 @@ fprintf(stderr, "*SCHED LOOKUP FAIL: i=%d 0x%lx\n", i, win);
if (win == None) { if (win == None) {
continue; continue;
} }
if (!valid_window(win, &attr, 1)) { /* XXX Y resp */
continue; if (saw_desktop_change || freq % 5 == 0) {
if (!valid_window(win, &attr, 1)) {
continue;
}
STORE(i, win, attr);
} }
STORE(i, win, attr);
if (!cache_list[i].valid) { if (!cache_list[i].valid) {
continue; continue;
} }
@ -8596,7 +8670,7 @@ fprintf(stderr, "*VIS BS_save: 0x%lx %d %d %d\n", win, cache_list[i].width, cac
saw_desktop_change = 0; saw_desktop_change = 0;
} }
/* XXX Y */ /* XXX Y */
try_to_synthesize_su(0, bat); try_to_synthesize_su(0, 0, bat);
} }
if (nr) { if (nr) {
@ -8604,6 +8678,19 @@ fprintf(stderr, "*VIS BS_save: 0x%lx %d %d %d\n", win, cache_list[i].width, cac
} }
last_sched_bs = dnow(); last_sched_bs = dnow();
} }
#if !NO_X11
if (atom_XROOTPMAP_ID == None && now > last_pixmap + 5.0) {
atom_XROOTPMAP_ID = XInternAtom(dpy, "_XROOTPMAP_ID", True);
last_pixmap = now;
}
#endif
if (got_XROOTPMAP_ID > 0.0) {
fprintf(stderr, "got_XROOTPMAP_ID\n");
if (ncache_xrootpmap) {
set_ncache_xrootpmap();
}
got_XROOTPMAP_ID = 0.0;
}
} }
int check_ncache(int reset, int mode) { int check_ncache(int reset, int mode) {
@ -8637,6 +8724,11 @@ int check_ncache(int reset, int mode) {
int skipwins_max = 256; int skipwins_max = 256;
Window skipwins[256]; Window skipwins[256];
static char *dt_guess = NULL;
static double dt_last = 0.0;
int dt_gnome = 0, gnome_animation = 0;
int dt_kde = 0;
if (unixpw_in_progress) return -1; if (unixpw_in_progress) return -1;
#ifdef MACOSX #ifdef MACOSX
@ -8703,7 +8795,6 @@ if (c) fprintf(stderr, "check_ncache purged %d events\n", c);
rfbLog("check_ncache: resetting cache\n"); rfbLog("check_ncache: resetting cache\n");
for (i=0; i < cache_list_num; i++) { for (i=0; i < cache_list_num; i++) {
free_rect(i); free_rect(i);
CLEAR(i);
} }
for (n = 1; n <= ncache; n++) { for (n = 1; n <= ncache; n++) {
if (rect_reg[n] != NULL) { if (rect_reg[n] != NULL) {
@ -8807,6 +8898,19 @@ if (hack_val == 2) {
n = 0; n = 0;
ttot = 0; ttot = 0;
if (dt_guess == NULL || now > dt_last + 30) {
if (dt_guess) {
free(dt_guess);
}
dt_guess = strdup(guess_desktop());
dt_last = now;
}
if (dt_guess && !strcmp(dt_guess, "gnome")) {
dt_gnome = 1;
} else if (dt_guess && !strcmp(dt_guess, "kde")) {
dt_kde = 1;
}
ev_store(None, EV_RESET); ev_store(None, EV_RESET);
X_LOCK; X_LOCK;
@ -9190,11 +9294,29 @@ fprintf(stderr, " CONF_IGNORE: Too many stacking changes: 0x%lx\n", win
} }
} }
if (ok) {
if (ev_lookup(ev.xconfigure.above, EV_UNMAP)) {
fprintf(stderr, " skip try_to_fix_su for GNOME deiconify #1\n");
if (dt_gnome) {
gnome_animation = 1;
}
ok = 0;
}
}
if (ok && dt_gnome) {
if (valid_window(ev.xconfigure.above, &attr, 1)) {
if (attr.map_state != IsViewable) {
fprintf(stderr, " skip try_to_fix_su for GNOME deiconify #2\n");
gnome_animation = 1;
ok = 0;
}
}
}
if (ok) { if (ok) {
int rc = try_to_fix_su(win, idx, ev.xconfigure.above, nbatch, NULL); int rc = try_to_fix_su(win, idx, ev.xconfigure.above, nbatch, NULL);
if (rc == 0 && su_fix_cnt == 0 && n_MN == 0 && n_UN == 0) { if (rc == 0 && su_fix_cnt == 0 && n_MN == 0 && n_UN == 0) {
X_UNLOCK; X_UNLOCK;
try_to_synthesize_su(1, nbatch); try_to_synthesize_su(1, 1, nbatch);
X_LOCK; X_LOCK;
} }
n_ST++; n_ST++;
@ -9232,6 +9354,37 @@ fprintf(stderr, "----%02d: VisibilityNotify 0x%lx %3d state: %s U/P %d/%d\n",
ok = 0; ok = 0;
} else if (ev_lookup(win, EV_DESTROY)) { } else if (ev_lookup(win, EV_DESTROY)) {
ok = 0; ok = 0;
} else if (gnome_animation) {
ok = 0;
} else {
/* this is for gnome iconify */
int i2;
for (i2=i+1; i2 < n; i2++) {
int idx2, ik2 = Ev_order[i2];
sraRegionPtr ro1, ro2;
Window win2 = Ev_unmap[ik2];
if (win2 == None) {
continue;
}
idx2 = lookup_win_index(win2);
if (idx2 < 0) {
continue;
}
ro1 = idx_create_rgn(r0, idx);
ro2 = idx_create_rgn(r0, idx2);
if (sraRgnAnd(ro1, ro2)) {
fprintf(stderr, " skip VisibilityUnobscured for GNOME iconify.\n");
ok = 0;
}
sraRgnDestroy(ro1);
sraRgnDestroy(ro2);
if (! ok) {
break;
}
}
} }
if (ok) { if (ok) {
int x2, y2, w2, h2; int x2, y2, w2, h2;

@ -39,5 +39,7 @@ extern void do_copyregion(sraRegionPtr region, int dx, int dy, int mode);
extern int check_ncache(int reset, int mode); extern int check_ncache(int reset, int mode);
extern int find_rect(int idx, int x, int y, int w, int h); extern int find_rect(int idx, int x, int y, int w, int h);
extern int lookup_win_index(Window);
extern void set_ncache_xrootpmap(void);
#endif /* _X11VNC_USERINPUT_H */ #endif /* _X11VNC_USERINPUT_H */

@ -2,7 +2,7 @@
.TH X11VNC "1" "January 2007" "x11vnc " "User Commands" .TH X11VNC "1" "January 2007" "x11vnc " "User Commands"
.SH NAME .SH NAME
x11vnc - allow VNC connections to real X11 displays x11vnc - allow VNC connections to real X11 displays
version: 0.8.4, lastmod: 2007-01-09 version: 0.8.4, lastmod: 2007-01-10
.SH SYNOPSIS .SH SYNOPSIS
.B x11vnc .B x11vnc
[OPTION]... [OPTION]...
@ -2448,6 +2448,12 @@ In \fB-ncache\fR mode, do not try to guess when the desktop
workarea). The default is to try to guess and when workarea). The default is to try to guess and when
detected try to make the transistion more smoothly. detected try to make the transistion more smoothly.
.PP .PP
\fB-ncache_no_rootpixmap\fR
.IP
In \fB-ncache\fR mode, do not try to snapshot the desktop
background to use in guessing or reconstructing window
save-unders..
.PP
\fB-ncache_pad\fR \fIn\fR \fB-ncache_pad\fR \fIn\fR
.IP .IP
In \fB-ncache\fR mode, pad each window with n pixels for the In \fB-ncache\fR mode, pad each window with n pixels for the
@ -4020,9 +4026,19 @@ ncache_cr enable \fB-ncache_cr\fR mode.
.IP .IP
noncache_cr disable \fB-ncache_cr\fR mode. noncache_cr disable \fB-ncache_cr\fR mode.
.IP .IP
ncache_no_moveraise enable no_moveraise mode. ncache_no_moveraise enable no_moveraise mode.
.IP
noncache_no_moveraise disable no_moveraise mode.
.IP
ncache_no_dtchange enable ncache_no_dtchange mode.
.IP
noncache_no_dtchange disable ncache_no_dtchange mode.
.IP
ncache_no_rootpixmap enable ncache_no_rootpixmap.
.IP
noncache_no_rootpixmap disable ncache_no_rootpixmap.
.IP .IP
noncache_no_moveraise disable no_moveraise mode. ncache_reset_rootpixmap recheck the root pixmap
.IP .IP
wireframe enable \fB-wireframe\fR mode. same as "wf" wireframe enable \fB-wireframe\fR mode. same as "wf"
.IP .IP
@ -4300,29 +4316,31 @@ clear_keys noclear_keys remap repeat norepeat fb nofb
bell nobell sel nosel primary noprimary setprimary bell nobell sel nosel primary noprimary setprimary
nosetprimary clipboard noclipboard setclipboard nosetprimary clipboard noclipboard setclipboard
nosetclipboard seldir cursorshape nocursorshape nosetclipboard seldir cursorshape nocursorshape
cursorpos nocursorpos cursor_drag nocursor_drag cursorpos nocursorpos cursor_drag nocursor_drag cursor
cursor show_cursor noshow_cursor nocursor arrow show_cursor noshow_cursor nocursor arrow xfixes
xfixes noxfixes xdamage noxdamage xd_area xd_mem noxfixes xdamage noxdamage xd_area xd_mem alphacut
alphacut alphafrac alpharemove noalpharemove alphablend alphafrac alpharemove noalpharemove alphablend
noalphablend xwarppointer xwarp noxwarppointer noxwarp noalphablend xwarppointer xwarp noxwarppointer
buttonmap dragging nodragging ncache_cr noncache_cr noxwarp buttonmap dragging nodragging ncache_cr
ncache_no_moveraise noncache_no_moveraise ncache noncache_cr ncache_no_moveraise noncache_no_moveraise
noncache ncache_size wireframe_mode wireframe wf ncache_no_dtchange noncache_no_dtchange
nowireframe nowf wireframelocal wfl nowireframelocal ncache_no_rootpixmap noncache_no_rootpixmap
nowfl wirecopyrect wcr nowirecopyrect nowcr scr_area ncache_reset_rootpixmap ncache noncache ncache_size
scr_skip scr_inc scr_keys scr_term scr_keyrepeat wireframe_mode wireframe wf nowireframe nowf
scr_parms scrollcopyrect scr noscrollcopyrect noscr wireframelocal wfl nowireframelocal nowfl wirecopyrect
fixscreen noxrecord xrecord reset_record pointer_mode wcr nowirecopyrect nowcr scr_area scr_skip scr_inc
pm input_skip allinput noallinput input grabkbd scr_keys scr_term scr_keyrepeat scr_parms scrollcopyrect
nograbkbd grabptr nograbptr client_input ssltimeout scr noscrollcopyrect noscr fixscreen noxrecord xrecord
speeds wmdt debug_pointer dp nodebug_pointer nodp reset_record pointer_mode pm input_skip allinput
debug_keyboard dk nodebug_keyboard nodk deferupdate noallinput input grabkbd nograbkbd grabptr nograbptr
defer wait_ui wait_bog nowait_bog slow_fb wait client_input ssltimeout speeds wmdt debug_pointer dp
readtimeout nap nonap sb screen_blank fbpm nofbpm nodebug_pointer nodp debug_keyboard dk nodebug_keyboard
dpms nodpms fs gaps grow fuzz snapfb nosnapfb rawfb nodk deferupdate defer wait_ui wait_bog nowait_bog
uinput_accel uinput_thresh uinput_reset uinput_always slow_fb wait readtimeout nap nonap sb screen_blank
progressive rfbport http nohttp httpport httpdir fbpm nofbpm dpms nodpms fs gaps grow fuzz snapfb
enablehttpproxy noenablehttpproxy alwaysshared nosnapfb rawfb uinput_accel uinput_thresh uinput_reset
uinput_always progressive rfbport http nohttp httpport
httpdir enablehttpproxy noenablehttpproxy alwaysshared
noalwaysshared nevershared noalwaysshared dontdisconnect noalwaysshared nevershared noalwaysshared dontdisconnect
nodontdisconnect desktop debug_xevents nodebug_xevents nodontdisconnect desktop debug_xevents nodebug_xevents
debug_xevents debug_xdamage nodebug_xdamage debug_xevents debug_xdamage nodebug_xdamage

@ -2171,6 +2171,8 @@ int main(int argc, char* argv[]) {
ncache_wf_raises = 1; ncache_wf_raises = 1;
} else if (!strcmp(arg, "-ncache_no_dtchange")) { } else if (!strcmp(arg, "-ncache_no_dtchange")) {
ncache_dt_change = 0; ncache_dt_change = 0;
} else if (!strcmp(arg, "-ncache_no_rootpixmap")) {
ncache_xrootpmap = 0;
} else if (!strcmp(arg, "-ncache_pad")) { } else if (!strcmp(arg, "-ncache_pad")) {
CHECK_ARGC CHECK_ARGC
ncache_pad = atoi(argv[++i]); ncache_pad = atoi(argv[++i]);

@ -467,6 +467,7 @@ extern double last_copyrect_fix;
extern double last_wireframe; extern double last_wireframe;
extern double servertime_diff; extern double servertime_diff;
extern double x11vnc_start; extern double x11vnc_start;
extern double g_now;
extern double last_get_wm_frame_time; extern double last_get_wm_frame_time;
extern Window last_get_wm_frame; extern Window last_get_wm_frame;

@ -15,7 +15,7 @@ int xtrap_base_event_type = 0;
int xdamage_base_event_type = 0; int xdamage_base_event_type = 0;
/* date +'lastmod: %Y-%m-%d' */ /* date +'lastmod: %Y-%m-%d' */
char lastmod[] = "0.8.4 lastmod: 2007-01-09"; char lastmod[] = "0.8.4 lastmod: 2007-01-10";
/* X display info */ /* X display info */
@ -131,6 +131,7 @@ double last_copyrect_fix = 0.0;
double last_wireframe = 0.0; double last_wireframe = 0.0;
double servertime_diff = 0.0; double servertime_diff = 0.0;
double x11vnc_start = 0.0; double x11vnc_start = 0.0;
double g_now = 0.0;
double last_get_wm_frame_time = 0.0; double last_get_wm_frame_time = 0.0;
Window last_get_wm_frame = None; Window last_get_wm_frame = None;

@ -542,6 +542,8 @@ if (0) XEventsQueued(dpy, QueuedAfterFlush);
int xdamage_hint_skip(int y) { int xdamage_hint_skip(int y) {
static sraRegionPtr scanline = NULL; static sraRegionPtr scanline = NULL;
static sraRegionPtr tmpl_y = NULL;
int fast_tmpl = 1;
sraRegionPtr reg, tmpl; sraRegionPtr reg, tmpl;
int ret, i, n, nreg; int ret, i, n, nreg;
static int ncache_no_skip = 0; static int ncache_no_skip = 0;
@ -559,13 +561,16 @@ int xdamage_hint_skip(int y) {
/* keep it around to avoid malloc etc, recreate */ /* keep it around to avoid malloc etc, recreate */
scanline = sraRgnCreate(); scanline = sraRgnCreate();
} }
if (! tmpl_y) {
tmpl_y = sraRgnCreateRect(0, 0, dpy_x, 1);
}
nreg = (xdamage_memory * NSCAN) + 1; nreg = (xdamage_memory * NSCAN) + 1;
#ifndef NO_NCACHE #ifndef NO_NCACHE
if (ncache > 0) { if (ncache > 0) {
if (ncache_no_skip == 0) { if (ncache_no_skip == 0) {
double now = dnow(); double now = g_now;
if (now > last_ncache_no_skip + 8.0) { if (now > last_ncache_no_skip + 8.0) {
ncache_no_skip = 1; ncache_no_skip = 1;
} else if (now < last_bs_restore + 0.5) { } else if (now < last_bs_restore + 0.5) {
@ -595,7 +600,12 @@ int xdamage_hint_skip(int y) {
} }
#endif #endif
tmpl = sraRgnCreateRect(0, y, dpy_x, y+1); if (fast_tmpl) {
sraRgnOffset(tmpl_y, 0, y);
tmpl = tmpl_y;
} else {
tmpl = sraRgnCreateRect(0, y, dpy_x, y+1);
}
ret = 1; ret = 1;
for (i=0; i<nreg; i++) { for (i=0; i<nreg; i++) {
@ -616,7 +626,11 @@ int xdamage_hint_skip(int y) {
break; break;
} }
} }
sraRgnDestroy(tmpl); if (fast_tmpl) {
sraRgnOffset(tmpl_y, 0, -y);
} else {
sraRgnDestroy(tmpl);
}
if (0) fprintf(stderr, "xdamage_hint_skip: %d -> %d\n", y, ret); if (0) fprintf(stderr, "xdamage_hint_skip: %d -> %d\n", y, ret);
return ret; return ret;

@ -602,13 +602,16 @@ void sync_tod_with_servertime(void) {
RAWFB_RET_VOID RAWFB_RET_VOID
if (atom_NET_ACTIVE_WINDOW == None) { if (atom_NET_ACTIVE_WINDOW == None) {
atom_NET_ACTIVE_WINDOW = XInternAtom(dpy, "_NET_ACTIVE_WINDOW", False); atom_NET_ACTIVE_WINDOW = XInternAtom(dpy, "_NET_ACTIVE_WINDOW", True);
} }
if (atom_NET_CURRENT_DESKTOP == None) { if (atom_NET_CURRENT_DESKTOP == None) {
atom_NET_CURRENT_DESKTOP = XInternAtom(dpy, "_NET_CURRENT_DESKTOP", False); atom_NET_CURRENT_DESKTOP = XInternAtom(dpy, "_NET_CURRENT_DESKTOP", True);
} }
if (atom_NET_CLIENT_LIST_STACKING == None) { if (atom_NET_CLIENT_LIST_STACKING == None) {
atom_NET_CLIENT_LIST_STACKING = XInternAtom(dpy, "_NET_CLIENT_LIST_STACKING", False); atom_NET_CLIENT_LIST_STACKING = XInternAtom(dpy, "_NET_CLIENT_LIST_STACKING", True);
}
if (atom_XROOTPMAP_ID == None) {
atom_XROOTPMAP_ID = XInternAtom(dpy, "_XROOTPMAP_ID", True);
} }
if (! ticker_atom) { if (! ticker_atom) {
@ -755,6 +758,7 @@ void set_prop_atom(Atom atom) {
if (atom == atom_NET_ACTIVE_WINDOW) got_NET_ACTIVE_WINDOW = dnow(); if (atom == atom_NET_ACTIVE_WINDOW) got_NET_ACTIVE_WINDOW = dnow();
if (atom == atom_NET_CURRENT_DESKTOP) got_NET_CURRENT_DESKTOP = dnow(); if (atom == atom_NET_CURRENT_DESKTOP) got_NET_CURRENT_DESKTOP = dnow();
if (atom == atom_NET_CLIENT_LIST_STACKING) got_NET_CLIENT_LIST_STACKING = dnow(); if (atom == atom_NET_CLIENT_LIST_STACKING) got_NET_CLIENT_LIST_STACKING = dnow();
if (atom == atom_XROOTPMAP_ID) got_XROOTPMAP_ID = dnow();
} }
/* /*

@ -418,6 +418,9 @@ void zero_fb(int x1, int y1, int x2, int y2) {
#ifndef NO_NCACHE #ifndef NO_NCACHE
if (ncache > 0) { if (ncache > 0) {
yfac = 1+ncache; yfac = 1+ncache;
if (ncache_xrootpmap) {
yfac++;
}
} }
#endif #endif

@ -25,6 +25,7 @@ extern int known_xrandr_mode(char *s);
if (check_xrandr_event(y)) { \ if (check_xrandr_event(y)) { \
trapped_getimage_xerror = 0; \ trapped_getimage_xerror = 0; \
XSetErrorHandler(old_getimage_handler); \ XSetErrorHandler(old_getimage_handler); \
X_UNLOCK; \
return(x); \ return(x); \
} \ } \
} }

Loading…
Cancel
Save