Hello,
I'm trying to create my own menu for awesome and I think there is a lack
in the Menu object : we have no way to know if a menu is visible or not.
The way found in the tasklist is not valid :
>if instance then
> instance:hide()
> instance = nil
>else
> instance = awful.menu.clients({ width=250 })
>end
When the user select an entry in the menu, the instance still exist ( but
the menu is not visible anymore ), and on next click we delete the hidden
menu instead of creating a new one.
To correct this, I add this method in the awful.menu.lua :
>-- Check the visibility.
>-- @param menu The menu to check.
>-- @return A boolean telling if the menu is visible
>function isvisible(menu)
> return menu.items[1] and menu.items[1].wibox.screen
>end
(and registered it in the new() function)
and now test the instance like that :
>if instance and instance:isvisible() then
> instance:hide()
> instance = nil
>else
> instance = awful.menu.clients( { width=500 } )
>end
May this help…
Sébastien
--
To unsubscribe, send mail to [email protected].