[haiku-development] Re: New menu tracking implementation

"Stefano Ceccherini" <stefano.ceccherini@xxxxxxxxx> wrote:
> With the latest patch, menufields work, but there is still a problem:
> clicking and releasing the mouse on a menufield doesn't keep the menu
> opened, because the newly opened menu receives a B_MOUSE_UP event.
> I've been looking for a way to avoid adding stuff to BMenu to handle
> that, but I think it's inevitable: I guess we'll end up adding a
> special case to BMenu for when it's attached to a BMenuField, like
> with the old implementation.

I don't understand why this problem is BMenuField specific - what's so 
different with those? I thought they just had a BMenuBar internally as 
well?

> Another problem of the current patch is this: the only menu with the
> event mask set is the root one, but this implies having lots of
> special casing to check if the mouse movement happens in the root 
> menu
> or not, because it needs to be handled differently.

Just ignore mouse moves outside the view (ie. everything that is not 
B_ENTERED_VIEW or B_INSIDE_VIEW)?

> In fact, now that I worked on this implementation, I think that a
> better option would be to have the event mask set only on the last
> child, although doing that client side would mean: every time a child
> menu is opened, reset the event mask on the current menu, set the
> event mask on the newly opened menu.
> In this case, having the event mask set, server side, always on the
> last opened menu would be simpler, maybe.

I would prefer not to change the server too much for menus when it can 
be solved client-side with the existing logic (ie. everyone should be 
able to do his own menus using the standard API).

Bye,
   Axel.


Other related posts: