From: pcg Date: Tue, 25 Nov 2003 15:44:36 +0000 (+0000) Subject: *** empty log message *** X-Git-Url: http://git.openbox.org/?a=commitdiff_plain;h=bc40a0422bd06be473041e89a3b8eb6bedcc715c;p=dana%2Furxvt.git *** empty log message *** --- diff --git a/reconf b/reconf index 116eb235..fbf25148 100755 --- a/reconf +++ b/reconf @@ -2,5 +2,6 @@ --enable-wtmp --enable-lastlog --enable-xim --disable-strings --enable-xterm-scroll \ --with-term=xterm --enable-keepscrolling --enable-xft \ --enable-frills --disable-swapscreen \ - --with-codesets=eu,jp + --with-codesets=eu,jp \ + --enable-cursor-blink #--enable-pointer-blank --enable-cursor-blink diff --git a/src/command.C b/src/command.C index a74d86de..9c52d49a 100644 --- a/src/command.C +++ b/src/command.C @@ -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 @@ rxvt_term::process_x_events () XEvent xev; XNextEvent (Xdisplay, &xev); + #if defined(CURSOR_BLINK) if ((Options & Opt_cursorBlink) && xev.type == KeyPress) { @@ -672,7 +673,7 @@ rxvt_term::process_x_events () hidden_cursor = 0; want_refresh = 1; } - want_keypress_time = 1; + blink_ev.start (NOW + BLINK_INTERVAL); } #endif @@ -699,6 +700,15 @@ rxvt_term::process_x_events () while (XPending (Xdisplay)); } +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) { @@ -1406,6 +1416,10 @@ rxvt_process_x_event(pR_ XEvent *ev) #ifdef USE_XIM 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; @@ -1417,6 +1431,11 @@ rxvt_process_x_event(pR_ XEvent *ev) #ifdef USE_XIM 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; diff --git a/src/init.C b/src/init.C index cc0a0a36..91c9d7e7 100644 --- a/src/init.C +++ b/src/init.C @@ -1,7 +1,7 @@ /*--------------------------------*-C-*---------------------------------* * File: init.c *----------------------------------------------------------------------* - * $Id: init.C,v 1.4 2003-11-25 15:25:17 pcg Exp $ + * $Id: init.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 @@ -386,7 +386,7 @@ rxvt_term::init_vars() cmd_pid = -1; cmd_fd = tty_fd = Xfd = -1; PrivateModes = SavedModes = PrivMode_Default; - TermWin.focus = 1; + TermWin.focus = 0; TermWin.ncol = 80; TermWin.nrow = 24; TermWin.int_bwidth = INTERNALBORDERWIDTH; diff --git a/src/main.C b/src/main.C index e12fee60..660afdaf 100644 --- a/src/main.C +++ b/src/main.C @@ -1,7 +1,7 @@ /*--------------------------------*-C-*---------------------------------* * File: main.c *----------------------------------------------------------------------* - * $Id: main.C,v 1.4 2003-11-25 15:25:17 pcg Exp $ + * $Id: main.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 @@ -60,8 +60,11 @@ rxvt_term::operator delete (void *p, size_t s) } rxvt_term::rxvt_term () -: pty_ev(this, &rxvt_term::pty_cb), - x_ev (this, &rxvt_term::x_cb) +: pty_ev (this, &rxvt_term::pty_cb), +#ifdef CURSOR_BLINK + blink_ev (this, &rxvt_term::blink_cb), +#endif + x_ev (this, &rxvt_term::x_cb) { cmdbuf_ptr = cmdbuf_endp = cmdbuf_base; } diff --git a/src/rxvt.h b/src/rxvt.h index 6cc6c4a6..63cf20c2 100644 --- a/src/rxvt.h +++ b/src/rxvt.h @@ -1,5 +1,5 @@ /* - * $Id: rxvt.h,v 1.4 2003-11-25 15:25:17 pcg Exp $ + * $Id: rxvt.h,v 1.5 2003-11-25 15:44:39 pcg Exp $ */ #ifndef _RXVT_H_ /* include once only */ @@ -841,6 +841,8 @@ enum { # include "menubar.h" #endif +#define BLINK_INTERVAL 0.5 + struct mbstate { unsigned char orig; uint32_t reg; @@ -1116,6 +1118,10 @@ struct rxvt_term : rxvt_vars { void pty_cb (io_watcher &w, short revents); io_watcher pty_ev; void x_cb (io_watcher &w, short revents); io_watcher x_ev; +#ifdef CURSOR_BLINK + void blink_cb (time_watcher &w); time_watcher blink_ev; +#endif + void flush (); rxvt_term (); @@ -1159,3 +1165,4 @@ struct rxvt_term : rxvt_vars { #endif #endif /* _RXVT_H_ */ +