Re: [AD] Non-blocking menus block during menu cancellation click

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


> This is to report a minor concern I discovered while digging in the menu
> code; that menus block until all mouse buttons are released when a mouse
> click is used to cancel and close the menu (do { } while (gui_mouse_b();).

At lines 2069-2070 in gui.c?

> 1) alter the mouse code to have an 'ignore' mask; the purpose of which is
> to ignore the held mouse button (report it as released) until the next
> press, which can either be internal for the GUI, or documented but
> reserved when the GUI is in use;
> 2) instead, alter the GUI code to wrap gui_mouse_b() to support similar
> behavior.

Can't we simply keep the menu sort of alive until all buttons are released? 
That is, move the two lines at stake from d_menu_proc() to update_dialog() 
and add a new static variable so as to have a 3-state cycle for non-blocking 
menus:

	... ---> unactive --> active --> zombie --> unactive --> ...

The transition from zombie to unactive is done when all buttons are released.

> A minor related suggestion, at least for while interfacing with the
> display can conflict with active menus, or while menu cancellation can
> block; adding a new function to report IF a menu is active, such as:
>
> int gui_menu_is_active(void)
> {
>  return (active_menu_player) ? TRUE : FALSE;
> }

I'd rather not add it because it would mean that we haven't come up with 
something clean enough. We could eventually add it, but as a last resort 
solution.

-- 
Eric Botcazou




Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/