diff options
author | runge <runge> | 2006-11-21 22:16:23 +0000 |
---|---|---|
committer | runge <runge> | 2006-11-21 22:16:23 +0000 |
commit | 27a884d2f3775cf4d97ea8f3d7433cbe2deebbfc (patch) | |
tree | a4b7c9f0ae519b0afa0d14b646abca3ad01b35a8 /x11vnc/xdamage.c | |
parent | 05ba45f72e70b4372ef05a8aca34a3bddcfaeb71 (diff) | |
download | libvncserver-27a884d2f3775cf4d97ea8f3d7433cbe2deebbfc.zip libvncserver-27a884d2f3775cf4d97ea8f3d7433cbe2deebbfc.tar.gz |
x11vnc: Mac OS X fb fixes and cuttext, -nodpms option, local user wireframing
Diffstat (limited to 'x11vnc/xdamage.c')
-rw-r--r-- | x11vnc/xdamage.c | 31 |
1 files changed, 25 insertions, 6 deletions
diff --git a/x11vnc/xdamage.c b/x11vnc/xdamage.c index 7b8b9b2..27e6613 100644 --- a/x11vnc/xdamage.c +++ b/x11vnc/xdamage.c @@ -163,8 +163,8 @@ void add_region_xdamage(sraRegionPtr new_region) { } reg = xdamage_regions[prev_tick]; - if (reg != NULL) { -if (debug_xdamage > 1) fprintf(stderr, "add_region_xdamage: prev_tick: %d reg %p\n", prev_tick, (void *)reg); + if (reg != NULL && new_region != NULL) { +if (debug_xdamage > 1) fprintf(stderr, "add_region_xdamage: prev_tick: %d reg %p new_region %p\n", prev_tick, (void *)reg, (void *)new_region); sraRgnOr(reg, new_region); } } @@ -232,6 +232,9 @@ if (call && debug_xdamage > 1) fprintf(stderr, "collect_macosx_damage: %d %d %d if (! use_xdamage) { return 0; } + if (! xdamage_regions) { + return 0; + } dtime0(&tm); @@ -241,10 +244,15 @@ if (call && debug_xdamage > 1) fprintf(stderr, "collect_macosx_damage: %d %d %d xdamage_ticker = (xdamage_ticker+1) % nreg; xdamage_direct_count = 0; reg = xdamage_regions[xdamage_ticker]; - sraRgnMakeEmpty(reg); + if (reg != NULL) { + sraRgnMakeEmpty(reg); + } } else { reg = xdamage_regions[xdamage_ticker]; } + if (reg == NULL) { + return 0; + } if (x_in < 0) { return 0; @@ -288,8 +296,8 @@ if (call && debug_xdamage > 1) fprintf(stderr, "collect_macosx_damage: %d %d %d } 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" : ""); + " %d dups: %d %s reg: %p\n", w, h, x, y, w*h, dcount, + (w*h > xdamage_max_area) ? "TOO_BIG" : "", (void *)reg); } record_desired_xdamage_rect(x, y, w, h); @@ -365,6 +373,9 @@ int collect_xdamage(int scancnt, int call) { if (! xdamage_base_event_type) { return 0; } + if (! xdamage_regions) { + return 0; + } dtime0(&tm); @@ -374,10 +385,15 @@ int collect_xdamage(int scancnt, int call) { xdamage_ticker = (xdamage_ticker+1) % nreg; xdamage_direct_count = 0; reg = xdamage_regions[xdamage_ticker]; - sraRgnMakeEmpty(reg); + if (reg != NULL) { + sraRgnMakeEmpty(reg); + } } else { reg = xdamage_regions[xdamage_ticker]; } + if (reg == NULL) { + return 0; + } X_LOCK; @@ -549,6 +565,9 @@ int xdamage_hint_skip(int y) { /* go back thru the history starting at most recent */ n = (xdamage_ticker + nreg - i) % nreg; reg = xdamage_regions[n]; + if (reg == NULL) { + continue; + } if (sraRgnEmpty(reg)) { /* checking for emptiness is very fast */ continue; |