*** empty log message ***
authorpcg <pcg>
Tue, 25 Nov 2003 15:44:36 +0000 (15:44 +0000)
committerpcg <pcg>
Tue, 25 Nov 2003 15:44:36 +0000 (15:44 +0000)
reconf
src/command.C
src/init.C
src/main.C
src/rxvt.h

diff --git a/reconf b/reconf
index 116eb2357f9de4277bdd0ef528bde0a87de1f0f9..fbf251482acefce917a92b3c911122de1d7ee38b 100755 (executable)
--- 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
index a74d86de5ab38fbd9257b2675c3bf59faf791371..9c52d49a19959d11570803fa6f5e0e8ed1d557ce 100644 (file)
@@ -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 <jdb@ukc.ac.uk>
@@ -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;
index cc0a0a3698676a41ed1222da8cbd06b77448b756..91c9d7e7bded149ac59f1a9e766fb294c3605f3b 100644 (file)
@@ -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 <jdb@ukc.ac.uk>
@@ -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;
index e12fee60f6da980a755d8e3be21f26223935f9b9..660afdaf1d42cff9a1afddc170345eaacd3f29d3 100644 (file)
@@ -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 <jdb@ukc.ac.uk>
@@ -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;
 }
index 6cc6c4a6ec9154755349e7dadd2ca17abf21279f..63cf20c2fe8aa4626e54f84fc6ab19d1c001541d 100644 (file)
@@ -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_ */
+