Finally, I tried the following and that works : mymainmenu is the standard awesome menu, it appears when the mouse comes above its icon, and disappears when the mouse leaves the menu or one of the submenus.

-- comment out the awesome menu launcher :
--mylauncher = awful.widget.launcher({ image =
--              image(beautiful.awesome_icon),
--                            menu = mymainmenu })


-- awesome menu without clicks
menuautoicon = widget({ type = "imagebox" })
menuautoicon.image = image(beautiful.awesome_icon)

menuautoicon:add_signal("mouse::enter", function ()
                mymainmenu:show()
end)

client.add_signal("manage", function (c, startup)
    -- Sets hook for any particular client @c
                  c:add_signal("mouse::enter", function(x)
                mymainmenu:hide()
      end)
end)
-- awesome menu without clicks

The only remaining problem is the menu don't appear just under the awesome menu icon, but with some right shift. This shift is exacly equal to the distance between the screen border and the position of the mouse pointer when it enters on the icon ; so the max shift is equal to the icon width (the awesome menu icon being at the top left corner of the screen).

If someone can give me a trick to avoid that... I would like to have a solution, so that I would write that improvement on the wiki : that avoids 1 clicks to get the menu or 2 to get and leave it. Ergonomy, ergonomy...

Jean-Luc



Le 04/12/10 11:51, Duflot Jean-Luc a écrit :

Thanks, it works ! So I can do that the awesome menu disappears when no
selection by click has bee done.

It remains to me to do that this menu appears only when the mouse goes
on its icon.

I tried :

-- c:add_signal("mouse::enter", function(x)
-- mymainmenu:show()
-- end)

but it does'nt work.
I assume it's because it's specific to the awful.menu function, which
makes the menu appearing only with a mouse click ?

Jean-Luc


Le 10/04/2010 22:32, Sergey Mironov a écrit :

Hm. Try to do the following:

mymenudrawericon = widget({ type = "imagebox" })
mymenudrawericon.image = image(beautiful.widget_menu)
-- ...
mymenudrawericon:add_signal("mouse::enter", function ()
mymenudirect:show()
end)

-- Comment it out
--mymenudrawericon:add_signal("mouse::leave", function ()
-- mymenudirect:hide()
--end)

-- Hook function to execute when a new client appears.
client.add_signal("manage", function (c, startup)
-- Sets hook for any particular client @c
c:add_signal("mouse::enter", function(x)
mymenudirect:hide()
end)
end)

I can't test it now, but hope it will work.









--
To unsubscribe, send mail to [email protected].

Reply via email to