--- rxvt-unicode/src/command.C 2011/12/05 12:52:34 1.502 +++ rxvt-unicode/src/command.C 2012/05/17 10:18:32 1.509 @@ -56,10 +56,10 @@ # include "keyboard.h" #endif -#include +#include #if LINUX_YIELD_HACK -# include +# include #endif /*----------------------------------------------------------------------*/ @@ -1018,6 +1018,21 @@ #ifdef CURSOR_BLINK void +rxvt_term::cursor_blink_reset () +{ + if (hidden_cursor) + { + hidden_cursor = 0; + want_refresh = 1; + } + + if (option (Opt_cursorBlink)) + cursor_blink_ev.again (); + else + cursor_blink_ev.stop (); +} + +void rxvt_term::cursor_blink_cb (ev::timer &w, int revents) { hidden_cursor = !hidden_cursor; @@ -1636,7 +1651,7 @@ else { scroll_selection_dir = DN; - dist = ev.xbutton.y - (int_bwidth + height); + dist = ev.xbutton.y - (int_bwidth + vt_height); } scroll_selection_lines = Pixel2Height (dist) @@ -1678,16 +1693,8 @@ } #if defined(CURSOR_BLINK) - if (option (Opt_cursorBlink) && ev.type == KeyPress) - { - if (hidden_cursor) - { - hidden_cursor = 0; - want_refresh = 1; - } - - cursor_blink_ev.again (); - } + if (ev.type == KeyPress) + cursor_blink_reset (); #endif #if defined(POINTER_BLANK) @@ -1711,7 +1718,7 @@ void rxvt_term::set_urgency (bool enable) { - if (!(enable || urgency_hint)) + if (enable == urgency_hint) return; if (XWMHints *h = XGetWMHints (dpy, parent)) @@ -2165,7 +2172,7 @@ break; case Button2: - if (IN_RANGE_EXC (ev.x, 0, width) && IN_RANGE_EXC (ev.y, 0, height)) // inside window? + if (IN_RANGE_EXC (ev.x, 0, vt_width) && IN_RANGE_EXC (ev.y, 0, vt_height)) // inside window? selection_request (ev.time, ev.state & ModMetaMask ? Sel_Clipboard : Sel_Primary); break; @@ -3136,7 +3143,7 @@ //case 9: NYI, TODO, restore maximized window or maximize window default: if (args[0] >= 24) /* set height (chars) */ - set_widthheight ((unsigned int)width, + set_widthheight ((unsigned int)vt_width, (unsigned int) (args[1] * fheight)); break; @@ -3448,8 +3455,8 @@ char str[256]; sprintf (str, "[%dx%d+%d+%d]", - min (h_scale, 32767), min (v_scale, 32767), - min (h_align, 32767), min (v_align, 32767)); + min (bg_image.h_scale, 32767), min (bg_image.v_scale, 32767), + min (bg_image.h_align, 32767), min (bg_image.v_align, 32767)); process_xterm_seq (XTerm_title, str, CHAR_ST); } else @@ -3458,13 +3465,13 @@ if (*str != ';') { - if (bg_set_file (str)) /* change pixmap */ + if (bg_image.set_file (str)) /* change pixmap */ changed = true; } else { str++; - if (bg_set_geometry (str, true)) + if (bg_image.set_geometry (str, true)) changed = true; } @@ -3581,7 +3588,10 @@ if (mode == 's') { - SavedModes |= (priv_modes & bit); + if (priv_modes & bit) + SavedModes |= bit; + else + SavedModes &= ~bit; return -1; } else