if (client->viewOnly) {
if (client && client->viewOnly) {
static void modifier_tweak_keyboard(rfbBool down, rfbKeySym keysym,    rfbClientPtr client) {	KeyCode k;	int tweak = 0;	if (use_xkb_modtweak) {		xkb_tweak_keyboard(down, keysym, client);		return;	}	if (debug_keyboard) {		rfbLog("modifier_tweak_keyboard: %s keysym=0x%x\n",		    down ? "down" : "up", (int) keysym);	}	if (view_only) {		return;	}	if (client->viewOnly) {		return;	}#define ADJUSTMOD(sym, state) \	if (keysym == sym) { \		if (down) { \			mod_state |= state; \		} else { \			mod_state &= ~state; \		} \	}	ADJUSTMOD(XK_Shift_L, LEFTSHIFT)	ADJUSTMOD(XK_Shift_R, RIGHTSHIFT)	ADJUSTMOD(XK_Mode_switch, ALTGR)	if ( down && keysym >= ' ' && keysym < 0x100 ) {		tweak = 1;		tweak_mod(modifiers[keysym], True);		k = keycodes[keysym];	} else {		X_LOCK;		k = XKeysymToKeycode(dpy, (KeySym) keysym);		X_UNLOCK;	}	if (k == NoSymbol && add_keysyms && ! IsModifierKey(keysym)) {		int new_kc = add_keysym(keysym);		if (new_kc) {			k = new_kc;		}	}	if (debug_keyboard) {		rfbLog("modifier_tweak_keyboard: KeySym 0x%x \"%s\" -> "		    "KeyCode 0x%x%s\n", (int) keysym, XKeysymToString(keysym),		    (int) k, k ? "" : " *ignored*");	}	if ( k != NoSymbol ) {		X_LOCK;		XTestFakeKeyEvent_wr(dpy, k, (Bool) down, CurrentTime);		X_UNLOCK;	} 	if ( tweak ) {		tweak_mod(modifiers[keysym], False);	}}