--- rxvt-unicode/src/command.C 2006/01/08 07:55:36 1.251 +++ rxvt-unicode/src/command.C 2006/01/13 04:59:04 1.259 @@ -869,7 +869,7 @@ } } - if (HOOK_INVOKE ((this, HOOK_KEY_PRESS, DT_XEVENT, &ev, DT_STR_LEN, kbuf, len, DT_END))) + if (HOOK_INVOKE ((this, HOOK_KEY_PRESS, DT_XEVENT, &ev, DT_INT, keysym, DT_STR_LEN, kbuf, len, DT_END))) return; if (len <= 0) @@ -989,15 +989,13 @@ { l = &ROW (row++); - if (l->f & LINE_FILTERED) - row++; - else + if (!(l->f & LINE_FILTERED)) { // line not filtered, mark it as filtered l->f |= LINE_FILTERED; while (l->is_longer ()) { - l = &ROW (++row); + l = &ROW (row++); l->f |= LINE_FILTERED; } @@ -1009,7 +1007,7 @@ } while (l->is_longer () && row < end_row); } - while (++row < end_row); + while (row < end_row); } scr_refresh (refresh_type); @@ -1315,6 +1313,10 @@ SET_R (this); SET_LOCALE (locale); + if (ev.xany.window == vt + && HOOK_INVOKE ((this, HOOK_X_EVENT, DT_XEVENT, &ev, DT_END))) + return; + Window unused_root, unused_child; int unused_root_x, unused_root_y; unsigned int unused_mask; @@ -1331,10 +1333,10 @@ case KeyRelease: { -#if (MOUSE_WHEEL && MOUSE_SLIP_WHEELING) || ISO_14755 - KeySym ks; +#if (MOUSE_WHEEL && MOUSE_SLIP_WHEELING) || ISO_14755 || ENABLE_PERL + KeySym keysym; - ks = XLookupKeysym (&ev.xkey, ev.xkey.state & ShiftMask ? 1 : 0); // sorry, only shift supported :/ + keysym = XLookupKeysym (&ev.xkey, ev.xkey.state & ShiftMask ? 1 : 0); // sorry, only shift supported :/ #endif #if ENABLE_FRILLS || ISO_14755 @@ -1349,16 +1351,16 @@ // iso14755 part 5.2 handling: release time // first: controls if ((ev.xkey.state & ControlMask) - && ((ks >= 0x40 && ks <= 0x5f) - || (ks >= 0x61 && ks <= 0x7f))) + && ((keysym >= 0x40 && keysym <= 0x5f) + || (keysym >= 0x61 && keysym <= 0x7f))) { - iso14755buf = ISO_14755_51 | 0x2400 | (ks & 0x1f); + iso14755buf = ISO_14755_51 | 0x2400 | (keysym & 0x1f); commit_iso14755 (); goto skip_switch; } for (unsigned short *i = iso14755_symtab; i[0]; i+= 2) - if (i[0] == ks) + if (i[0] == keysym) { iso14755buf = ISO_14755_51 | i[1]; commit_iso14755 (); @@ -1392,13 +1394,13 @@ #endif if (ev.xany.window == vt - && HOOK_INVOKE ((this, HOOK_KEY_RELEASE, DT_XEVENT, &ev, DT_END))) + && HOOK_INVOKE ((this, HOOK_KEY_RELEASE, DT_XEVENT, &ev, DT_INT, keysym, DT_END))) break; #if defined(MOUSE_WHEEL) && defined(MOUSE_SLIP_WHEELING) if (!(ev.xkey.state & ControlMask)) slip_wheel_ev.stop (); - else if (ks == XK_Control_L || ks == XK_Control_R) + else if (keysym == XK_Control_L || keysym == XK_Control_R) mouse_slip_wheel_speed = 0; #endif break; @@ -1575,7 +1577,7 @@ scr_expose (ev.xexpose.x, ev.xexpose.y, ev.xexpose.width, ev.xexpose.height, False); - scr_refresh (refresh_type); + want_refresh = 1; } else { @@ -1604,6 +1606,7 @@ break; case MotionNotify: + printf ("motion notify\n");//D #ifdef POINTER_BLANK if (hidden_pointer) pointer_unblank (); @@ -1712,7 +1715,7 @@ &unused_mask); scr_move_to (scrollbar_position (ev.xbutton.y) - csrO, scrollbar_size ()); - scr_refresh (refresh_type); + want_refresh = 1; refresh_limit = 0; scrollbar_show (1); } @@ -1924,7 +1927,7 @@ #endif /* allow shift+left click to extend selection */ - if (ev.state & ShiftMask && ! (priv_modes & PrivMode_mouse_report)) + if (ev.state & ShiftMask && !(priv_modes & PrivMode_mouse_report)) { if (MEvent.button == Button1 && clickintime) selection_rotate (ev.x, ev.y); @@ -2218,21 +2221,11 @@ else { # endif -# ifdef JUMP_MOUSE_WHEEL scr_page (v, i); - scr_refresh (SMOOTH_REFRESH); scrollbar_show (1); -# else - while (i--) - { - scr_page (v, 1); - scr_refresh (SMOOTH_REFRESH); - scrollbar_show (1); - } -# endif # ifdef MOUSE_SLIP_WHEELING } -#endif +# endif } break; #endif @@ -2836,7 +2829,7 @@ { flag = true; scr_refresh (refresh_type); - flush_ev.stop (); + want_refresh = 1; } } @@ -3872,9 +3865,9 @@ break; *name++ = '\0'; - color = atoi (buf); + color = atoi (buf) + minCOLOR; - if (color < 0 || color >= TOTAL_COLORS) + if (!IN_RANGE_INC (color, minCOLOR, maxTermCOLOR)) break; if ((buf = strchr (name, ';')) != NULL) @@ -3883,18 +3876,18 @@ if (name[0] == '?' && !name[1]) { unsigned short r, g, b; - pix_colors_focused[color + minCOLOR].get (display, r, g, b); + pix_colors_focused[color].get (display, r, g, b); tt_printf ("\033]%d;%d;rgb:%04x/%04x/%04x%c", XTerm_Color, color, r, g, b, resp); } else - set_window_color (color + minCOLOR, name); + set_window_color (color, name); } break; case XTerm_Color00: process_color_seq (XTerm_Color00, Color_fg, str, resp); break; case XTerm_Color01: - process_color_seq (XTerm_Color00, Color_bg, str, resp); + process_color_seq (XTerm_Color01, Color_bg, str, resp); break; #ifndef NO_CURSORCOLOR case XTerm_Color_cursor: @@ -3908,15 +3901,17 @@ process_color_seq (XTerm_Color_pointer_bg, Color_pointer_bg, str, resp); break; #ifndef NO_BOLD_UNDERLINE_REVERSE - case XTerm_Color_BD: - process_color_seq (XTerm_Color_BD, Color_BD, str, resp); - break; - case XTerm_Color_UL: - process_color_seq (XTerm_Color_UL, Color_UL, str, resp); - break; case XTerm_Color_RV: process_color_seq (XTerm_Color_RV, Color_RV, str, resp); break; + case Rxvt_Color_BD: + case URxvt_Color_BD: + process_color_seq (op, Color_BD, str, resp); + break; + case Rxvt_Color_UL: + case URxvt_Color_UL: + process_color_seq (op, Color_UL, str, resp); + break; case URxvt_Color_IT: process_color_seq (URxvt_Color_IT, Color_IT, str, resp); break; @@ -3930,15 +3925,16 @@ break; #endif - case XTerm_Pixmap: + case Rxvt_Pixmap: if (*str != ';') { #if XPM_BACKGROUND scale_pixmap (""); /* reset to default scaling */ set_bgPixmap (str); /* change pixmap */ -#endif scr_touch (true); +#endif } + while ((str = strchr (str, ';')) != NULL) { str++; @@ -3951,15 +3947,15 @@ { #ifdef XPM_BACKGROUND resize_pixmap (); -#endif scr_touch (true); +#endif } break; - case XTerm_restoreFG: + case Rxvt_restoreFG: set_window_color (Color_fg, str); break; - case XTerm_restoreBG: + case Rxvt_restoreBG: set_window_color (Color_bg, str); break; @@ -3974,7 +3970,7 @@ break; #endif #if 0 - case XTerm_dumpscreen: /* no error notices */ + case Rxvt_dumpscreen: /* no error notices */ { int fd; if ((fd = open (str, O_RDWR | O_CREAT | O_EXCL, 0600)) >= 0) @@ -4464,6 +4460,9 @@ void rxvt_term::tt_write (const char *data, unsigned int len) { + if (HOOK_INVOKE ((this, HOOK_TT_WRITE, DT_STR_LEN, data, len, DT_END))) + return; + if (pty.pty < 0) return;