From feb090abb3c2cf81e67cfdbb114c2cb2f0522582 Mon Sep 17 00:00:00 2001 From: nicm Date: Wed, 27 Nov 2024 10:10:20 +0000 Subject: [PATCH 1/2] Do not stop drag on double or triple click, GitHub issue 4272. --- server-client.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/server-client.c b/server-client.c index e640122f..98fdf1c9 100644 --- a/server-client.c +++ b/server-client.c @@ -83,7 +83,7 @@ RB_GENERATE(client_windows, client_window, entry, server_client_window_cmp); u_int server_client_how_many(void) { - struct client *c; + struct client *c; u_int n; n = 0; @@ -884,7 +884,11 @@ have_event: m->wp = -1; /* Stop dragging if needed. */ - if (type != DRAG && type != WHEEL && c->tty.mouse_drag_flag != 0) { + if (type != DRAG && + type != WHEEL && + type != DOUBLE && + type != TRIPLE && + c->tty.mouse_drag_flag != 0) { if (c->tty.mouse_drag_release != NULL) c->tty.mouse_drag_release(c, m); @@ -2248,7 +2252,7 @@ server_client_is_bracket_paste(struct client *c, key_code key) } if (key == KEYC_PASTE_END) { - c->flags &= ~CLIENT_BRACKETPASTING; + c->flags &= ~CLIENT_BRACKETPASTING; log_debug("%s: bracket paste off", c->name); return (0); } @@ -3725,7 +3729,7 @@ const char * server_client_get_flags(struct client *c) { static char s[256]; - char tmp[32]; + char tmp[32]; *s = '\0'; if (c->flags & CLIENT_ATTACHED) From d361f21065013814fadcfdf68b761de81d8f7b10 Mon Sep 17 00:00:00 2001 From: nicm Date: Wed, 27 Nov 2024 10:12:20 +0000 Subject: [PATCH 2/2] Do not check for latest client in callback since the type may be latest but with no window, fixes new-session -x and -y with another attached client. GitHub issue 4268. --- resize.c | 21 +++++++-------------- 1 file changed, 7 insertions(+), 14 deletions(-) diff --git a/resize.c b/resize.c index dff95712..2d7be9cb 100644 --- a/resize.c +++ b/resize.c @@ -264,16 +264,9 @@ skip: } static int -default_window_size_skip_client(struct client *loop, int type, +default_window_size_skip_client(struct client *loop, __unused int type, __unused int current, struct session *s, struct window *w) { - /* - * Latest checks separately, so do not check here. Otherwise only - * include clients where the session contains the window or where the - * session is the given session. - */ - if (type == WINDOW_SIZE_LATEST) - return (0); if (w != NULL && !session_has(loop->session, w)) return (1); if (w == NULL && loop->session != s) @@ -305,12 +298,12 @@ default_window_size(struct client *c, struct session *s, struct window *w, goto done; } - /* - * Ignore the given client if it is a control client - the creating - * client should only affect the size if it is not a control client. - */ - if (c != NULL && (c->flags & CLIENT_CONTROL)) - c = NULL; + /* + * Ignore the given client if it is a control client - the creating + * client should only affect the size if it is not a control client. + */ + if (c != NULL && (c->flags & CLIENT_CONTROL)) + c = NULL; /* * Look for a client to base the size on. If none exists (or the type