From 649e5970e98b0073763f42a25dcab02aadea688f Mon Sep 17 00:00:00 2001 From: nicm Date: Fri, 30 Oct 2020 08:55:56 +0000 Subject: 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. --- cmd-display-menu.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'cmd-display-menu.c') 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, -- cgit v1.2.3