[haiku-development] BMenu click behaviour

  • From: Julian Harnath <julian.harnath@xxxxxxxxxxxxxx>
  • To: haiku-development@xxxxxxxxxxxxx
  • Date: Wed, 20 Nov 2013 11:35:41 +0100

Hello,

I've been looking into a bug which crashes Gobe Productive whenever you 
click twice on one of its toolbar popup-menu buttons (i.e. click on the 
button again while the popup-menu is already open -> crash).

The problem is in BMenu -- when you call BMenu::Show() twice, it crashes 
(view gets added twice which calls into debugger()). The second click 
on a popup menu in Gobe running on Haiku causes Show() to be called a 
second time.

I checked how it works in BeOS. With a little test application I 
verified that it also  crashes when BMenu::Show() is called twice, so 
Haiku is not different in this regard. However, when a BMenu is shown 
on BeOS, you cannot click on anything else in the window until the menu 
is closed again. That is why clicking twice doesn't crash when running 
Gobe on BeOS: the second click doesn't register.
On Haiku, when a menu is open, you can still directly click other UI 
elements (click goes through).

So, questions...
- is this different behaviour intentional? (I assume yes, in the end 
click-goes-through seems more useful.)
- if yes, should we fix it by allowing BMenu::Show() to be called more 
than once, i.e. ignore further calls when the menu is already open?

--
So long, jua

Other related posts: