--- rxvt-unicode/src/command.C 2004/08/25 03:47:20 1.163 +++ rxvt-unicode/src/command.C 2004/09/05 09:32:59 1.168 @@ -912,6 +912,8 @@ void rxvt_term::flush () { + flush_ev.stop (); + #ifdef TRANSPARENT if (want_full_refresh) { @@ -931,8 +933,6 @@ } display->flush (); - - flush_ev.stop (); } void @@ -1218,11 +1218,6 @@ } #endif -#ifdef USE_XIM - if (XFilterEvent (&ev, None)) - return; -#endif - Window unused_root, unused_child; int unused_root_x, unused_root_y; unsigned int unused_mask; @@ -1564,7 +1559,7 @@ break; } #endif - if ((priv_modes & PrivMode_mouse_report) && ! (bypass_keystate)) + if ((priv_modes & PrivMode_mouse_report) && !bypass_keystate) break; if (ev.xany.window == TermWin.vt) @@ -1577,8 +1572,8 @@ XQueryPointer (display->display, TermWin.vt, &unused_root, &unused_child, &unused_root_x, &unused_root_y, - & (ev.xbutton.x), & (ev.xbutton.y), - &unused_mask); + &ev.xbutton.x, &ev.xbutton.y, + &ev.xbutton.state); #ifdef MOUSE_THRESHOLD /* deal with a `jumpy' mouse */ if ((ev.xmotion.time - MEvent.time) > MOUSE_THRESHOLD) @@ -1593,7 +1588,8 @@ } #endif selection_extend (ev.xbutton.x, ev.xbutton.y, - (ev.xbutton.state & Button3Mask) ? 2 : 0); + ev.xbutton.state & Button3Mask ? 2 : 0); + #ifdef SELECTION_SCROLLING if (ev.xbutton.y < TermWin.int_bwidth || Pixel2Row (ev.xbutton.y) > (TermWin.nrow-1)) @@ -1614,7 +1610,7 @@ selection_save_state = (ev.xbutton.state & Button3Mask) ? 2 : 0; /* calc number of lines to scroll */ - if (ev.xbutton.ydisplay, scrollBar.win, - MotionNotify, &ev)) ; + MotionNotify, &ev)) + ; + XQueryPointer (display->display, scrollBar.win, &unused_root, &unused_child, &unused_root_x, &unused_root_y, - & (ev.xbutton.x), & (ev.xbutton.y), + &ev.xbutton.x, &ev.xbutton.y, &unused_mask); scr_move_to (scrollbar_position (ev.xbutton.y) - csrO, scrollbar_size ()); @@ -1717,6 +1715,7 @@ #endif clickintime = ev.time - MEvent.time < MULTICLICK_TIME; + if (reportmode) { /* mouse report from vt window */ @@ -1755,9 +1754,18 @@ { if (ev.button != MEvent.button) MEvent.clicks = 0; + switch (ev.button) { case Button1: + /* allow meta + click to select rectangular areas */ + /* should be done in screen.C */ +#if ENABLE_FRILLS + selection.rect = !! (ev.state & ModMetaMask); +#else + selection.rect = false; +#endif + /* allow shift+left click to extend selection */ if (ev.state & ShiftMask && ! (priv_modes & PrivMode_mouse_report)) {