diff options
author | Thomas Adam <thomas@xteddy.org> | 2020-03-31 16:01:29 +0100 |
---|---|---|
committer | Thomas Adam <thomas@xteddy.org> | 2020-03-31 16:01:29 +0100 |
commit | 0bb1a50b88ac319e8f499fa95500f373123594d1 (patch) | |
tree | 9bdfc55ff0de5af7c4deac50dcfdfafc3f60091b /server-client.c | |
parent | c9cd8f9b5dd030790b097263e7bf1674efabeb72 (diff) | |
parent | 2a4714e76b3a85b3391b05413f36623bcb1493f9 (diff) | |
download | rtmux-0bb1a50b88ac319e8f499fa95500f373123594d1.tar.gz rtmux-0bb1a50b88ac319e8f499fa95500f373123594d1.tar.bz2 rtmux-0bb1a50b88ac319e8f499fa95500f373123594d1.zip |
Merge branch 'obsd-master'
Diffstat (limited to 'server-client.c')
-rw-r--r-- | server-client.c | 63 |
1 files changed, 55 insertions, 8 deletions
diff --git a/server-client.c b/server-client.c index 6df792cf..412df67a 100644 --- a/server-client.c +++ b/server-client.c @@ -438,6 +438,7 @@ server_client_check_mouse(struct client *c, struct key_event *event) UP, DRAG, WHEEL, + SECOND, DOUBLE, TRIPLE } type = NOTYPE; enum { NOWHERE, @@ -491,9 +492,10 @@ server_client_check_mouse(struct client *c, struct key_event *event) evtimer_del(&c->click_timer); c->flags &= ~CLIENT_DOUBLECLICK; if (m->b == c->click_button) { - type = NOTYPE; + type = SECOND; + x = m->x, y = m->y, b = m->b; + log_debug("second-click at %u,%u", x, y); c->flags |= CLIENT_TRIPLECLICK; - goto add_timer; } } else if (c->flags & CLIENT_TRIPLECLICK) { evtimer_del(&c->click_timer); @@ -505,13 +507,12 @@ server_client_check_mouse(struct client *c, struct key_event *event) ignore = 1; goto have_event; } - } else + } else { + type = DOWN; + x = m->x, y = m->y, b = m->b; + log_debug("down at %u,%u", x, y); c->flags |= CLIENT_DOUBLECLICK; - - add_timer: - type = DOWN; - x = m->x, y = m->y, b = m->b; - log_debug("down at %u,%u", x, y); + } if (KEYC_CLICK_TIMEOUT != 0) { memcpy(&c->click_event, m, sizeof c->click_event); @@ -875,6 +876,52 @@ have_event: break; } break; + case SECOND: + switch (MOUSE_BUTTONS(b)) { + case 0: + if (where == PANE) + key = KEYC_SECONDCLICK1_PANE; + if (where == STATUS) + key = KEYC_SECONDCLICK1_STATUS; + if (where == STATUS_LEFT) + key = KEYC_SECONDCLICK1_STATUS_LEFT; + if (where == STATUS_RIGHT) + key = KEYC_SECONDCLICK1_STATUS_RIGHT; + if (where == STATUS_DEFAULT) + key = KEYC_SECONDCLICK1_STATUS_DEFAULT; + if (where == BORDER) + key = KEYC_SECONDCLICK1_BORDER; + break; + case 1: + if (where == PANE) + key = KEYC_SECONDCLICK2_PANE; + if (where == STATUS) + key = KEYC_SECONDCLICK2_STATUS; + if (where == STATUS_LEFT) + key = KEYC_SECONDCLICK2_STATUS_LEFT; + if (where == STATUS_RIGHT) + key = KEYC_SECONDCLICK2_STATUS_RIGHT; + if (where == STATUS_DEFAULT) + key = KEYC_SECONDCLICK2_STATUS_DEFAULT; + if (where == BORDER) + key = KEYC_SECONDCLICK2_BORDER; + break; + case 2: + if (where == PANE) + key = KEYC_SECONDCLICK3_PANE; + if (where == STATUS) + key = KEYC_SECONDCLICK3_STATUS; + if (where == STATUS_LEFT) + key = KEYC_SECONDCLICK3_STATUS_LEFT; + if (where == STATUS_RIGHT) + key = KEYC_SECONDCLICK3_STATUS_RIGHT; + if (where == STATUS_DEFAULT) + key = KEYC_SECONDCLICK3_STATUS_DEFAULT; + if (where == BORDER) + key = KEYC_SECONDCLICK3_BORDER; + break; + } + break; case DOUBLE: switch (MOUSE_BUTTONS(b)) { case 0: |