ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/rxvt-unicode/src/screen.C
(Generate patch)

Comparing rxvt-unicode/src/screen.C (file contents):
Revision 1.245 by root, Fri Jan 20 10:35:25 2006 UTC vs.
Revision 1.246 by root, Sat Jan 21 14:25:05 2006 UTC

234 selection.text = NULL; 234 selection.text = NULL;
235 selection.len = 0; 235 selection.len = 0;
236 selection.op = SELECTION_CLEAR; 236 selection.op = SELECTION_CLEAR;
237 selection.screen = PRIMARY; 237 selection.screen = PRIMARY;
238 selection.clicks = 0; 238 selection.clicks = 0;
239 rvideo = 0; 239 rvideo_state = rvideo_mode = false;
240 } 240 }
241 else 241 else
242 { 242 {
243 /* 243 /*
244 * add or delete rows as appropriate 244 * add or delete rows as appropriate
1621 * Set reverse/normal video 1621 * Set reverse/normal video
1622 * XTERM_SEQ: Reverse video: ESC [ ? 5 h 1622 * XTERM_SEQ: Reverse video: ESC [ ? 5 h
1623 * XTERM_SEQ: Normal video : ESC [ ? 5 l 1623 * XTERM_SEQ: Normal video : ESC [ ? 5 l
1624 */ 1624 */
1625void 1625void
1626rxvt_term::scr_rvideo_mode (int mode) NOTHROW 1626rxvt_term::scr_rvideo_mode (bool on) NOTHROW
1627{ 1627{
1628 XGCValues gcvalue; 1628 rvideo_mode = on;
1629 1629
1630#ifndef NO_BELL
1631 on ^= rvideo_bell;
1632#endif
1633
1630 if (rvideo != mode) 1634 if (rvideo_state != on)
1631 { 1635 {
1632 rvideo = mode; 1636 rvideo_state = on;
1637
1633 ::swap (pix_colors[Color_fg], pix_colors[Color_bg]); 1638 ::swap (pix_colors[Color_fg], pix_colors[Color_bg]);
1634#if XPM_BACKGROUND 1639#if XPM_BACKGROUND
1635 if (bgPixmap.pixmap == None) 1640 if (bgPixmap.pixmap == None)
1636#endif 1641#endif
1637#if TRANSPARENT 1642#if TRANSPARENT
1638 if (! OPTION (Opt_transparent) || am_transparent == 0) 1643 if (!OPTION (Opt_transparent) || am_transparent == 0)
1639#endif 1644#endif
1640 XSetWindowBackground (display->display, vt, 1645 XSetWindowBackground (display->display, vt, pix_colors[Color_bg]);
1641 pix_colors[Color_bg]);
1642 1646
1647 XGCValues gcvalue;
1643 gcvalue.foreground = pix_colors[Color_fg]; 1648 gcvalue.foreground = pix_colors[Color_fg];
1644 gcvalue.background = pix_colors[Color_bg]; 1649 gcvalue.background = pix_colors[Color_bg];
1645 XChangeGC (display->display, gc, GCBackground | GCForeground, 1650 XChangeGC (display->display, gc, GCBackground | GCForeground, &gcvalue);
1646 &gcvalue); 1651
1647 scr_clear (); 1652 scr_clear ();
1648 scr_touch (true); 1653 scr_touch (true);
1649 } 1654 }
1650} 1655}
1651 1656
1851 HOOK_INVOKE ((this, HOOK_VIEW_CHANGE, DT_INT, view_start, DT_END)); 1856 HOOK_INVOKE ((this, HOOK_VIEW_CHANGE, DT_INT, view_start, DT_END));
1852 1857
1853 return true; 1858 return true;
1854} 1859}
1855 1860
1861#ifndef NO_BELL
1862void
1863rxvt_term::bell_cb (time_watcher &w)
1864{
1865 rvideo_bell = false;
1866 scr_rvideo_mode (rvideo_mode);
1867}
1868#endif
1869
1856/* ------------------------------------------------------------------------- */ 1870/* ------------------------------------------------------------------------- */
1857void 1871void
1858rxvt_term::scr_bell () NOTHROW 1872rxvt_term::scr_bell () NOTHROW
1859{ 1873{
1860#ifndef NO_BELL 1874#ifndef NO_BELL
1866 XMapWindow (display->display, parent[0]); 1880 XMapWindow (display->display, parent[0]);
1867# endif 1881# endif
1868 1882
1869 if (OPTION (Opt_visualBell)) 1883 if (OPTION (Opt_visualBell))
1870 { 1884 {
1871 scr_rvideo_mode (!rvideo); /* refresh also done */ 1885 rvideo_bell = true;
1886 scr_rvideo_mode (rvideo_mode);
1872 display->flush (); 1887 display->flush ();
1873 rxvt_usleep (VISUAL_BELL_DURATION); 1888
1874 scr_rvideo_mode (!rvideo); /* refresh also done */ 1889 bell_ev.start (NOW + VISUAL_BELL_DURATION);
1875 } 1890 }
1876 else 1891 else
1877 XBell (display->display, 0); 1892 XBell (display->display, 0);
1878 1893
1879#endif 1894#endif

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines