[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
master 0a70f748e7: Don't send menu help events on Haiku if the pointer i
From: |
Po Lu |
Subject: |
master 0a70f748e7: Don't send menu help events on Haiku if the pointer isn't in the menu |
Date: |
Tue, 25 Jan 2022 05:06:19 -0500 (EST) |
branch: master
commit 0a70f748e759b77a760be2efac8e2460b777c6f5
Author: Po Lu <luangruo@yahoo.com>
Commit: Po Lu <luangruo@yahoo.com>
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 ae2736110e..23f7472e3f 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);
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- master 0a70f748e7: Don't send menu help events on Haiku if the pointer isn't in the menu,
Po Lu <=