From e995f1c83391d89dbf37836aac90443c7bd5199b Mon Sep 17 00:00:00 2001 From: Luca Capezzuto Date: Fri, 20 Aug 2021 19:13:53 +0200 Subject: [PATCH] rewrite hide function for menu; #291 --- rc.lua.template | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/rc.lua.template b/rc.lua.template index 155d273..cbfb8d3 100644 --- a/rc.lua.template +++ b/rc.lua.template @@ -197,8 +197,23 @@ awful.util.mymainmenu = freedesktop.menu.build { } } --- hide menu when mouse leaves it ---awful.util.mymainmenu.wibox:connect_signal("mouse::leave", function() awful.util.mymainmenu:hide() end) +-- Hide the menu when the mouse leaves it +--[[ +awful.util.mymainmenu.wibox:connect_signal("mouse::leave", function() + if not awful.util.mymainmenu.active_child or + (awful.util.mymainmenu.wibox ~= mouse.current_wibox and + awful.util.mymainmenu.active_child.wibox ~= mouse.current_wibox) then + awful.util.mymainmenu:hide() + else + awful.util.mymainmenu.active_child.wibox:connect_signal("mouse::leave", + function() + if awful.util.mymainmenu.wibox ~= mouse.current_wibox then + awful.util.mymainmenu:hide() + end + end) + end +end) +--]] -- Set the Menubar terminal for applications that require it --menubar.utils.terminal = terminal