… | |
… | |
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 | */ |
1625 | void |
1625 | void |
1626 | rxvt_term::scr_rvideo_mode (int mode) NOTHROW |
1626 | rxvt_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 |
|
|
1862 | void |
|
|
1863 | rxvt_term::bell_cb (time_watcher &w) |
|
|
1864 | { |
|
|
1865 | rvideo_bell = false; |
|
|
1866 | scr_rvideo_mode (rvideo_mode); |
|
|
1867 | } |
|
|
1868 | #endif |
|
|
1869 | |
1856 | /* ------------------------------------------------------------------------- */ |
1870 | /* ------------------------------------------------------------------------- */ |
1857 | void |
1871 | void |
1858 | rxvt_term::scr_bell () NOTHROW |
1872 | rxvt_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 |
… | |
… | |
2804 | * EXT: button 2 release |
2819 | * EXT: button 2 release |
2805 | */ |
2820 | */ |
2806 | void |
2821 | void |
2807 | rxvt_term::selection_request (Time tm, int selnum) NOTHROW |
2822 | rxvt_term::selection_request (Time tm, int selnum) NOTHROW |
2808 | { |
2823 | { |
2809 | /* After making a selection with selection_make this function will always |
2824 | if (selection.text && selnum == Sel_Primary) |
2810 | * return the internal selection, which is not correct IMO, now much more since |
|
|
2811 | * I added the selnum parameter. |
|
|
2812 | */ |
|
|
2813 | #if 0 |
|
|
2814 | if (selection.text) |
|
|
2815 | { /* internal selection */ |
2825 | { /* internal selection */ |
2816 | char *str = rxvt_wcstombs (selection.text, selection.len); |
2826 | char *str = rxvt_wcstombs (selection.text, selection.len); |
2817 | paste (str, strlen (str)); |
2827 | paste (str, strlen (str)); |
2818 | free (str); |
2828 | free (str); |
2819 | return; |
2829 | return; |
2820 | } |
2830 | } |
2821 | else |
2831 | else |
2822 | #endif |
|
|
2823 | { |
2832 | { |
2824 | selection_request_time = tm; |
2833 | selection_request_time = tm; |
2825 | selection_wait = Sel_normal; |
2834 | selection_wait = Sel_normal; |
2826 | |
2835 | |
2827 | #if X_HAVE_UTF8_STRING |
2836 | #if X_HAVE_UTF8_STRING |