From 90aa0eb26c5358023c0966291159d0931e8f59a8 Mon Sep 17 00:00:00 2001 From: nicm Date: Wed, 21 Jul 2021 08:09:43 +0000 Subject: [PATCH] Do not add height twice when calculating popup_mouse_top, from M Kelly. --- usr.bin/tmux/cmd-display-menu.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/usr.bin/tmux/cmd-display-menu.c b/usr.bin/tmux/cmd-display-menu.c index 2e984202bb2..7604b36adce 100644 --- a/usr.bin/tmux/cmd-display-menu.c +++ b/usr.bin/tmux/cmd-display-menu.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cmd-display-menu.c,v 1.25 2021/07/08 11:14:53 nicm Exp $ */ +/* $OpenBSD: cmd-display-menu.c,v 1.26 2021/07/21 08:09:43 nicm Exp $ */ /* * Copyright (c) 2019 Nicholas Marriott @@ -175,7 +175,7 @@ cmd_display_menu_get_position(struct client *tc, struct cmdq_item *item, } else format_add(ft, "popup_mouse_centre_y", "%ld", n); n = (long)event->m.y + h; - if (n + h >= tty->sy) + if (n >= tty->sy) format_add(ft, "popup_mouse_top", "%u", tty->sy - 1); else format_add(ft, "popup_mouse_top", "%ld", n); -- 2.20.1