xr_mouse = 0; } else if (skip_cr_when_scaling("scroll")) {
static void update_x11_pointer_mask(int mask) {	int snapped, xr_mouse = 1, i;	last_event = last_input = last_pointer_input = time(0);	if (raw_fb && ! dpy) return;	/* raw_fb hack */	if (mask != button_mask) {		last_pointer_click_time = dnow();	}	if (scaling && ! got_scrollcopyrect) {		xr_mouse = 0;	} else if (nofb) {		xr_mouse = 0;	} else if (!strcmp(scroll_copyrect, "never")) {		xr_mouse = 0;	} else if (!strcmp(scroll_copyrect, "keys")) {		xr_mouse = 0;	} else if (xrecord_skip_button(mask, button_mask)) {		xr_mouse = 0;	}	if (mask && use_xrecord && ! xrecording && xr_mouse) {		static int px, py, x, y, w, h, got_wm_frame;		static XWindowAttributes attr;		Window frame = None, mwin = None;		int skip = 0;		if (!button_mask) {			if (get_wm_frame_pos(&px, &py, &x, &y, &w, &h,			    &frame, &mwin)) {				got_wm_frame = 1;if (debug_scroll > 1) fprintf(stderr, "wm_win: 0x%lx\n", mwin);				if (mwin != None) {					if (!valid_window(mwin, &attr, 1)) {						mwin = None;					}				}			} else {				got_wm_frame = 0;			}		}		if (got_wm_frame) {			if (wireframe && near_wm_edge(x, y, w, h, px, py)) {				/* step out of wireframe's way */				skip = 1;			} else {				int ok = 0;				int btn4 = (1<<3);				int btn5 = (1<<4);				if (near_scrollbar_edge(x, y, w, h, px, py)) {					ok = 1;				}				if (mask & (btn4|btn5)) {					/* scroll wheel mouse */					ok = 1;				}				if (mwin != None) {					/* skinny internal window */					int w = attr.width;					int h = attr.height;					if (h > 10 * w || w > 10 * h) {if (debug_scroll > 1) fprintf(stderr, "internal scrollbar: %dx%d\n", w, h);						ok = 1;					}				}				if (! ok) {					skip = 1;				}			}		}		if (! skip) {			xrecord_watch(1, SCR_MOUSE);			snapshot_stack_list(0, 0.50);			snapped = 1;			if (button_mask) {				xrecord_set_by_mouse = 1;			} else {				update_stack_list();				xrecord_set_by_mouse = 2;			}		}	}	if (mask && !button_mask) {		/* button down, snapshot the stacking list before flushing */		if (wireframe && !wireframe_in_progress &&		    strcmp(wireframe_copyrect, "never")) {			if (! snapped) {				snapshot_stack_list(0, 0.0);			}		}	}	X_LOCK;	/* look for buttons that have be clicked or released: */	for (i=0; i < MAX_BUTTONS; i++) {	    if ( (button_mask & (1<<i)) != (mask & (1<<i)) ) {		if (debug_pointer) {			rfbLog("pointer(): mask change: mask: 0x%x -> "			    "0x%x button: %d\n", button_mask, mask,i+1);		}		do_button_mask_change(mask, i+1);	/* button # is i+1 */	    }	}	X_UNLOCK;	/*	 * Remember the button state for next time and also for the	 * -nodragging case:	 */	button_mask_prev = button_mask;	button_mask = mask;}