summaryrefslogtreecommitdiffstats
path: root/menu.c
diff options
context:
space:
mode:
authornicm <nicm>2022-06-16 13:27:39 +0000
committernicm <nicm>2022-06-16 13:27:39 +0000
commit7cee982f909d29e7331d35bd9c21d337688b9ea1 (patch)
tree658539a47b531c1b95bd06f5cc932fba6a4d782e /menu.c
parent616bde08ac74d4be0ae06087aa3103df54833f86 (diff)
Keep cursor on selected item on menu (useful for blind people), GitHub
issue 3225.
Diffstat (limited to 'menu.c')
-rw-r--r--menu.c9
1 files 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);
}