summaryrefslogtreecommitdiffstats
path: root/cmd-display-menu.c
diff options
context:
space:
mode:
authornicm <nicm>2020-10-30 08:55:56 +0000
committernicm <nicm>2020-10-30 08:55:56 +0000
commit649e5970e98b0073763f42a25dcab02aadea688f (patch)
tree9918f6fc4c7830ff919f9f2fbabdfc38bb16e76c /cmd-display-menu.c
parenta868bacb46e3c900530bed47a1c6f85b0fbe701c (diff)
Add a -O flag to display-menu to change the mouse behaviour and not
close the menu when the mouse is released, from teo_paul1 at yahoo dot com.
Diffstat (limited to 'cmd-display-menu.c')
-rw-r--r--cmd-display-menu.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/cmd-display-menu.c b/cmd-display-menu.c
index ae322444..205d1243 100644
--- a/cmd-display-menu.c
+++ b/cmd-display-menu.c
@@ -36,8 +36,8 @@ const struct cmd_entry cmd_display_menu_entry = {
.name = "display-menu",
.alias = "menu",
- .args = { "c:t:T:x:y:", 1, -1 },
- .usage = "[-c target-client] " CMD_TARGET_PANE_USAGE " [-T title] "
+ .args = { "c:t:OT:x:y:", 1, -1 },
+ .usage = "[-O] [-c target-client] " CMD_TARGET_PANE_USAGE " [-T title] "
"[-x position] [-y position] name key command ...",
.target = { 't', CMD_FIND_PANE, 0 },
@@ -229,6 +229,8 @@ cmd_display_menu_exec(struct cmd *self, struct cmdq_item *item)
cmd_display_menu_get_position(tc, item, args, &px, &py, menu->width + 4,
menu->count + 2);
+ if (args_has(args, 'O'))
+ flags |= MENU_STAYOPEN;
if (!event->m.valid)
flags |= MENU_NOMOUSE;
if (menu_display(menu, flags, item, px, py, tc, target, NULL,