Do not raise a pane when the mouse moves onto it.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
Michael Grant
2026-10-01 21:01:50 +01:00
parent 03c87a8b2f
commit 64d5c585c6
5 changed files with 94 additions and 2 deletions

View File

@@ -73,6 +73,8 @@ static struct window_pane *window_pane_create(struct window *, u_int, u_int,
static void window_pane_destroy(struct window_pane *);
static void window_pane_free(struct window_pane *);
static void window_pane_scrollbar_timer(int, short, void *);
static int window_activate_pane(struct window *, struct window_pane *, int,
int);
static void window_pane_full_size_offset(struct window_pane *, int *, int *,
u_int *, u_int *);
@@ -742,6 +744,20 @@ window_pane_update_focus(struct window_pane *wp)
int
window_set_active_pane(struct window *w, struct window_pane *wp, int notify)
{
return (window_activate_pane(w, wp, notify, 1));
}
/* Make a pane active without raising it, as when the mouse moves onto it. */
int
window_focus_pane(struct window *w, struct window_pane *wp, int notify)
{
return (window_activate_pane(w, wp, notify, 0));
}
static int
window_activate_pane(struct window *w, struct window_pane *wp, int notify,
int raise)
{
struct window_pane *lastwp;
@@ -761,7 +777,7 @@ window_set_active_pane(struct window *w, struct window_pane *wp, int notify)
window_raise_pane(wp);
else
window_unzoom(w, 1);
} else {
} else if (raise) {
/* Raise the pane if the option says to. */
switch (options_get_number(w->options, "pane-raise-on-focus")) {
case PANE_RAISE_FLOATING: