From 502b52cbdf550ec88ed0fcdac323f77049e93d3d Mon Sep 17 00:00:00 2001 From: nicm Date: Sat, 5 Oct 2024 12:10:16 +0000 Subject: [PATCH] Send focus events to pane when entering or leaving popup, GitHub issue 3991. --- usr.bin/tmux/server-client.c | 4 +++- usr.bin/tmux/window.c | 5 +++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/usr.bin/tmux/server-client.c b/usr.bin/tmux/server-client.c index 6e63416e9cd..c63c7628950 100644 --- a/usr.bin/tmux/server-client.c +++ b/usr.bin/tmux/server-client.c @@ -1,4 +1,4 @@ -/* $OpenBSD: server-client.c,v 1.410 2024/10/01 06:15:47 nicm Exp $ */ +/* $OpenBSD: server-client.c,v 1.411 2024/10/05 12:10:16 nicm Exp $ */ /* * Copyright (c) 2009 Nicholas Marriott @@ -121,6 +121,7 @@ server_client_set_overlay(struct client *c, u_int delay, c->tty.flags |= TTY_FREEZE; if (c->overlay_mode == NULL) c->tty.flags |= TTY_NOCURSOR; + window_update_focus(c->session->curw->window); server_redraw_client(c); } @@ -145,6 +146,7 @@ server_client_clear_overlay(struct client *c) c->overlay_data = NULL; c->tty.flags &= ~(TTY_FREEZE|TTY_NOCURSOR); + window_update_focus(c->session->curw->window); server_redraw_client(c); } diff --git a/usr.bin/tmux/window.c b/usr.bin/tmux/window.c index 2c92c4f8625..ab0b49e9a21 100644 --- a/usr.bin/tmux/window.c +++ b/usr.bin/tmux/window.c @@ -1,4 +1,4 @@ -/* $OpenBSD: window.c,v 1.294 2024/10/01 08:01:19 nicm Exp $ */ +/* $OpenBSD: window.c,v 1.295 2024/10/05 12:10:16 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott @@ -482,7 +482,8 @@ window_pane_update_focus(struct window_pane *wp) if (c->session != NULL && c->session->attached != 0 && (c->flags & CLIENT_FOCUSED) && - c->session->curw->window == wp->window) { + c->session->curw->window == wp->window && + c->overlay_draw == NULL) { focused = 1; break; } -- 2.20.1