From 7cee982f909d29e7331d35bd9c21d337688b9ea1 Mon Sep 17 00:00:00 2001 From: nicm Date: Thu, 16 Jun 2022 13:27:39 +0000 Subject: [PATCH] Keep cursor on selected item on menu (useful for blind people), GitHub issue 3225. --- menu.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/menu.c b/menu.c index 16120bed..dc3b289f 100644 --- a/menu.c +++ b/menu.c @@ -160,11 +160,16 @@ menu_free(struct menu *menu) } struct screen * -menu_mode_cb(__unused struct client *c, void *data, __unused u_int *cx, - __unused u_int *cy) +menu_mode_cb(__unused struct client *c, void *data, u_int *cx, u_int *cy) { struct menu_data *md = data; + *cx = md->px + 2; + if (md->choice == -1) + *cy = md->py; + else + *cy = md->py + 1 + md->choice; + return (&md->s); }