summaryrefslogtreecommitdiffstats
path: root/x11vnc/scan.c
diff options
context:
space:
mode:
authorrunge <runge>2006-12-17 23:34:25 +0000
committerrunge <runge>2006-12-17 23:34:25 +0000
commit8aa6fb9523957c7f4a3f14fb2c90ea9f9292a41f (patch)
tree82a97c679b609325b8df6c2c9a00a85525fde0a1 /x11vnc/scan.c
parent399a175f0bb44865cbf3d6762ad081e2a49cd4c4 (diff)
downloadlibtdevnc-8aa6fb9523957c7f4a3f14fb2c90ea9f9292a41f.tar.gz
libtdevnc-8aa6fb9523957c7f4a3f14fb2c90ea9f9292a41f.zip
x11vnc: first pass at client-side caching, -ncache option.
Diffstat (limited to 'x11vnc/scan.c')
-rw-r--r--x11vnc/scan.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/x11vnc/scan.c b/x11vnc/scan.c
index 7a8272c..6ad2402 100644
--- a/x11vnc/scan.c
+++ b/x11vnc/scan.c
@@ -2816,6 +2816,31 @@ static int scan_display(int ystart, int rescan) {
/* grab the horizontal scanline from the display: */
X_LOCK;
+
+#ifndef NO_NCACHE
+#if !NO_X11
+if (ncache > 0 && dpy) {
+ /* XXX watch for problems. */
+ XEvent ev;
+ int gotone = 0;
+ if (XCheckTypedEvent(dpy, MapNotify, &ev)) {
+ gotone = 1;
+ } else if (XCheckTypedEvent(dpy, UnmapNotify, &ev)) {
+ gotone = 2;
+ } else if (XCheckTypedEvent(dpy, CreateNotify, &ev)) {
+ gotone = 3;
+ }
+ if (gotone) {
+ XPutBackEvent(dpy, &ev);
+ X_UNLOCK;
+fprintf(stderr, "*** SCAN_DISPLAY CHECK_NCACHE/%d *** %d\n", gotone, y);
+ check_ncache(0);
+ X_LOCK;
+ }
+}
+#endif
+#endif
+
XRANDR_SET_TRAP_RET(-1, "scan_display-set");
copy_image(scanline, 0, y, 0, 0);
XRANDR_CHK_TRAP_RET(-1, "scan_display-chk");