From a760f4b0bcc6d41e4d93647565d603e7dea3ec46 Mon Sep 17 00:00:00 2001 From: Julien Danjou Date: Mon, 8 Dec 2008 16:43:24 +0100 Subject: [PATCH] awful.titlebar: do not overwrite mouse bindings on close Signed-off-by: Julien Danjou --- lib/awful/titlebar.lua.in | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/lib/awful/titlebar.lua.in b/lib/awful/titlebar.lua.in index 553b4d3c..d00b94f4 100644 --- a/lib/awful/titlebar.lua.in +++ b/lib/awful/titlebar.lua.in @@ -84,15 +84,23 @@ function add(c, args) -- Bind kill button, also allow moving and resizing on this widget local bts = { - capi.button({ }, 1, nil, function (t) t.client:kill() end), - capi.button({ args.modkey }, 1, function (t) t.client:mouse_move() end), - capi.button({ args.modkey }, 3, function (t) t.client:mouse_resize() end) + capi.button({ }, 1, nil, function (t) t.client:kill() end), + capi.button({ args.modkey }, 1, function (t) t.client:mouse_move() end), + capi.button({ args.modkey }, 3, function (t) t.client:mouse_resize() end) } if close then + local rbts = close:buttons() + for k, v in pairs(rbts) do + bts[#bts + 1] = v + end close:buttons(bts) function close.mouse_enter(s) hooks.user.call('mouse_enter', c) end end if closef then + local rbts = closef:buttons() + for k, v in pairs(rbts) do + bts[#bts + 1] = v + end closef:buttons(bts) -- Needed for sloppy focus beheaviour function closef.mouse_enter(s) hooks.user.call('mouse_enter', c) end