} else if (strstr(winfo.res_name, "onsole")) { which = CURS_TERM; } else if (strstr(winfo.res_class, "onsole")) { which = CURS_TERM;
int get_which_cursor(void) {	int which = CURS_ARROW;	if (show_multiple_cursors) {		int depth;		static win_str_info_t winfo;		static int first = 1, depth_cutoff = -1;		Window win;		XErrorHandler old_handler;		int mode = 0;		if (drag_in_progress || button_mask) {			return -1;		}		if (!strcmp(multiple_cursors_mode, "arrow")) {			/* should not happen... */			return CURS_ARROW;		} else if (!strcmp(multiple_cursors_mode, "default")) {			mode = 0;		} else if (!strcmp(multiple_cursors_mode, "X")) {			mode = 1;		} else if (!strcmp(multiple_cursors_mode, "some")) {			mode = 2;		} else if (!strcmp(multiple_cursors_mode, "most")) {			mode = 3;		}		if (mode == 3 && xfixes_present && use_xfixes) {			return get_xfixes_cursor(0);		}		if (depth_cutoff < 0) {			int din;			if (sscanf(multiple_cursors_mode, "X%d", &din) == 1) {				depth_cutoff = din;			} else {				depth_cutoff = 0;			}		}		if (first) {			winfo.wm_name   = (char *) malloc(1024);			winfo.res_name  = (char *) malloc(1024);			winfo.res_class = (char *) malloc(1024);		}		first = 0;				tree_descend_cursor(&depth, &win, &winfo);		if (depth <= depth_cutoff && !subwin) {			which = CURS_ROOT;		} else if (mode == 2 || mode == 3) {			int which0 = which;			/* apply crude heuristics to choose a cursor... */			if (win) {				int ratio = 10, x, y;				unsigned int w, h, bw, d;  				Window r;				trapped_xerror = 0;				X_LOCK;				old_handler = XSetErrorHandler(trap_xerror);				/* "narrow" windows are WM */				if (XGetGeometry(dpy, win, &r, &x, &y, &w, &h,				    &bw, &d)) {					if (w > ratio * h || h > ratio * w) {						which = CURS_WM;					}				}				XSetErrorHandler(old_handler);				X_UNLOCK;				trapped_xerror = 0;			}			if (which == which0) {				/* the string "term" mean I-beam. */				lowercase(winfo.res_name);				lowercase(winfo.res_class);				if (strstr(winfo.res_name, "term")) {					which = CURS_TERM;				} else if (strstr(winfo.res_class, "term")) {					which = CURS_TERM;				} else if (strstr(winfo.res_name, "text")) {					which = CURS_TERM;				} else if (strstr(winfo.res_class, "text")) {					which = CURS_TERM;				}			}		}	}	return which;}