From: root Date: Fri, 5 Aug 2005 16:42:44 +0000 (+0000) Subject: *** empty log message *** X-Git-Url: http://git.openbox.org/?a=commitdiff_plain;h=3fa46d2423d0deeda5ff808ea10da9c898bb80aa;p=dana%2Furxvt.git *** empty log message *** --- diff --git a/Changes b/Changes index 4058ad4a..e16d97e0 100644 --- 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. diff --git a/doc/etc/rxvt-unicode.terminfo b/doc/etc/rxvt-unicode.terminfo index 18dd7729..499b8b1e 100644 --- a/doc/etc/rxvt-unicode.terminfo +++ b/doc/etc/rxvt-unicode.terminfo @@ -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, diff --git a/src/feature.h b/src/feature.h index 91b621c2..ca28c9ce 100644 --- a/src/feature.h +++ b/src/feature.h @@ -409,5 +409,11 @@ */ /* #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 diff --git a/src/menubar.C b/src/menubar.C index 5d511daf..be9f80e6 100644 --- a/src/menubar.C +++ b/src/menubar.C @@ -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); diff --git a/src/misc.C b/src/misc.C index c391bbd2..5553b63a 100644 --- a/src/misc.C +++ b/src/misc.C @@ -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) -----------------------*/ + diff --git a/src/rxvt.h b/src/rxvt.h index bb3e3805..6cb4799d 100644 --- a/src/rxvt.h +++ b/src/rxvt.h @@ -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); /* ***************************************************************************** diff --git a/src/rxvttoolkit.C b/src/rxvttoolkit.C index bb3a5c26..37af2f8c 100644 --- a/src/rxvttoolkit.C +++ b/src/rxvttoolkit.C @@ -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; diff --git a/src/screen.C b/src/screen.C index 95f6d02a..89b93205 100644 --- a/src/screen.C +++ b/src/screen.C @@ -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 }