--- rxvt-unicode/src/command.C 2003/11/25 15:25:16 1.4 +++ rxvt-unicode/src/command.C 2003/11/25 15:44:38 1.5 @@ -1,7 +1,7 @@ /*--------------------------------*-C-*---------------------------------* * File: command.c *----------------------------------------------------------------------* - * $Id: command.C,v 1.4 2003/11/25 15:25:16 pcg Exp $ + * $Id: command.C,v 1.5 2003/11/25 15:44:38 pcg Exp $ * * All portions of code are copyright by their respective author/s. * Copyright (c) 1992 John Bovey, University of Kent at Canterbury @@ -665,6 +665,7 @@ XEvent xev; XNextEvent (Xdisplay, &xev); + #if defined(CURSOR_BLINK) if ((Options & Opt_cursorBlink) && xev.type == KeyPress) { @@ -672,7 +673,7 @@ hidden_cursor = 0; want_refresh = 1; } - want_keypress_time = 1; + blink_ev.start (NOW + BLINK_INTERVAL); } #endif @@ -700,6 +701,15 @@ } void +rxvt_term::blink_cb (time_watcher &w) +{ + w.at += BLINK_INTERVAL; + hidden_cursor = !hidden_cursor; + want_refresh = 1; + flush(); +} + +void rxvt_term::x_cb (io_watcher &w, short revents) { process_x_events (); @@ -1407,6 +1417,10 @@ if (R->Input_Context != NULL) XSetICFocus(R->Input_Context); #endif +#ifdef CURSOR_BLINK + if (R->Options & Opt_cursorBlink) + R->blink_ev.start (NOW + BLINK_INTERVAL); +#endif } break; @@ -1418,6 +1432,11 @@ if (R->Input_Context != NULL) XUnsetICFocus(R->Input_Context); #endif +#ifdef CURSOR_BLINK + if (R->Options & Opt_cursorBlink) + R->blink_ev.stop (); + R->hidden_cursor = 0; +#endif } break;