--- rxvt-unicode/src/command.C 2003/12/18 14:11:47 1.23 +++ rxvt-unicode/src/command.C 2004/01/29 23:31:45 1.32 @@ -1,7 +1,7 @@ /*--------------------------------*-C-*---------------------------------* * File: command.c *----------------------------------------------------------------------* - * $Id: command.C,v 1.23 2003/12/18 14:11:47 pcg Exp $ + * $Id: command.C,v 1.32 2004/01/29 23:31:45 pcg Exp $ * * All portions of code are copyright by their respective author/s. * Copyright (c) 1992 John Bovey, University of Kent at Canterbury @@ -66,7 +66,7 @@ static int debug_key = 1; /* accessible by a debugger only */ #endif int valid_keysym; - unsigned char *kbuf = R->kbuf; + unsigned char kbuf[KBUFSZ]; /* * use Num_Lock to toggle Keypad on/off. If Num_Lock is off, allow an @@ -697,10 +697,6 @@ } XFlush (Xdisplay); -#if 0 - if (XPending (Xdisplay)) process_x_events (); - if (XPending (Xdisplay)) process_x_events (); -#endif } void @@ -722,8 +718,7 @@ XNextEvent (Xdisplay, &xev); #if defined(CURSOR_BLINK) - if ((Options & Opt_cursorBlink) - && xev.type == KeyPress) + if ((Options & Opt_cursorBlink) && xev.type == KeyPress) { if (hidden_cursor) { @@ -731,13 +726,12 @@ want_refresh = 1; } - blink_ev.start (NOW + BLINK_INTERVAL); + cursor_blink_ev.start (NOW + BLINK_INTERVAL); } #endif #if defined(POINTER_BLANK) - if ((Options & Opt_pointerBlank) - && (pointerBlankDelay > 0)) + if ((Options & Opt_pointerBlank) && pointerBlankDelay > 0) { if (xev.type == MotionNotify || xev.type == ButtonPress @@ -758,13 +752,29 @@ while (XPending (Xdisplay)); } +#ifdef CURSOR_BLINK void -rxvt_term::blink_cb (time_watcher &w) +rxvt_term::cursor_blink_cb (time_watcher &w) { - w.at += BLINK_INTERVAL; hidden_cursor = !hidden_cursor; want_refresh = 1; + + w.start (w.at + BLINK_INTERVAL); +} +#endif + +#ifdef TEXT_BLINK +void +rxvt_term::text_blink_cb (time_watcher &w) +{ + if (scr_refresh_rend (RS_Blink, RS_Blink)) + { + hidden_text = !hidden_text; + want_refresh = 1; + w.start (w.at + TEXT_BLINK_INTERVAL); + } } +#endif void rxvt_term::x_cb (io_watcher &w, short revents) @@ -1023,26 +1033,22 @@ #endif } +#ifdef POINTER_BLANK void rxvt_term::pointer_unblank () { XDefineCursor (Xdisplay, TermWin.vt, TermWin_cursor); recolour_cursor (); -#ifdef POINTER_BLANK hidden_pointer = 0; if (Options & Opt_pointerBlank) pointer_ev.start (NOW + pointerBlankDelay); -#endif } -#ifdef POINTER_BLANK void rxvt_term::pointer_blank () { - pointer_ev.stop (); - if (!(Options & Opt_pointerBlank)) return; @@ -1299,7 +1305,7 @@ #endif #ifdef CURSOR_BLINK if (R->Options & Opt_cursorBlink) - R->blink_ev.start (NOW + BLINK_INTERVAL); + R->cursor_blink_ev.start (NOW + BLINK_INTERVAL); #endif } break; @@ -1314,7 +1320,7 @@ #endif #ifdef CURSOR_BLINK if (R->Options & Opt_cursorBlink) - R->blink_ev.stop (); + R->cursor_blink_ev.stop (); R->hidden_cursor = 0; #endif } @@ -1365,10 +1371,16 @@ case UnmapNotify: R->TermWin.mapped = 0; +#ifdef TEXT_BLINK + R->text_blink_ev.stop (); +#endif break; case MapNotify: R->TermWin.mapped = 1; +#ifdef TEXT_BLINK + R->text_blink_ev.start (NOW + TEXT_BLINK_INTERVAL); +#endif break; case PropertyNotify: @@ -1532,7 +1544,7 @@ void rxvt_button_press(pR_ XButtonEvent *ev) { - int reportmode = 0, clickintime; + int reportmode = 0, clickintime; R->bypass_keystate = ev->state & (R->ModMetaMask | ShiftMask); if (!R->bypass_keystate) @@ -1590,7 +1602,7 @@ { case Button1: /* allow shift+left click to extend selection */ - if (ev->state & ShiftMask) + if (ev->state & ShiftMask && !(R->PrivateModes & PrivMode_mouse_report)) { if (R->MEvent.button == Button1 && clickintime) R->selection_rotate (ev->x, ev->y); @@ -2698,7 +2710,7 @@ case CSI_78: /* DECREQTPARM */ if (arg[0] == 0 || arg[0] == 1) - R->tt_printf("\033[%d;1;1;112;112;1;0x", arg[0] + 2); + R->tt_printf("\033[%d;1;1;128;128;1;0x", arg[0] + 2); /* FALLTHROUGH */ default: @@ -3075,6 +3087,7 @@ { 1010, PrivMode_TtyOutputInh }, { 1011, PrivMode_Keypress }, { 1047, PrivMode_Screen }, + { 1049, PrivMode_Screen }, /* xterm extension, not fully implemented */ }; if (nargs == 0) @@ -3191,6 +3204,7 @@ R->Options &= ~Opt_scrollTtyKeypress; break; case 1047: /* secondary screen w/ clearing */ + case 1049: /* better secondary screen w/ clearing, but not fully implemented */ if (R->current_screen != PRIMARY) R->scr_erase_screen (2); rxvt_scr_change_screen(aR_ state);