--- rxvt-unicode/src/command.C 2006/07/06 23:48:11 1.314 +++ rxvt-unicode/src/command.C 2007/05/01 21:30:01 1.321 @@ -879,7 +879,7 @@ if (len <= 0) return; /* not mapped */ - if (OPTION (Opt_scrollTtyKeypress)) + if (option (Opt_scrollTtyKeypress)) if (view_start) { view_start = 0; @@ -1234,7 +1234,7 @@ { pty_ev.stop (); - if (!OPTION (Opt_hold)) + if (!option (Opt_hold)) destroy (); } @@ -1265,7 +1265,7 @@ #ifdef POINTER_BLANK hidden_pointer = 0; - if (OPTION (Opt_pointerBlank)) + if (option (Opt_pointerBlank)) pointer_ev.start (NOW + pointerBlankDelay); #endif } @@ -1274,7 +1274,7 @@ void rxvt_term::pointer_blank () { - if (!OPTION (Opt_pointerBlank)) + if (!option (Opt_pointerBlank)) return; XDefineCursor (dpy, vt, display->blank_cursor); @@ -1460,11 +1460,17 @@ break; case FocusIn: - focus_in (); + if (ev.xfocus.detail != NotifyInferior + && ev.xfocus.detail != NotifyPointer + && ev.xfocus.mode != NotifyGrab) + focus_in (); break; case FocusOut: - focus_out (); + if (ev.xfocus.detail != NotifyInferior + && ev.xfocus.detail != NotifyPointer + && ev.xfocus.mode != NotifyGrab) + focus_out (); break; case ConfigureNotify: @@ -1481,8 +1487,8 @@ HOOK_INVOKE ((this, HOOK_CONFIGURE_NOTIFY, DT_XEVENT, &ev, DT_END)); -#ifdef TRANSPARENT /* XXX: maybe not needed - leave in for now */ - if (OPTION (Opt_transparent)) +#ifdef TRANSPARENT + if (option (Opt_transparent)) check_our_parents (); #endif } @@ -1681,7 +1687,7 @@ } #if defined(CURSOR_BLINK) - if (OPTION (Opt_cursorBlink) && ev.type == KeyPress) + if (option (Opt_cursorBlink) && ev.type == KeyPress) { if (hidden_cursor) { @@ -1694,7 +1700,7 @@ #endif #if defined(POINTER_BLANK) - if (OPTION (Opt_pointerBlank) && pointerBlankDelay > 0) + if (option (Opt_pointerBlank) && pointerBlankDelay > 0) { if (ev.type == MotionNotify || ev.type == ButtonPress @@ -1726,7 +1732,7 @@ } #endif #if CURSOR_BLINK - if (OPTION (Opt_cursorBlink)) + if (option (Opt_cursorBlink)) cursor_blink_ev.start (NOW + CURSOR_BLINK_INTERVAL); #endif #if OFF_FOCUS_FADING @@ -1763,7 +1769,7 @@ XUnsetICFocus (Input_Context); #endif #if CURSOR_BLINK - if (OPTION (Opt_cursorBlink)) + if (option (Opt_cursorBlink)) cursor_blink_ev.stop (); hidden_cursor = 0; #endif @@ -1814,7 +1820,7 @@ /* FALLTHROUGH */ case ReparentNotify: - if (OPTION (Opt_transparent) && check_our_parents () && am_transparent) + if (option (Opt_transparent) && check_our_parents () && am_transparent) want_refresh = want_full_refresh = 1; break; } @@ -2156,7 +2162,7 @@ case Button2: if (IN_RANGE_EXC (ev.x, 0, width) && IN_RANGE_EXC (ev.y, 0, height)) // inside window? - selection_request (ev.time, ev.state & ModMetaMask ? Sel_Primary : Sel_Primary); + selection_request (ev.time, ev.state & ModMetaMask ? Sel_Clipboard : Sel_Primary); break; #ifdef MOUSE_WHEEL @@ -2170,7 +2176,7 @@ if (ev.state & ShiftMask) i = 1; - else if (OPTION (Opt_mouseWheelScrollPage)) + else if (option (Opt_mouseWheelScrollPage)) i = nrow - 1; else i = 5; @@ -2451,7 +2457,7 @@ pchanged = 0; - if (!OPTION (Opt_transparent)) + if (!option (Opt_transparent)) return pchanged; /* Don't try any more */ XGetWindowAttributes (dpy, display->root, &wrootattr); @@ -2731,7 +2737,7 @@ refresh_count++; - if (!OPTION (Opt_jumpScroll) + if (!option (Opt_jumpScroll) || (refresh_count >= refresh_limit * (nrow - 1))) { refreshnow = true; @@ -2781,7 +2787,7 @@ */ if (refreshnow) { - if (OPTION (Opt_jumpScroll) && refresh_limit < REFRESH_PERIOD) + if (option (Opt_jumpScroll) && refresh_limit < REFRESH_PERIOD) refresh_limit++; else { @@ -3457,7 +3463,7 @@ scr_report_position (); break; case 7: /* unofficial extension */ - if (OPTION (Opt_insecure)) + if (option (Opt_insecure)) tt_printf ("%-.250s\012", rs[Rs_display_name]); break; case 8: /* unofficial extension */ @@ -3631,7 +3637,7 @@ { char *s; XGetIconName (dpy, parent[0], &s); - tt_printf ("\033]L%-.250s\234", OPTION (Opt_insecure) && s ? s : ""); /* 8bit ST */ + tt_printf ("\033]L%-.250s\234", option (Opt_insecure) && s ? s : ""); /* 8bit ST */ XFree (s); } break; @@ -3639,7 +3645,7 @@ { char *s; XFetchName (dpy, parent[0], &s); - tt_printf ("\033]l%-.250s\234", OPTION (Opt_insecure) && s ? s : ""); /* 8bit ST */ + tt_printf ("\033]l%-.250s\234", option (Opt_insecure) && s ? s : ""); /* 8bit ST */ XFree (s); } break; @@ -3676,6 +3682,8 @@ } else if (ch == C0_BEL || ch == CHAR_ST) break; + else if (ch == C0_SYN) + ch = cmd_get8 (); else if (ch < 0x20) return NULL; /* other control character - exit */ @@ -3685,10 +3693,7 @@ // stop at some sane length return NULL; - if (ch == C0_SYN) - string[n++] = cmd_get8 (); - else - string[n++] = ch; + string[n++] = ch; } string[n++] = '\0'; @@ -3958,7 +3963,7 @@ #endif if (query) tt_printf ("\33]%d;%-.250s%c", saveop, - OPTION (Opt_insecure) && fontset[op - URxvt_font]->fontdesc + option (Opt_insecure) && fontset[op - URxvt_font]->fontdesc ? fontset[op - URxvt_font]->fontdesc : "", resp); else @@ -3982,7 +3987,7 @@ #if !ENABLE_MINIMAL case URxvt_locale: if (query) - tt_printf ("\33]%d;%-.250s%c", op, OPTION (Opt_insecure) ? locale : "", resp); + tt_printf ("\33]%d;%-.250s%c", op, option (Opt_insecure) ? locale : "", resp); else { set_locale (str); @@ -4133,7 +4138,7 @@ #endif case 1048: /* alternative cursor save */ case 1049: - if (OPTION (Opt_secondaryScreen)) + if (option (Opt_secondaryScreen)) if (mode == 0) scr_cursor (RESTORE); else if (mode == 1) @@ -4208,14 +4213,14 @@ set_option (Opt_scrollTtyKeypress, state); break; case 1047: /* secondary screen w/ clearing last */ - if (OPTION (Opt_secondaryScreen)) + if (option (Opt_secondaryScreen)) if (current_screen != PRIMARY) scr_erase_screen (2); scr_change_screen (state); break; case 1049: /* secondary screen w/ clearing first */ scr_change_screen (state); - if (OPTION (Opt_secondaryScreen)) + if (option (Opt_secondaryScreen)) if (current_screen != PRIMARY) scr_erase_screen (2); break;