Correctly detect which button was released on SGR mouse release events

SGR mouse release codes specify which button was released.
Prior to this change, b would always be set to the last clicked button,
interfering with mouse chording or applications tracking mouse states.
pull/3919/head
Rudy Dellomas III 2024-04-02 00:30:03 +10:00
parent fc204bb5e5
commit b00a5fc4a5
1 changed files with 2 additions and 0 deletions

View File

@ -622,6 +622,8 @@ server_client_check_mouse(struct client *c, struct key_event *event)
} else if (MOUSE_RELEASE(m->b)) {
type = UP;
x = m->x, y = m->y, b = m->lb;
if (m->sgr_type == 'm')
b = m->sgr_b;
log_debug("up at %u,%u", x, y);
} else {
if (c->flags & CLIENT_DOUBLECLICK) {