diff --git a/x11vnc/README b/x11vnc/README index c62ac76..b305f13 100644 --- a/x11vnc/README +++ b/x11vnc/README @@ -1,5 +1,5 @@ -x11vnc README file Date: Wed Jan 31 10:08:11 EST 2007 +x11vnc README file Date: Wed Jan 31 11:51:38 EST 2007 The following information is taken from these URLs: diff --git a/x11vnc/keyboard.c b/x11vnc/keyboard.c index 5f16a78..7f3793a 100644 --- a/x11vnc/keyboard.c +++ b/x11vnc/keyboard.c @@ -15,6 +15,7 @@ #include "linuxfb.h" #include "uinput.h" #include "macosx.h" +#include "screen.h" void get_keystate(int *keystate); void clear_modifiers(int init); diff --git a/x11vnc/pointer.c b/x11vnc/pointer.c index 3663819..66c7241 100644 --- a/x11vnc/pointer.c +++ b/x11vnc/pointer.c @@ -16,6 +16,7 @@ #include "uinput.h" #include "scan.h" #include "macosx.h" +#include "screen.h" int pointer_queued_sent = 0; diff --git a/x11vnc/screen.c b/x11vnc/screen.c index 44b7b98..8486853 100644 --- a/x11vnc/screen.c +++ b/x11vnc/screen.c @@ -847,6 +847,7 @@ static void initialize_snap_fb(void) { rfbClient* client = NULL; void vnc_reflect_bell(rfbClient *cl) { + if (cl) {} if (sound_bell) { if (unixpw_in_progress) { return; @@ -863,6 +864,7 @@ void vnc_reflect_bell(rfbClient *cl) { } void vnc_reflect_recv_cuttext(rfbClient *cl, const char *str, int len) { + if (cl) {} if (unixpw_in_progress) { return; } @@ -877,6 +879,7 @@ void vnc_reflect_recv_cuttext(rfbClient *cl, const char *str, int len) { } void vnc_reflect_got_update(rfbClient *cl, int x, int y, int w, int h) { + if (cl) {} if (use_xdamage) { static int first = 1; if (first) { @@ -890,12 +893,12 @@ void vnc_reflect_got_update(rfbClient *cl, int x, int y, int w, int h) { void vnc_reflect_got_cursorshape(rfbClient *cl, int xhot, int yhot, int width, int height, int bytesPerPixel) { static int serial = 1; int i, j; - char *bitmap, *rich, *alpha; char *pixels = NULL; - unsigned long r, g, b, a; - unsigned int ui; + unsigned long r, g, b; + unsigned int ui = 0; unsigned long red_mask, green_mask, blue_mask; + if (cl) {} if (unixpw_in_progress) { return; } @@ -959,6 +962,7 @@ void vnc_reflect_got_copyrect(rfbClient *cl, int src_x, int src_y, int w, int h, sraRegionPtr reg; int dx, dy, rc = -1; static int last_dx = 0, last_dy = 0; + if (cl) {} if (unixpw_in_progress) { return; } @@ -1051,11 +1055,11 @@ char *vnc_reflect_guess(char *str, char **raw_fb_addr) { red_mask = (client->format.redMax << client->format.redShift); green_mask = (client->format.greenMax << client->format.greenShift); blue_mask = (client->format.blueMax << client->format.blueShift); - sprintf(str2, "map:/dev/null@%dx%dx%d:0x%x/0x%x/0x%x", + sprintf(str2, "map:/dev/null@%dx%dx%d:0x%lx/0x%lx/0x%lx", client->width, client->height, client->format.bitsPerPixel, red_mask, green_mask, blue_mask); } - *raw_fb_addr = client->frameBuffer; + *raw_fb_addr = (char *) client->frameBuffer; free(str0); if (first) { @@ -1071,7 +1075,6 @@ char *vnc_reflect_guess(char *str, char **raw_fb_addr) { } rfbBool vnc_reflect_send_pointer(int x, int y, int mask) { - rfbBool ret; int rc; if (mask >= 0) { got_user_input++; @@ -1106,7 +1109,6 @@ rfbBool vnc_reflect_send_cuttext(char *str, int len) { void vnc_reflect_process_client(void) { int num; - rfbBool save; if (client == NULL) { return; } diff --git a/x11vnc/solid.c b/x11vnc/solid.c index deb83b6..9fb2562 100644 --- a/x11vnc/solid.c +++ b/x11vnc/solid.c @@ -155,8 +155,6 @@ XImage *solid_root(char *color) { XSetWindowAttributes swa; Visual visual; static unsigned long mask, pixel = 0; - XColor cdef; - Colormap cmap; RAWFB_RET(NULL) diff --git a/x11vnc/userinput.c b/x11vnc/userinput.c index 6a86d2e..3e6c581 100644 --- a/x11vnc/userinput.c +++ b/x11vnc/userinput.c @@ -3153,8 +3153,10 @@ static int try_copyrect(Window orig_frame, Window frame, int x, int y, int w, in } if (db2) fprintf(stderr, "try_copyrect: 0x%lx/0x%lx bad: %d stack_list_num: %d\n", orig_frame, frame, dt_bad, stack_list_num); +#if 0 /* XXX Y */ //dt_bad = 0; +#endif if (dt_bad && wireframe_in_progress) { sraRegionPtr rect; @@ -3784,7 +3786,7 @@ void ncache_pre_portions(Window orig_frame, Window frame, int *nidx_in, int try_ dx = 0; dy = dpy_y; sraRgnOffset(r2, dx, dy); -//fprintf(stderr, "FB_COPY: %.4f 1) offscreen check:\n", dnow() - ntim); +if (0) fprintf(stderr, "FB_COPY: %.4f 1) offscreen check:\n", dnow() - ntim); /* 0) save it in the invalid (offscreen) SU portion */ if (! *use_batch) { @@ -3809,11 +3811,11 @@ void ncache_pre_portions(Window orig_frame, Window frame, int *nidx_in, int try_ dy = bs_y - y; sraRgnOffset(r1, dx, dy); -//fprintf(stderr, "FB_COPY: %.4f 1) use tmp bs:\n", dnow() - ntim); +if (0) fprintf(stderr, "FB_COPY: %.4f 1) use tmp bs:\n", dnow() - ntim); if (! *use_batch) { do_copyregion(r1, dx, dy, 0); if (! fb_push_wait(0.2, FB_COPY)) { -//fprintf(stderr, "FB_COPY: %.4f 1) FAILED.\n", dnow() - ntim); +if (0) fprintf(stderr, "FB_COPY: %.4f 1) FAILED.\n", dnow() - ntim); fb_push_wait(0.1, FB_COPY); } } else { @@ -3844,7 +3846,7 @@ void ncache_post_portions(int nidx, int use_batch, int orig_x, int orig_y, int o int bs_h = cache_list[nidx].bs_h; int some_su = 0; -//fprintf(stderr, "su: %dx%d+%d+%d bs: %dx%d+%d+%d\n", su_w, su_h, su_x, su_y, bs_w, bs_h, bs_x, bs_y); +if (0) fprintf(stderr, "su: %dx%d+%d+%d bs: %dx%d+%d+%d\n", su_w, su_h, su_x, su_y, bs_w, bs_h, bs_x, bs_y); if (bs_x < 0) { if (!find_rect(nidx, x, y, w, h)) { @@ -3912,13 +3914,13 @@ void ncache_post_portions(int nidx, int use_batch, int orig_x, int orig_y, int o dx = orig_x - su_x; dy = orig_y - su_y; -//fprintf(stderr, "FB_COPY: %.4f 3) sent_copyrect: su_restore: %d %d\n", dnow() - ntim, dx, dy); +if (0) fprintf(stderr, "FB_COPY: %.4f 3) sent_copyrect: su_restore: %d %d\n", dnow() - ntim, dx, dy); if (cache_list[nidx].su_time == 0.0) { ; } else if (! use_batch) { do_copyregion(r1, dx, dy, 0); if (!fb_push_wait(0.2, FB_COPY)) { -//fprintf(stderr, "FB_COPY: %.4f 3) FAILED.\n", dnow() - ntim); +if (0) fprintf(stderr, "FB_COPY: %.4f 3) FAILED.\n", dnow() - ntim); fb_push_wait(0.1, FB_COPY); } } else { @@ -3926,7 +3928,7 @@ void ncache_post_portions(int nidx, int use_batch, int orig_x, int orig_y, int o batch_dys[NPP_nreg] = dy; batch_reg[NPP_nreg++] = sraRgnCreateRgn(r1); } -//fprintf(stderr, "sent_copyrect: %.4f su_restore: done.\n", dnow() - ntim); +if (0) fprintf(stderr, "sent_copyrect: %.4f su_restore: done.\n", dnow() - ntim); sraRgnDestroy(r0); sraRgnDestroy(r1); sraRgnDestroy(r2); @@ -3953,11 +3955,11 @@ void ncache_post_portions(int nidx, int use_batch, int orig_x, int orig_y, int o dx = dx - dx2; dy = dy - dy2; -//fprintf(stderr, "FB_COPY: %.4f 4) move overlap inside su:\n", dnow() - ntim); +if (0) fprintf(stderr, "FB_COPY: %.4f 4) move overlap inside su:\n", dnow() - ntim); if (! use_batch) { do_copyregion(r3, dx, dy, 0); if (!fb_push_wait(0.2, FB_COPY)) { -//fprintf(stderr, "FB_COPY: %.4f 4) FAILED.\n", dnow() - ntim); +if (0) fprintf(stderr, "FB_COPY: %.4f 4) FAILED.\n", dnow() - ntim); fb_push_wait(0.1, FB_COPY); } } else { @@ -3984,11 +3986,11 @@ void ncache_post_portions(int nidx, int use_batch, int orig_x, int orig_y, int o sraRgnSubtract(r1, r3); sraRgnDestroy(r3); } -//fprintf(stderr, "FB_COPY: %.4f 5) move tmp bs to su:\n", dnow() - ntim); +if (0) fprintf(stderr, "FB_COPY: %.4f 5) move tmp bs to su:\n", dnow() - ntim); if (! use_batch) { do_copyregion(r1, dx, dy, 0); if (!fb_push_wait(0.2, FB_COPY)) { -//fprintf(stderr, "FB_COPY: %.4f 5) FAILED.\n", dnow() - ntim); +if (0) fprintf(stderr, "FB_COPY: %.4f 5) FAILED.\n", dnow() - ntim); fb_push_wait(0.1, FB_COPY); } } else { @@ -4008,11 +4010,11 @@ void ncache_post_portions(int nidx, int use_batch, int orig_x, int orig_y, int o dx = bs_x - x; dy = bs_y - y; sraRgnOffset(r1, dx, dy); -//fprintf(stderr, "FB_COPY: %.4f 6) snapshot bs:\n", dnow() - ntim); +if (0) fprintf(stderr, "FB_COPY: %.4f 6) snapshot bs:\n", dnow() - ntim); if (! use_batch) { do_copyregion(r1, dx, dy, 0); if (!fb_push_wait(0.2, FB_COPY)) { -//fprintf(stderr, "FB_COPY: %.4f 6) FAILED.\n", dnow() - ntim); +if (0) fprintf(stderr, "FB_COPY: %.4f 6) FAILED.\n", dnow() - ntim); fb_push_wait(0.1, FB_COPY); } } else { @@ -4172,7 +4174,7 @@ if (0) fprintf(stderr, "FAW orig_frame unmapped.\n"); void check_macosx_click_frame(void) { #ifdef MACOSX if (macosx_console) { -//fprintf(stderr, "macosx_click_frame: 0x%x\n", macosx_click_frame); +if (0) fprintf(stderr, "macosx_click_frame: 0x%x\n", macosx_click_frame); check_macosx_iconify(macosx_click_frame, None, 0); macosx_click_frame = None; if (button_mask && !macosx_checkevent(NULL)) { @@ -4297,6 +4299,7 @@ int check_wireframe(void) { DB_SET if (unixpw_in_progress) return 0; + if (copyrect_drag_delay) {} #ifdef MACOSX if (macosx_console) { @@ -4690,7 +4693,7 @@ if (db) fprintf(stderr, "FRAME MOVE 1st-dt: %.3f\n", first_dt_ave/n); int drawit = 0; if (x != box_x || y != box_y) { /* moved since last */ -//fprintf(stderr, "DRAW1 %d %d\n", x - box_x, y - box_y); +if (0) fprintf(stderr, "DRAW1 %d %d\n", x - box_x, y - box_y); drawit = 1; } else if (w != box_w || h != box_h) { /* resize since last */ @@ -5832,7 +5835,7 @@ int lookup_win_index(Window win) { int k2 = recidx[k]; if (cache_list[k2].win == win) { idx = k2; -//fprintf(stderr, "recentA(shortcut): %d 0x%x\n", idx, win); +if (0) fprintf(stderr, "recentA(shortcut): %d 0x%x\n", idx, win); s1++; break; } @@ -5846,7 +5849,7 @@ int lookup_win_index(Window win) { } if (cache_list[k].win == win) { idx = k; -//fprintf(stderr, "recentB(normal): %d 0x%x\n", idx, win); +if (0) fprintf(stderr, "recentB(normal): %d 0x%x\n", idx, win); s2++; break; } @@ -6854,7 +6857,7 @@ fprintf(stderr, ">>**--**>> found rect via GRID: %dx%d+%d+%d -- %d %d\n", w, h, fr_FAILt++; return 0; } else { - //fprintf(stderr, ">>**--**>> found rect: %dx%d+%d+%d -- %d %d\n", w, h, x, y, x_hit, y_hit); + if (0) fprintf(stderr, ">>**--**>> found rect: %dx%d+%d+%d -- %d %d\n", w, h, x, y, x_hit, y_hit); } if (zero_rects) { @@ -6965,7 +6968,7 @@ int clipped(int idx) { r2 = sraRgnCreateRect(xc, yc, xc+wc, yc+hc); sraRgnAnd(r2, r0); if (sraRgnAnd(r2, r1)) { -//fprintf(stderr, "clip[0x%x]: 0x%x, %d/%d\n", win, cache_list[idx2].win, ic, idx2); +if (0) fprintf(stderr, "clip[0x%x]: 0x%x, %d/%d\n", win, cache_list[idx2].win, ic, idx2); clip = 1; } sraRgnDestroy(r2); @@ -6975,7 +6978,7 @@ int clipped(int idx) { } sraRgnDestroy(r0); sraRgnDestroy(r1); -//fprintf(stderr, "clip[0x%x]: %s\n", win, clip ? "clipped" : "no-clipped"); +if (0) fprintf(stderr, "clip[0x%x]: %s\n", win, clip ? "clipped" : "no-clipped"); return clip; } @@ -6985,7 +6988,7 @@ void clip_region(sraRegionPtr r, Window win) { for (ic = old_stack_n - 1; ic >= 0; ic--) { int xc, yc, wc, hc; -//fprintf(stderr, "----[0x%x]: 0x%x, %d %d\n", win, old_stack[ic], ic, old_stack_mapped[ic]); +if (0) fprintf(stderr, "----[0x%x]: 0x%x, %d %d\n", win, old_stack[ic], ic, old_stack_mapped[ic]); if (old_stack[ic] == win) { break; } @@ -7009,7 +7012,7 @@ void clip_region(sraRegionPtr r, Window win) { r1 = sraRgnCreateRect(xc, yc, xc+wc, yc+hc); if (sraRgnAnd(r1, r)) { sraRgnSubtract(r, r1); -//fprintf(stderr, "clip[0x%x]: 0x%x, %d/%d\n", win, cache_list[idx2].win, ic, idx2); +if (0) fprintf(stderr, "clip[0x%x]: 0x%x, %d/%d\n", win, cache_list[idx2].win, ic, idx2); } sraRgnDestroy(r1); } @@ -8374,7 +8377,7 @@ int try_to_synthesize_su(int force, int urgent, int *nbatch) { if (attr.map_state != IsViewable) { continue; } -//fprintf(stderr, "win: 0x%lx %d idx=%d\n", win, i, idx); +if (0) fprintf(stderr, "win: 0x%lx %d idx=%d\n", win, i, idx); x2 = attr.x; y2 = attr.y; @@ -9823,7 +9826,9 @@ fprintf(stderr, "----%02d: MapNotify 0x%lx %3d\n", ik, win, idx); continue; } +#if 0 // if (cache_list[idx].map_state == IsUnmapped || desktop_change || macosx_console) +#endif if (1) { X_UNLOCK; if (desktop_change) { @@ -9921,7 +9926,9 @@ fprintf(stderr, "----%02d: UnmapNotify 0x%lx %3d\n", ik, win, idx); } } +#if 0 // if (cache_list[idx].map_state == IsViewable || desktop_change || macosx_console) +#endif if (1) { X_UNLOCK; if (desktop_change) { diff --git a/x11vnc/xdamage.c b/x11vnc/xdamage.c index fb5e2b7..109492d 100644 --- a/x11vnc/xdamage.c +++ b/x11vnc/xdamage.c @@ -558,9 +558,11 @@ int xdamage_hint_skip(int y) { int fast_tmpl = 1; sraRegionPtr reg, tmpl; int ret, i, n, nreg; +#ifndef NO_NCACHE static int ncache_no_skip = 0; static double last_ncache_no_skip = 0.0; static double last_ncache_no_skip_long = 0.0, ncache_fac = 0.25; +#endif if (! xdamage_present || ! use_xdamage) { return 0; /* cannot skip */ diff --git a/x11vnc/xevents.c b/x11vnc/xevents.c index 8b85c79..fbf0c30 100644 --- a/x11vnc/xevents.c +++ b/x11vnc/xevents.c @@ -14,6 +14,7 @@ #include "unixpw.h" #include "cleanup.h" #include "macosx.h" +#include "screen.h" /* XXX CHECK BEFORE RELEASE */ int grab_buster = 0;