Use button mouse mode not any for copy mode, fixes issues with

putty. From Ailin Nemui.
This commit is contained in:
Nicholas Marriott 2011-05-18 08:04:47 +00:00
parent ec3efab01e
commit fb527c1bad

View File

@ -790,7 +790,7 @@ window_copy_mouse(
* If already reading motion, move the cursor while buttons are still * If already reading motion, move the cursor while buttons are still
* pressed, or stop the selection on their release. * pressed, or stop the selection on their release.
*/ */
if (s->mode & MODE_MOUSE_ANY) { if (s->mode & MODE_MOUSE_BUTTON) {
if ((m->b & MOUSE_BUTTON) != MOUSE_UP) { if ((m->b & MOUSE_BUTTON) != MOUSE_UP) {
window_copy_update_cursor(wp, m->x, m->y); window_copy_update_cursor(wp, m->x, m->y);
if (window_copy_update_selection(wp)) if (window_copy_update_selection(wp))
@ -803,7 +803,7 @@ window_copy_mouse(
/* Otherwise if other buttons pressed, start selection and motion. */ /* Otherwise if other buttons pressed, start selection and motion. */
if ((m->b & MOUSE_BUTTON) != MOUSE_UP) { if ((m->b & MOUSE_BUTTON) != MOUSE_UP) {
s->mode &= ~MODE_MOUSE_STANDARD; s->mode &= ~MODE_MOUSE_STANDARD;
s->mode |= MODE_MOUSE_ANY; s->mode |= MODE_MOUSE_BUTTON;
window_copy_update_cursor(wp, m->x, m->y); window_copy_update_cursor(wp, m->x, m->y);
window_copy_start_selection(wp); window_copy_start_selection(wp);
@ -813,7 +813,7 @@ window_copy_mouse(
return; return;
reset_mode: reset_mode:
s->mode &= ~MODE_MOUSE_ANY; s->mode &= ~MODE_MOUSE_BUTTON;
s->mode |= MODE_MOUSE_STANDARD; s->mode |= MODE_MOUSE_STANDARD;
if (sess != NULL) { if (sess != NULL) {
window_copy_copy_selection(wp); window_copy_copy_selection(wp);