From: root Date: Sat, 21 Jan 2006 14:25:05 +0000 (+0000) Subject: *** empty log message *** X-Git-Url: http://git.openbox.org/?a=commitdiff_plain;h=e583ebc45a08fc3f84c9aeb3a0fc868cb3f581e5;p=dana%2Furxvt.git *** empty log message *** --- diff --git a/Changes b/Changes index 03306d35..84d3d53d 100644 --- a/Changes +++ b/Changes @@ -26,6 +26,9 @@ WISH: support tex fonts with shift - mouse button 2 - fixed the automove-background extension to ignore coordinates in non-synthetic events. + - the non-terminfo visual bell is now done asynchronously, so + continous ASCI BELs in one terminal do no longer monopolise the + while urxvt[d] process. - removed support for obsolete offix dnd protocol. 7.1 Thu Jan 19 20:25:34 CET 2006 diff --git a/src/command.C b/src/command.C index fbbaecc1..e5d955c8 100644 --- a/src/command.C +++ b/src/command.C @@ -2631,11 +2631,6 @@ rxvt_term::check_our_parents () } else { -#if WAIT_FOR_WM - /* wait (an arbitrary period) for the WM to do its thing - * needed for fvwm2.2.2 (and before?) */ - sleep (1); -#endif for (n = 0; n < (unsigned int)i; n++) { XSetWindowBackgroundPixmap (disp, parent[n], ParentRelative); diff --git a/src/feature.h b/src/feature.h index 45581948..e967bd02 100644 --- a/src/feature.h +++ b/src/feature.h @@ -365,20 +365,13 @@ /* * Provide termcap/terminfo bw support (wrap backwards on cub1) */ -#define TERMCAP_HAS_BW +#define TERMCAP_HAS_BW 1 /* - * Some (older, e.g. fvwm 2.2.2) window managers need some time when - * updating window positions. If transparency isn't working correctly - * then you might try out this one. - */ -/* #define WAIT_FOR_WM */ - -/* - * The duration of the visual bell flash in µs. The default of 20ms + * 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 +#define VISUAL_BELL_DURATION .020 #endif diff --git a/src/iom.C b/src/iom.C index fd35d2e7..faa0611a 100644 --- a/src/iom.C +++ b/src/iom.C @@ -118,7 +118,7 @@ static struct sw0 : sig_watcher pw.erase_unordered (i); else if (w->pid == pid) { - w->stop (); + io_manager::unreg (*w); w->call (*w, status); } } diff --git a/src/main.C b/src/main.C index c3dceee9..8290a328 100644 --- a/src/main.C +++ b/src/main.C @@ -171,6 +171,9 @@ rxvt_term::rxvt_term () #endif #ifdef USE_XIM im_ev (this, &rxvt_term::im_cb), +#endif +#ifndef NO_BELL + bell_ev (this, &rxvt_term::bell_cb), #endif termwin_ev (this, &rxvt_term::x_cb), vt_ev (this, &rxvt_term::x_cb), diff --git a/src/rxvt.h b/src/rxvt.h index 22c5bbca..13196d86 100644 --- a/src/rxvt.h +++ b/src/rxvt.h @@ -1022,7 +1022,10 @@ struct rxvt_term : zero_initialized, rxvt_vars { selection_wait, selection_type; /* ---------- */ - short rvideo; + bool rvideo_state, rvideo_mode; +#ifndef NO_BELL + bool rvideo_bell; +#endif int num_scr; /* screen: number lines scrolled */ int prev_ncol, /* screen: previous number of columns */ prev_nrow; /* screen: previous number of rows */ @@ -1197,9 +1200,7 @@ struct rxvt_term : zero_initialized, rxvt_vars { void check_cb (check_watcher &w); check_watcher check_ev; void destroy_cb (time_watcher &w); time_watcher destroy_ev; void flush_cb (time_watcher &w); time_watcher flush_ev; - void pty_cb (io_watcher &w, short revents); io_watcher pty_ev; - void incr_cb (time_watcher &w) NOTHROW; time_watcher incr_ev; #ifdef CURSOR_BLINK @@ -1208,6 +1209,9 @@ struct rxvt_term : zero_initialized, rxvt_vars { #ifdef TEXT_BLINK void text_blink_cb (time_watcher &w); time_watcher text_blink_ev; #endif +#ifndef NO_BELL + void bell_cb (time_watcher &w); time_watcher bell_ev; +#endif #ifndef NO_SCROLLBAR_BUTTON_CONTINUAL_SCROLLING void cont_scroll_cb (time_watcher &w); time_watcher cont_scroll_ev; @@ -1449,7 +1453,7 @@ struct rxvt_term : zero_initialized, rxvt_vars { void scr_relative_origin (int mode) NOTHROW; void scr_insert_mode (int mode) NOTHROW; void scr_set_tab (int mode) NOTHROW; - void scr_rvideo_mode (int mode) NOTHROW; + void scr_rvideo_mode (bool on) NOTHROW; void scr_report_position () NOTHROW; void set_font_style () NOTHROW; void scr_charset_choose (int set) NOTHROW; diff --git a/src/screen.C b/src/screen.C index 6cd1c5fa..5767a168 100644 --- a/src/screen.C +++ b/src/screen.C @@ -236,7 +236,7 @@ rxvt_term::scr_reset () selection.op = SELECTION_CLEAR; selection.screen = PRIMARY; selection.clicks = 0; - rvideo = 0; + rvideo_state = rvideo_mode = false; } else { @@ -1623,27 +1623,32 @@ rxvt_term::scr_set_tab (int mode) NOTHROW * XTERM_SEQ: Normal video : ESC [ ? 5 l */ void -rxvt_term::scr_rvideo_mode (int mode) NOTHROW +rxvt_term::scr_rvideo_mode (bool on) NOTHROW { - XGCValues gcvalue; + rvideo_mode = on; + +#ifndef NO_BELL + on ^= rvideo_bell; +#endif - if (rvideo != mode) + if (rvideo_state != on) { - rvideo = mode; + rvideo_state = on; + ::swap (pix_colors[Color_fg], pix_colors[Color_bg]); #if XPM_BACKGROUND if (bgPixmap.pixmap == None) #endif #if TRANSPARENT - if (! OPTION (Opt_transparent) || am_transparent == 0) + if (!OPTION (Opt_transparent) || am_transparent == 0) #endif - XSetWindowBackground (display->display, vt, - pix_colors[Color_bg]); + XSetWindowBackground (display->display, vt, pix_colors[Color_bg]); + XGCValues gcvalue; gcvalue.foreground = pix_colors[Color_fg]; gcvalue.background = pix_colors[Color_bg]; - XChangeGC (display->display, gc, GCBackground | GCForeground, - &gcvalue); + XChangeGC (display->display, gc, GCBackground | GCForeground, &gcvalue); + scr_clear (); scr_touch (true); } @@ -1853,6 +1858,15 @@ rxvt_term::scr_changeview (int new_view_start) NOTHROW return true; } +#ifndef NO_BELL +void +rxvt_term::bell_cb (time_watcher &w) +{ + rvideo_bell = false; + scr_rvideo_mode (rvideo_mode); +} +#endif + /* ------------------------------------------------------------------------- */ void rxvt_term::scr_bell () NOTHROW @@ -1868,10 +1882,11 @@ rxvt_term::scr_bell () NOTHROW if (OPTION (Opt_visualBell)) { - scr_rvideo_mode (!rvideo); /* refresh also done */ + rvideo_bell = true; + scr_rvideo_mode (rvideo_mode); display->flush (); - rxvt_usleep (VISUAL_BELL_DURATION); - scr_rvideo_mode (!rvideo); /* refresh also done */ + + bell_ev.start (NOW + VISUAL_BELL_DURATION); } else XBell (display->display, 0);