Commit 7717d245 authored by runge's avatar runge

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

parent 5b3e420c
This diff is collapsed.
...@@ -2079,6 +2079,10 @@ void print_help(int mode) { ...@@ -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"
...@@ -3346,6 +3350,11 @@ void print_help(int mode) { ...@@ -3346,6 +3350,11 @@ void print_help(int mode) {
" 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) { ...@@ -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; ...@@ -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; ...@@ -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; ...@@ -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) { ...@@ -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) { ...@@ -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) { ...@@ -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) { ...@@ -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, ...@@ -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, ...@@ -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) { ...@@ -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 {}} ...@@ -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 ...@@ -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[] = ""; ...@@ -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[] = ""; ...@@ -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"
......
This diff is collapsed.
...@@ -39,5 +39,7 @@ extern void do_copyregion(sraRegionPtr region, int dx, int dy, int mode); ...@@ -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 @@ ...@@ -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 ...@@ -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
...@@ -4024,6 +4030,16 @@ ncache_no_moveraise enable no_moveraise mode. ...@@ -4024,6 +4030,16 @@ ncache_no_moveraise enable no_moveraise mode.
.IP .IP
noncache_no_moveraise disable no_moveraise mode. noncache_no_moveraise disable no_moveraise mode.
.IP .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
ncache_reset_rootpixmap recheck the root pixmap
.IP
wireframe enable \fB-wireframe\fR mode. same as "wf" wireframe enable \fB-wireframe\fR mode. same as "wf"
.IP .IP
nowireframe disable \fB-wireframe\fR mode. same as "nowf" nowireframe disable \fB-wireframe\fR mode. same as "nowf"
...@@ -4300,29 +4316,31 @@ clear_keys noclear_keys remap repeat norepeat fb nofb ...@@ -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[]) { ...@@ -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; ...@@ -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; ...@@ -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; ...@@ -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); ...@@ -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) { ...@@ -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) { ...@@ -595,7 +600,12 @@ int xdamage_hint_skip(int y) {
} }
#endif #endif
if (fast_tmpl) {
sraRgnOffset(tmpl_y, 0, y);
tmpl = tmpl_y;
} else {
tmpl = sraRgnCreateRect(0, y, dpy_x, y+1); 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) { ...@@ -616,7 +626,11 @@ int xdamage_hint_skip(int y) {
break; break;
} }
} }
if (fast_tmpl) {
sraRgnOffset(tmpl_y, 0, -y);
} else {
sraRgnDestroy(tmpl); 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) { ...@@ -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) { ...@@ -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) { ...@@ -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); ...@@ -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); \
} \ } \
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment