--- rxvt-unicode/src/command.C 2006/02/20 19:42:55 1.308 +++ rxvt-unicode/src/command.C 2007/05/28 18:38:03 1.323 @@ -1,4 +1,4 @@ -/*--------------------------------*-C-*---------------------------------* +/*----------------------------------------------------------------------* * File: command.C *----------------------------------------------------------------------* * @@ -502,6 +502,14 @@ # endif return; } + else if (keysym == XK_BackSpace) + { + iso14755buf = ((iso14755buf & ISO_14755_MASK) >> 4) | ISO_14755_51; +# if ISO_14755 + iso14755_51 (iso14755buf & ISO_14755_MASK); +# endif + return; + } else if ((hv = hex_keyval (ev)) >= 0) { iso14755buf = ((iso14755buf << 4) & ISO_14755_MASK) @@ -879,7 +887,7 @@ if (len <= 0) return; /* not mapped */ - if (OPTION (Opt_scrollTtyKeypress)) + if (option (Opt_scrollTtyKeypress)) if (view_start) { view_start = 0; @@ -1234,7 +1242,7 @@ { pty_ev.stop (); - if (!OPTION (Opt_hold)) + if (!option (Opt_hold)) destroy (); } @@ -1265,7 +1273,7 @@ #ifdef POINTER_BLANK hidden_pointer = 0; - if (OPTION (Opt_pointerBlank)) + if (option (Opt_pointerBlank)) pointer_ev.start (NOW + pointerBlankDelay); #endif } @@ -1274,7 +1282,7 @@ void rxvt_term::pointer_blank () { - if (!OPTION (Opt_pointerBlank)) + if (!option (Opt_pointerBlank)) return; XDefineCursor (dpy, vt, display->blank_cursor); @@ -1460,11 +1468,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 +1495,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 +1695,7 @@ } #if defined(CURSOR_BLINK) - if (OPTION (Opt_cursorBlink) && ev.type == KeyPress) + if (option (Opt_cursorBlink) && ev.type == KeyPress) { if (hidden_cursor) { @@ -1694,7 +1708,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 +1740,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 @@ -1736,6 +1750,19 @@ scr_recolour (); } #endif +#if ENABLE_FRILLS + if (option (Opt_urgentOnBell)) + { + XWMHints *h; + + h = XGetWMHints(dpy, parent[0]); + if (h != NULL) + { + h->flags &= ~XUrgencyHint; + XSetWMHints(dpy, parent[0], h); + } + } +#endif } } @@ -1763,7 +1790,7 @@ XUnsetICFocus (Input_Context); #endif #if CURSOR_BLINK - if (OPTION (Opt_cursorBlink)) + if (option (Opt_cursorBlink)) cursor_blink_ev.stop (); hidden_cursor = 0; #endif @@ -1777,12 +1804,30 @@ } } -#if TRANSPARENT +void +rxvt_term::update_fade_color (unsigned int idx) +{ +#if OFF_FOCUS_FADING + if (rs[Rs_fade]) + { + rgba c; + pix_colors [Color_fade].get (c); + pix_colors_focused [idx].fade (this, atoi (rs[Rs_fade]), pix_colors_unfocused [idx], c); + } +#endif +} + +#if TRANSPARENT || ENABLE_PERL void rxvt_term::rootwin_cb (XEvent &ev) { make_current (); + if (SHOULD_INVOKE (HOOK_ROOT_EVENT) + && HOOK_INVOKE ((this, HOOK_ROOT_EVENT, DT_XEVENT, &ev, DT_END))) + return; + +# if TRANSPARENT switch (ev.type) { case PropertyNotify: @@ -1796,10 +1841,11 @@ /* 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; } +# endif } #endif @@ -2137,7 +2183,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 @@ -2151,7 +2197,7 @@ if (ev.state & ShiftMask) i = 1; - else if (OPTION (Opt_mouseWheelScrollPage)) + else if (option (Opt_mouseWheelScrollPage)) i = nrow - 1; else i = 5; @@ -2432,7 +2478,7 @@ pchanged = 0; - if (!OPTION (Opt_transparent)) + if (!option (Opt_transparent)) return pchanged; /* Don't try any more */ XGetWindowAttributes (dpy, display->root, &wrootattr); @@ -2712,7 +2758,7 @@ refresh_count++; - if (!OPTION (Opt_jumpScroll) + if (!option (Opt_jumpScroll) || (refresh_count >= refresh_limit * (nrow - 1))) { refreshnow = true; @@ -2762,11 +2808,12 @@ */ if (refreshnow) { - if (OPTION (Opt_jumpScroll) && refresh_limit < REFRESH_PERIOD) + if (option (Opt_jumpScroll) && refresh_limit < REFRESH_PERIOD) refresh_limit++; else { flag = true; + //TODO: due to popular request, implement "skipscroll" option here scr_refresh (); want_refresh = 1; } @@ -3437,7 +3484,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 */ @@ -3611,7 +3658,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; @@ -3619,7 +3666,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; @@ -3656,6 +3703,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 */ @@ -3665,10 +3714,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'; @@ -3757,6 +3803,10 @@ dLocal (Display *, dpy); assert (str != NULL); + + if (HOOK_INVOKE ((this, HOOK_OSC_SEQ, DT_INT, op, DT_STR, str, DT_END))) + return; + switch (op) { case XTerm_name: @@ -3934,7 +3984,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 @@ -3958,7 +4008,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); @@ -3983,7 +4033,7 @@ #if ENABLE_PERL case URxvt_perl: - if (HOOK_INVOKE ((this, HOOK_OSC_SEQ, DT_STR, str, DT_END))) + if (HOOK_INVOKE ((this, HOOK_OSC_SEQ_PERL, DT_STR, str, DT_END))) ; // no responses yet break; #endif @@ -4109,7 +4159,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) @@ -4184,14 +4234,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;