From bfa248ae2944e465830e9fbf019ba5ba9abaa037 Mon Sep 17 00:00:00 2001 From: Levi Neely <141506390+lneely@users.noreply.github.com> Date: Wed, 13 May 2026 17:48:08 +0200 Subject: [PATCH] Fix findMenu y_ret: subtract top_width for content-relative coords MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit findMenu was returning y relative to the frame top (including titlebar). getEntryAt expects y relative to the content area. Subtracting top_width means pointer in titlebar gives y<0 → entry_no=-1 (no selection), which is correct behavior matching the X11 path. --- src/menu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/menu.c b/src/menu.c index 528deeb..bd4d0b2 100644 --- a/src/menu.c +++ b/src/menu.c @@ -1123,7 +1123,7 @@ static WMenu *findMenu(WScreen * scr, int *x_ret, int *y_ret) x >= (m)->frame_x && x < (m)->frame_x + MENUW(m) && \ y >= (m)->frame_y && y < (m)->frame_y + MENUH(m)) { \ *x_ret = x - (m)->frame_x; \ - *y_ret = y - (m)->frame_y; \ + *y_ret = y - (m)->frame_y - (m)->frame->top_width; \ return (m); \ } \ } while(0)