=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/tmux/server-client.c,v retrieving revision 1.203 retrieving revision 1.204 diff -c -r1.203 -r1.204 *** src/usr.bin/tmux/server-client.c 2016/11/24 14:38:55 1.203 --- src/usr.bin/tmux/server-client.c 2016/11/24 18:45:45 1.204 *************** *** 1,4 **** ! /* $OpenBSD: server-client.c,v 1.203 2016/11/24 14:38:55 nicm Exp $ */ /* * Copyright (c) 2009 Nicholas Marriott --- 1,4 ---- ! /* $OpenBSD: server-client.c,v 1.204 2016/11/24 18:45:45 nicm Exp $ */ /* * Copyright (c) 2009 Nicholas Marriott *************** *** 474,483 **** case NOTYPE: break; case DRAG: ! if (c->tty.mouse_drag_update != NULL) { ! c->tty.mouse_drag_update(c, m); ! key = KEYC_MOUSE; ! } else { switch (MOUSE_BUTTONS(b)) { case 0: if (where == PANE) --- 474,482 ---- case NOTYPE: break; case DRAG: ! if (c->tty.mouse_drag_update != NULL) ! key = KEYC_DRAGGING; ! else { switch (MOUSE_BUTTONS(b)) { case 0: if (where == PANE) *************** *** 730,735 **** --- 729,735 ---- } /* Check for mouse keys. */ + m->valid = 0; if (key == KEYC_MOUSE) { if (c->flags & CLIENT_READONLY) return; *************** *** 741,751 **** m->key = key; /* ! * A mouse event that continues to be valid but that we do not ! * want to pass through. */ ! if (key == KEYC_MOUSE) return; } else m->valid = 0; --- 741,753 ---- m->key = key; /* ! * Mouse drag is in progress, so fire the callback (now that ! * the mouse event is valid). */ ! if (key == KEYC_DRAGGING) { ! c->tty.mouse_drag_update(c, m); return; + } } else m->valid = 0;