-/* $OpenBSD: menu.c,v 1.42 2022/02/01 11:52:08 nicm Exp $ */
+/* $OpenBSD: menu.c,v 1.43 2022/02/01 18:12:20 nicm Exp $ */
/*
* Copyright (c) 2019 Nicholas Marriott <nicholas.marriott@gmail.com>
menu->count--;
return;
}
- if (c->tty.sx <= 4)
- return;
max_width = c->tty.sx - 4;
slen = strlen(s);
-/* $OpenBSD: mode-tree.c,v 1.61 2021/12/06 10:10:52 nicm Exp $ */
+/* $OpenBSD: mode-tree.c,v 1.62 2022/02/01 18:12:20 nicm Exp $ */
/*
* Copyright (c) 2017 Nicholas Marriott <nicholas.marriott@gmail.com>
struct mode_tree_data *data;
struct client *c;
u_int line;
- void *itemdata;
};
static void mode_tree_free_items(struct mode_tree_list *);
mode_tree_menu_callback(__unused struct menu *menu, __unused u_int idx,
key_code key, void *data)
{
- struct mode_tree_menu *mtm = data;
- struct mode_tree_data *mtd = mtm->data;
- struct mode_tree_item *mti;
+ struct mode_tree_menu *mtm = data;
+ struct mode_tree_data *mtd = mtm->data;
if (mtd->dead || key == KEYC_NONE)
goto out;
if (mtm->line >= mtd->line_size)
goto out;
- mti = mtd->line_list[mtm->line].item;
- if (mti->itemdata != mtm->itemdata)
- goto out;
mtd->current = mtm->line;
mtd->menucb(mtd->modedata, mtm->c, key);
title = xstrdup("");
}
menu = menu_create(title);
- menu_add_items(menu, items, NULL, NULL, NULL);
+ menu_add_items(menu, items, NULL, c, NULL);
free(title);
mtm = xmalloc(sizeof *mtm);
mtm->data = mtd;
mtm->c = c;
mtm->line = line;
- mtm->itemdata = mti->itemdata;
mtd->references++;
if (x >= (menu->width + 4) / 2)
-/* $OpenBSD: popup.c,v 1.43 2022/01/17 10:40:03 nicm Exp $ */
+/* $OpenBSD: popup.c,v 1.44 2022/02/01 18:12:20 nicm Exp $ */
/*
* Copyright (c) 2020 Nicholas Marriott <nicholas.marriott@gmail.com>
menu:
pd->menu = menu_create("");
if (pd->flags & POPUP_INTERNAL) {
- menu_add_items(pd->menu, popup_internal_menu_items, NULL, NULL,
+ menu_add_items(pd->menu, popup_internal_menu_items, NULL, c,
NULL);
} else
- menu_add_items(pd->menu, popup_menu_items, NULL, NULL, NULL);
+ menu_add_items(pd->menu, popup_menu_items, NULL, c, NULL);
if (m->x >= (pd->menu->width + 4) / 2)
x = m->x - (pd->menu->width + 4) / 2;
else