Improved fix for #240 by makeing instance local to client_menu_toggle_fn
This commit is contained in:
parent
09de5c8f53
commit
702fa1967c
|
@ -74,13 +74,16 @@ awful.layout.layouts = {
|
||||||
-- }}}
|
-- }}}
|
||||||
|
|
||||||
-- {{{ Helper functions
|
-- {{{ Helper functions
|
||||||
local client_menu_instance = nil
|
local function client_menu_toggle_fn()
|
||||||
local function client_menu_toggle()
|
local instance = nil
|
||||||
if client_menu_instance and client_menu_instance.wibox.visible then
|
|
||||||
client_menu_instance:hide()
|
return function ()
|
||||||
client_menu_instance = nil
|
if instance and instance.wibox.visible then
|
||||||
|
instance:hide()
|
||||||
|
instance = nil
|
||||||
else
|
else
|
||||||
client_menu_instance = awful.menu.clients({ theme = { width = 250 } })
|
instance = awful.menu.clients({ theme = { width = 250 } })
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
-- }}}
|
-- }}}
|
||||||
|
@ -162,9 +165,7 @@ mytasklist.buttons = awful.util.table.join(
|
||||||
c:raise()
|
c:raise()
|
||||||
end
|
end
|
||||||
end),
|
end),
|
||||||
awful.button({ }, 3, function ()
|
awful.button({ }, 3, client_menu_toggle_fn()),
|
||||||
client_menu_toggle()
|
|
||||||
end),
|
|
||||||
awful.button({ }, 4, function ()
|
awful.button({ }, 4, function ()
|
||||||
awful.client.focus.byidx(1)
|
awful.client.focus.byidx(1)
|
||||||
end),
|
end),
|
||||||
|
|
Loading…
Reference in New Issue