From 0a70f748e759b77a760be2efac8e2460b777c6f5 Mon Sep 17 00:00:00 2001 From: Po Lu Date: Tue, 25 Jan 2022 10:02:16 +0000 Subject: [PATCH] Don't send menu help events on Haiku if the pointer isn't in the menu * src/haiku_support.cc (Highlight): Only send help events if the mouse cursor is actually in the menu. --- src/haiku_support.cc | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/haiku_support.cc b/src/haiku_support.cc index ae2736110ec..23f7472e3ff 100644 --- a/src/haiku_support.cc +++ b/src/haiku_support.cc @@ -1635,17 +1635,23 @@ public: Highlight (bool highlight_p) { struct haiku_menu_bar_help_event rq; + BMenu *menu = Menu (); + BRect r; + BPoint pt; + uint32 buttons; if (help) - { - Menu ()->SetToolTip (highlight_p ? help : NULL); - } + menu->SetToolTip (highlight_p ? help : NULL); else if (menu_bar_id >= 0) { rq.window = wind_ptr; rq.mb_idx = highlight_p ? menu_bar_id : -1; - haiku_write (MENU_BAR_HELP_EVENT, &rq); + r = Frame (); + menu->GetMouse (&pt, &buttons); + + if (r.Contains (pt)) + haiku_write (MENU_BAR_HELP_EVENT, &rq); } BMenuItem::Highlight (highlight_p); -- 2.39.2