diff options
author | Thomas Adam <thomas@xteddy.org> | 2016-11-24 20:01:10 +0000 |
---|---|---|
committer | Thomas Adam <thomas@xteddy.org> | 2016-11-24 20:01:10 +0000 |
commit | 2864a313116c75eb2deb078c07708e3ef9ff145b (patch) | |
tree | 0e04c1f8a02e7d09aaa765d7fb0d81d75f7cabfe /server-client.c | |
parent | a02d95a313e0a289a46c2b77eb59d6c6d1488012 (diff) | |
parent | 6f8cedb1bc147f2d05d63c2c085b2791fd841c19 (diff) | |
download | rtmux-2864a313116c75eb2deb078c07708e3ef9ff145b.tar.gz rtmux-2864a313116c75eb2deb078c07708e3ef9ff145b.tar.bz2 rtmux-2864a313116c75eb2deb078c07708e3ef9ff145b.zip |
Merge branch 'obsd-master'
Diffstat (limited to 'server-client.c')
-rw-r--r-- | server-client.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/server-client.c b/server-client.c index f9d48565..065e31d0 100644 --- a/server-client.c +++ b/server-client.c @@ -472,10 +472,9 @@ have_event: case NOTYPE: break; case DRAG: - if (c->tty.mouse_drag_update != NULL) { - c->tty.mouse_drag_update(c, m); - key = KEYC_MOUSE; - } else { + if (c->tty.mouse_drag_update != NULL) + key = KEYC_DRAGGING; + else { switch (MOUSE_BUTTONS(b)) { case 0: if (where == PANE) @@ -728,6 +727,7 @@ server_client_handle_key(struct client *c, key_code key) } /* Check for mouse keys. */ + m->valid = 0; if (key == KEYC_MOUSE) { if (c->flags & CLIENT_READONLY) return; @@ -739,11 +739,13 @@ server_client_handle_key(struct client *c, key_code key) m->key = key; /* - * A mouse event that continues to be valid but that we do not - * want to pass through. + * Mouse drag is in progress, so fire the callback (now that + * the mouse event is valid). */ - if (key == KEYC_MOUSE) + if (key == KEYC_DRAGGING) { + c->tty.mouse_drag_update(c, m); return; + } } else m->valid = 0; |