*** empty log message ***
authorroot <root>
Fri, 5 Aug 2005 16:42:44 +0000 (16:42 +0000)
committerroot <root>
Fri, 5 Aug 2005 16:42:44 +0000 (16:42 +0000)
Changes
doc/etc/rxvt-unicode.terminfo
src/feature.h
src/menubar.C
src/misc.C
src/rxvt.h
src/rxvttoolkit.C
src/screen.C

diff --git a/Changes b/Changes
index 4058ad4..e16d97e 100644 (file)
--- a/Changes
+++ b/Changes
@@ -12,6 +12,11 @@ WISH: OnTheSpot editing, or maybe switch to miiiiiiif
 WISH: tabbed windows (hey, just use screen...)
 WISH: just for fun, do shade and tint with XRender.
 
+        - slow down the internal visual bell (delay by 20ms) and update
+          the terminfo flash code to use the same delay.  This is
+          synchronous, so many bells might inhibit screen updates in other
+          windows.
+
 5.7  Wed Jul 13 04:46:33 CEST 2005
        - implement some useful (hopefully) options for rxvtd.
         - separate and improved rxvtc(1) and rxvtd(1) manpages.
index 18dd772..499b8b1 100644 (file)
@@ -17,7 +17,7 @@ rxvt-unicode|rxvt-unicode terminal (X Window System),
        cup=\E[%i%p1%d;%p2%dH, cuu=\E[%p1%dA, cuu1=\E[A, 
        cvvis=\E[?25h, dch=\E[%p1%dP, dch1=\E[P, dl=\E[%p1%dM, 
        dl1=\E[M, ed=\E[J, el=\E[K, el1=\E[1K,
-       flash=\E[?5h$<50/>\E[?5l, home=\E[H, hpa=\E[%i%p1%dG, ht=^I, 
+       flash=\E[?5h$<20/>\E[?5l, home=\E[H, hpa=\E[%i%p1%dG, ht=^I, 
        hts=\EH, ich=\E[%p1%d@, ich1=\E[@, il=\E[%p1%dL, il1=\E[L, 
        ind=^J, is1=\E[?47l\E=\E[?1l, 
        is2=\E[r\E[m\E[2J\E[H\E[?7h\E[?1;3;4;6l\E[4l, 
index 91b621c..ca28c9c 100644 (file)
  */
 /* #define WAIT_FOR_WM */
 
+/*
+ * The duration of the visual bell flash in µs. The default of 20ms
+ * corresponds to the delay given in the terminfo flash code.
+ */
+#define VISUAL_BELL_DURATION 20000
+
 #endif
 
index 5d511da..be9f80e 100644 (file)
@@ -2250,20 +2250,7 @@ rxvt_term::menu_select (XButtonEvent &ev)
                     case MenuAction:
                     case MenuTerminalAction:
                       drawbox_menuitem (this_y, -1);
-#ifdef HAVE_NANOSLEEP
-                      struct timespec rqt;
-
-                      rqt.tv_sec = 0;
-                      rqt.tv_nsec = MENU_DELAY_USEC * 1000;
-                      nanosleep (&rqt, NULL);
-#else
-                      /* use select for timing */
-                      struct timeval  tv;
-
-                      tv.tv_sec = 0;
-                      tv.tv_usec = MENU_DELAY_USEC;
-                      select (0, NULL, NULL, NULL, &tv);
-#endif
+                      rxvt_usleep (MENU_DELAY_USEC);
                       /* remove menu before sending keys to the application */
                       menu_hide_all ();
 #ifndef DEBUG_MENU
@@ -2351,23 +2338,7 @@ rxvt_term::menubar_select (XButtonEvent &ev)
                                 + (Width2Pixel (4 * i + i + 4)) / 4))
                   {
                     draw_Arrows (Arrows[i].name, -1);
-                    {
-#ifdef HAVE_NANOSLEEP
-                      struct timespec rqt;
-
-                      rqt.tv_sec = 0;
-                      rqt.tv_nsec = MENU_DELAY_USEC * 1000;
-                      nanosleep (&rqt, NULL);
-#else
-                      /* use select for timing */
-                      struct timeval  tv;
-
-                      tv.tv_sec = 0;
-                      tv.tv_usec = MENU_DELAY_USEC;
-                      select (0, NULL, NULL, NULL, &tv);
-#endif
-
-                    }
+                    rxvt_usleep (MENU_DELAY_USEC);
                     draw_Arrows (Arrows[i].name, +1);
 #ifdef DEBUG_MENUARROWS
                     fprintf (stderr, "'%c': ", Arrows[i].name);
index c391bbd..5553b63 100644 (file)
@@ -610,4 +610,25 @@ rxvt_Draw_Triangle (Display *display, Window win, GC topShadow, GC botShadow, in
     }
 }
 #endif
+
+// should nto be use din interactive programs, for obvious reasons
+void rxvt_usleep (int usecs)
+{
+#if HAVE_NANOSLEEP
+  struct timespec ts;
+
+  ts.tv_sec = 0;
+  ts.tv_nsec = usecs * 1000;
+  nanosleep (&ts, NULL);
+#else                 
+  /* use select for timing */
+  struct timeval  tv;
+
+  tv.tv_sec = 0;
+  tv.tv_usec = usecs;
+  select (0, NULL, NULL, NULL, &tv);
+#endif                
+}
+
 /*----------------------- end-of-file (C source) -----------------------*/
+
index bb3e380..6cb4799 100644 (file)
@@ -120,6 +120,7 @@ void             rxvt_freecommastring             (char **cs);
 char           * rxvt_File_find                   (const char *file, const char *ext, const char *path);
 void             rxvt_Draw_Shadow                 (Display *display, Window win, GC topShadow, GC botShadow, int x, int y, int w, int h);
 void             rxvt_Draw_Triangle               (Display *display, Window win, GC topShadow, GC botShadow, int x, int y, int w, int type);
+void             rxvt_usleep                      (int usecs);
 
 /*
  *****************************************************************************
index bb3a5c2..37af2f8 100644 (file)
@@ -173,7 +173,7 @@ bool rxvt_display::init ()
   int fd = XConnectionNumber (display);
 
 #ifndef NO_SLOW_LINK_SUPPORT
-  // try to detetc wether we have a local connection.
+  // try to detect wether we have a local connection.
   // assume unix domains socket == local, everything else not
   // TODO: might want to check for inet/127.0.0.1
   is_local = 0;
index 95f6d02..89b9320 100644 (file)
@@ -1950,19 +1950,23 @@ void
 rxvt_term::scr_bell ()
 {
 #ifndef NO_BELL
+
 # ifndef NO_MAPALERT
 #  ifdef MAPALERT_OPTION
   if (options & Opt_mapAlert)
 #  endif
     XMapWindow (display->display, TermWin.parent[0]);
 # endif
+
   if (options & Opt_visualBell)
     {
       scr_rvideo_mode (!rvideo); /* refresh also done */
+      rxvt_usleep (VISUAL_BELL_DURATION);
       scr_rvideo_mode (!rvideo); /* refresh also done */
     }
   else
     XBell (display->display, 0);
+
 #endif
 }