diff options
author | runge <runge> | 2007-01-10 19:28:46 +0000 |
---|---|---|
committer | runge <runge> | 2007-01-10 19:28:46 +0000 |
commit | 7717d245af144d36662e6884592277570dea17b5 (patch) | |
tree | 2698748e9190b43a210946508601b9eecd71630c /x11vnc/scan.c | |
parent | 5b3e420c1f092fc8d83ad1803621007bb942d4dd (diff) | |
download | libvncserver-7717d245af144d36662e6884592277570dea17b5.zip libvncserver-7717d245af144d36662e6884592277570dea17b5.tar.gz |
some -ncache performance improvements, rootpixmap watching, gnome wm heuristics
Diffstat (limited to 'x11vnc/scan.c')
-rw-r--r-- | x11vnc/scan.c | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/x11vnc/scan.c b/x11vnc/scan.c index a05d063..62bfe13 100644 --- a/x11vnc/scan.c +++ b/x11vnc/scan.c @@ -2846,11 +2846,15 @@ static int scan_display(int ystart, int rescan) { y = ystart; + g_now = dnow(); + if (! main_fb) { rfbLog("scan_display: no main_fb!\n"); return 0; } + X_LOCK; + while (y < dpy_y) { if (use_xdamage) { @@ -2863,7 +2867,6 @@ static int scan_display(int ystart, int rescan) { } /* grab the horizontal scanline from the display: */ - X_LOCK; #ifndef NO_NCACHE /* XXX Y test */ @@ -2878,12 +2881,18 @@ if (ncache > 0) { XEvent ev; if (raw_fb_str) { ; + } else if (XEventsQueued(dpy, QueuedAlready) == 0) { + ; /* XXX Y resp */ } else if (XCheckTypedEvent(dpy, MapNotify, &ev)) { gotone = 1; } else if (XCheckTypedEvent(dpy, UnmapNotify, &ev)) { gotone = 2; } else if (XCheckTypedEvent(dpy, CreateNotify, &ev)) { gotone = 3; + } else if (XCheckTypedEvent(dpy, ConfigureNotify, &ev)) { + gotone = 4; + } else if (XCheckTypedEvent(dpy, VisibilityNotify, &ev)) { + gotone = 5; } if (gotone) { 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"); copy_image(scanline, 0, y, 0, 0); XRANDR_CHK_TRAP_RET(-1, "scan_display-chk"); - X_UNLOCK; /* for better memory i/o try the whole line at once */ src = scanline->data; @@ -2979,6 +2987,9 @@ fprintf(stderr, "\n*** SCAN_DISPLAY CHECK_NCACHE/%d *** %d rescan=%d\n", gotone, } y += NSCAN; } + + X_UNLOCK; + return tile_count; } |