Commit 3f0f799d authored by runge's avatar runge

x11vnc: remove build errors, get -ncache working on macosx again.

parent ca56c41c
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -133,7 +133,7 @@ void set_dpms_mode(char *mode) { ...@@ -133,7 +133,7 @@ void set_dpms_mode(char *mode) {
return; return;
} }
if (DPMSInfo(dpy, &level, &enabled)) { if (DPMSInfo(dpy, &level, &enabled)) {
char *from; char *from = "unk";
if (enabled && level != want) { if (enabled && level != want) {
XErrorHandler old_handler = XSetErrorHandler(trap_xerror); XErrorHandler old_handler = XSetErrorHandler(trap_xerror);
trapped_xerror = 0; trapped_xerror = 0;
......
...@@ -2867,7 +2867,8 @@ static int scan_display(int ystart, int rescan) { ...@@ -2867,7 +2867,8 @@ static int scan_display(int ystart, int rescan) {
xd_check = 0; xd_check = 0;
if (xdamage_hint_skip(y)) { if (xdamage_hint_skip(y)) {
if (xd_do_check && dpy && use_xdamage == 1) { if (xd_do_check && dpy && use_xdamage == 1) {
xd_tck = (xd_tck++) % xd_freq; xd_tck++;
xd_tck = xd_tck % xd_freq;
if (xd_tck == 0) { if (xd_tck == 0) {
xd_check = 1; xd_check = 1;
xd_samples++; xd_samples++;
...@@ -3164,7 +3165,7 @@ int scan_for_updates(int count_only) { ...@@ -3164,7 +3165,7 @@ int scan_for_updates(int count_only) {
SCAN_FATAL(tile_count); SCAN_FATAL(tile_count);
last_xd_check = time(NULL); last_xd_check = time(NULL);
if (xd_samples > 200) { if (xd_samples > 200) {
static bad = 0; static int bad = 0;
if (xd_misses > (5 * xd_samples) / 100) { if (xd_misses > (5 * xd_samples) / 100) {
rfbLog("XDAMAGE is not working well... misses: %d/%d\n", xd_misses, xd_samples); rfbLog("XDAMAGE is not working well... misses: %d/%d\n", xd_misses, xd_samples);
rfbLog("Maybe a OpenGL app like Beryl is the problem? Use -noxdamage\n"); rfbLog("Maybe a OpenGL app like Beryl is the problem? Use -noxdamage\n");
......
...@@ -13,6 +13,7 @@ ...@@ -13,6 +13,7 @@
#include "keyboard.h" #include "keyboard.h"
#include "cursor.h" #include "cursor.h"
#include "remote.h" #include "remote.h"
#include "avahi.h"
void check_switched_user(void); void check_switched_user(void);
void lurk_loop(char *str); void lurk_loop(char *str);
...@@ -1796,7 +1797,7 @@ if (db) fprintf(stderr, "%d -- %s -- %s\n", i, proc, buf); ...@@ -1796,7 +1797,7 @@ if (db) fprintf(stderr, "%d -- %s -- %s\n", i, proc, buf);
} }
} }
} }
if (7 <= vt && vt <= 128) { if (7 <= vt && vt <= 12) {
char chvt[100]; char chvt[100];
sprintf(chvt, "chvt %d >/dev/null 2>/dev/null &", vt); sprintf(chvt, "chvt %d >/dev/null 2>/dev/null &", vt);
rfbLog("running: %s\n", chvt); rfbLog("running: %s\n", chvt);
......
...@@ -21,6 +21,7 @@ ...@@ -21,6 +21,7 @@
#include "macosxCGS.h" #include "macosxCGS.h"
#include "cursor.h" #include "cursor.h"
#include "screen.h" #include "screen.h"
#include "connections.h"
/* /*
* user input handling heuristics * user input handling heuristics
...@@ -3153,11 +3154,7 @@ static int try_copyrect(Window orig_frame, Window frame, int x, int y, int w, in ...@@ -3153,11 +3154,7 @@ 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 (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 */
/* XXX Y */
//dt_bad = 0;
#endif
if (dt_bad && wireframe_in_progress) { if (dt_bad && wireframe_in_progress) {
sraRegionPtr rect; sraRegionPtr rect;
/* send the whole thing... */ /* send the whole thing... */
...@@ -5835,7 +5832,7 @@ int lookup_win_index(Window win) { ...@@ -5835,7 +5832,7 @@ int lookup_win_index(Window win) {
int k2 = recidx[k]; int k2 = recidx[k];
if (cache_list[k2].win == win) { if (cache_list[k2].win == win) {
idx = k2; idx = k2;
if (0) fprintf(stderr, "recentA(shortcut): %d 0x%x\n", idx, win); if (0) fprintf(stderr, "recentA(shortcut): %d 0x%lx\n", idx, win);
s1++; s1++;
break; break;
} }
...@@ -5849,7 +5846,7 @@ if (0) fprintf(stderr, "recentA(shortcut): %d 0x%x\n", idx, win); ...@@ -5849,7 +5846,7 @@ if (0) fprintf(stderr, "recentA(shortcut): %d 0x%x\n", idx, win);
} }
if (cache_list[k].win == win) { if (cache_list[k].win == win) {
idx = k; idx = k;
if (0) fprintf(stderr, "recentB(normal): %d 0x%x\n", idx, win); if (0) fprintf(stderr, "recentB(normal): %d 0x%lx\n", idx, win);
s2++; s2++;
break; break;
} }
...@@ -6968,7 +6965,7 @@ int clipped(int idx) { ...@@ -6968,7 +6965,7 @@ int clipped(int idx) {
r2 = sraRgnCreateRect(xc, yc, xc+wc, yc+hc); r2 = sraRgnCreateRect(xc, yc, xc+wc, yc+hc);
sraRgnAnd(r2, r0); sraRgnAnd(r2, r0);
if (sraRgnAnd(r2, r1)) { if (sraRgnAnd(r2, r1)) {
if (0) fprintf(stderr, "clip[0x%x]: 0x%x, %d/%d\n", win, cache_list[idx2].win, ic, idx2); if (0) fprintf(stderr, "clip[0x%lx]: 0x%lx, %d/%d\n", win, cache_list[idx2].win, ic, idx2);
clip = 1; clip = 1;
} }
sraRgnDestroy(r2); sraRgnDestroy(r2);
...@@ -6978,7 +6975,7 @@ if (0) fprintf(stderr, "clip[0x%x]: 0x%x, %d/%d\n", win, cache_list[idx2].win, i ...@@ -6978,7 +6975,7 @@ if (0) fprintf(stderr, "clip[0x%x]: 0x%x, %d/%d\n", win, cache_list[idx2].win, i
} }
sraRgnDestroy(r0); sraRgnDestroy(r0);
sraRgnDestroy(r1); sraRgnDestroy(r1);
if (0) fprintf(stderr, "clip[0x%x]: %s\n", win, clip ? "clipped" : "no-clipped"); if (0) fprintf(stderr, "clip[0x%lx]: %s\n", win, clip ? "clipped" : "no-clipped");
return clip; return clip;
} }
...@@ -6988,7 +6985,7 @@ void clip_region(sraRegionPtr r, Window win) { ...@@ -6988,7 +6985,7 @@ void clip_region(sraRegionPtr r, Window win) {
for (ic = old_stack_n - 1; ic >= 0; ic--) { for (ic = old_stack_n - 1; ic >= 0; ic--) {
int xc, yc, wc, hc; int xc, yc, wc, hc;
if (0) fprintf(stderr, "----[0x%x]: 0x%x, %d %d\n", win, old_stack[ic], ic, old_stack_mapped[ic]); if (0) fprintf(stderr, "----[0x%lx]: 0x%lx, %d %d\n", win, old_stack[ic], ic, old_stack_mapped[ic]);
if (old_stack[ic] == win) { if (old_stack[ic] == win) {
break; break;
} }
...@@ -7012,7 +7009,7 @@ if (0) fprintf(stderr, "----[0x%x]: 0x%x, %d %d\n", win, old_stack[ic], ic, old ...@@ -7012,7 +7009,7 @@ if (0) fprintf(stderr, "----[0x%x]: 0x%x, %d %d\n", win, old_stack[ic], ic, old
r1 = sraRgnCreateRect(xc, yc, xc+wc, yc+hc); r1 = sraRgnCreateRect(xc, yc, xc+wc, yc+hc);
if (sraRgnAnd(r1, r)) { if (sraRgnAnd(r1, r)) {
sraRgnSubtract(r, r1); sraRgnSubtract(r, r1);
if (0) fprintf(stderr, "clip[0x%x]: 0x%x, %d/%d\n", win, cache_list[idx2].win, ic, idx2); if (0) fprintf(stderr, "clip[0x%lx]: 0x%lx, %d/%d\n", win, cache_list[idx2].win, ic, idx2);
} }
sraRgnDestroy(r1); sraRgnDestroy(r1);
} }
...@@ -8066,7 +8063,7 @@ void set_ncache_xrootpmap(void) { ...@@ -8066,7 +8063,7 @@ void set_ncache_xrootpmap(void) {
if (use_solid_bg) { if (use_solid_bg) {
image = solid_image(NULL); image = solid_image(NULL);
} else if (pmap != None) { } else if (pmap != None) {
Pixmap pixmap; Pixmap pixmap = None;
unsigned char *d_pmap; unsigned char *d_pmap;
XGetWindowProperty(dpy, rootwin, pmap, 0L, 1L, False, XGetWindowProperty(dpy, rootwin, pmap, 0L, 1L, False,
...@@ -8792,13 +8789,15 @@ int check_ncache(int reset, int mode) { ...@@ -8792,13 +8789,15 @@ int check_ncache(int reset, int mode) {
if (! macosx_console) { if (! macosx_console) {
RAWFB_RET(-1) RAWFB_RET(-1)
} }
if (! screen) {
return -1;
}
#else #else
RAWFB_RET(-1) RAWFB_RET(-1)
#endif
if (! screen || ! dpy) { if (! screen || ! dpy) {
return -1; return -1;
} }
#endif
now = dnow(); now = dnow();
......
...@@ -16,6 +16,8 @@ ...@@ -16,6 +16,8 @@
#include "macosx.h" #include "macosx.h"
#include "screen.h" #include "screen.h"
#include "pm.h" #include "pm.h"
#include "pointer.h"
#include "remote.h"
/* XXX CHECK BEFORE RELEASE */ /* XXX CHECK BEFORE RELEASE */
int grab_buster = 0; int grab_buster = 0;
...@@ -1373,7 +1375,6 @@ void set_server_input(rfbClientPtr cl, int grab) { ...@@ -1373,7 +1375,6 @@ void set_server_input(rfbClientPtr cl, int grab) {
#endif #endif
} }
void set_text_chat(rfbClientPtr cl, int len, char *txt) { void set_text_chat(rfbClientPtr cl, int len, char *txt) {
char buf[100];
int dochat = 1; int dochat = 1;
rfbClientIteratorPtr iter; rfbClientIteratorPtr iter;
rfbClientPtr cl2; rfbClientPtr cl2;
...@@ -1393,14 +1394,15 @@ void set_text_chat(rfbClientPtr cl, int len, char *txt) { ...@@ -1393,14 +1394,15 @@ void set_text_chat(rfbClientPtr cl, int len, char *txt) {
} }
iter = rfbGetClientIterator(screen); iter = rfbGetClientIterator(screen);
while( (cl2 = rfbClientIteratorNext(iter)) ) { while( (cl2 = rfbClientIteratorNext(iter)) ) {
unsigned int ulen = (unsigned int) len;
if (cl2 == cl) { if (cl2 == cl) {
continue; continue;
} }
if (len == rfbTextChatOpen) { if (ulen == rfbTextChatOpen) {
rfbSendTextChatMessage(cl2, rfbTextChatOpen, ""); rfbSendTextChatMessage(cl2, rfbTextChatOpen, "");
} else if (len == rfbTextChatClose) { } else if (ulen == rfbTextChatClose) {
rfbSendTextChatMessage(cl2, rfbTextChatClose, ""); rfbSendTextChatMessage(cl2, rfbTextChatClose, "");
} else if (len == rfbTextChatFinished) { } else if (ulen == rfbTextChatFinished) {
rfbSendTextChatMessage(cl2, rfbTextChatFinished, ""); rfbSendTextChatMessage(cl2, rfbTextChatFinished, "");
} else if (len <= rfbTextMaxSize) { } else if (len <= rfbTextMaxSize) {
rfbSendTextChatMessage(cl2, len, txt); rfbSendTextChatMessage(cl2, len, txt);
...@@ -1410,6 +1412,7 @@ void set_text_chat(rfbClientPtr cl, int len, char *txt) { ...@@ -1410,6 +1412,7 @@ void set_text_chat(rfbClientPtr cl, int len, char *txt) {
} }
int get_keyboard_led_state_hook(rfbScreenInfoPtr s) { int get_keyboard_led_state_hook(rfbScreenInfoPtr s) {
if (s) {}
if (unixpw_in_progress) { if (unixpw_in_progress) {
rfbLog("get_keyboard_led_state_hook: unixpw_in_progress, skipping.\n"); rfbLog("get_keyboard_led_state_hook: unixpw_in_progress, skipping.\n");
return 0; return 0;
......
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