mirror of
https://github.com/tmux/tmux.git
synced 2026-10-16 16:44:30 +00:00
Use current window for opening menus from mouse so they do not appear to
be hidden when opened from status line.
This commit is contained in:
17
menu.c
17
menu.c
@@ -1,4 +1,4 @@
|
||||
/* $OpenBSD: menu.c,v 1.72 2026/10/12 10:46:12 nicm Exp $ */
|
||||
/* $OpenBSD: menu.c,v 1.73 2026/10/15 22:16:32 nicm Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2019 Nicholas Marriott <nicholas.marriott@gmail.com>
|
||||
@@ -205,6 +205,7 @@ menu_reapply_styles(struct menu_data *md)
|
||||
s = md->fs.s;
|
||||
wl = md->fs.wl;
|
||||
wp = md->fs.wp;
|
||||
o = md->fs.w->options;
|
||||
}
|
||||
ft = format_create_defaults(NULL, NULL, s, wl, wp);
|
||||
|
||||
@@ -606,18 +607,23 @@ menu_display(struct menu *menu, int flags, int starting_choice,
|
||||
void *data)
|
||||
{
|
||||
struct menu_data *md;
|
||||
struct key_event *event;
|
||||
struct key_event *event = NULL;
|
||||
int choice;
|
||||
const char *name;
|
||||
u_int sx, sy;
|
||||
struct window *w;
|
||||
struct options *o;
|
||||
|
||||
if (fs == NULL)
|
||||
if (item != NULL)
|
||||
event = cmdq_get_event(item);
|
||||
if (fs == NULL || (event != NULL && event->m.valid))
|
||||
w = c->session->curw->window;
|
||||
else
|
||||
w = fs->w;
|
||||
o = w->options;
|
||||
if (fs != NULL)
|
||||
o = fs->w->options;
|
||||
else
|
||||
o = w->options;
|
||||
|
||||
if (lines == BOX_LINES_DEFAULT)
|
||||
lines = options_get_number(o, "menu-border-lines");
|
||||
@@ -639,8 +645,7 @@ menu_display(struct menu *menu, int flags, int starting_choice,
|
||||
md->border_lines = lines;
|
||||
md->key = KEYC_NONE;
|
||||
|
||||
if (item != NULL) {
|
||||
event = cmdq_get_event(item);
|
||||
if (event != NULL) {
|
||||
md->key = event->key;
|
||||
memcpy(&md->m, &event->m, sizeof md->m);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user