rc.lua: Do not hardcode the default client buttons.

This commit moves the previously hardcoded client button list
to the `awful.client` default button set. This will allow modules
to add their own buttons.

In later commit, those default buttons will also be added dynamically
to existing clients.
This commit is contained in:
Emmanuel Lepage Vallee 2019-10-16 02:55:35 -04:00
parent 44a665d381
commit 767a8e4f6d
1 changed files with 15 additions and 14 deletions

View File

@ -437,19 +437,21 @@ awful.keyboard.append_global_keybindings({
}) })
-- @DOC_CLIENT_BUTTONS@ -- @DOC_CLIENT_BUTTONS@
clientbuttons = { client.connect_signal("request::default_mousebindings", function()
awful.button({ }, 1, function (c) awful.mouse.append_client_mousebindings({
c:emit_signal("request::activate", "mouse_click", {raise = true}) awful.button({ }, 1, function (c)
end), c:emit_signal("request::activate", "mouse_click", {raise = true})
awful.button({ modkey }, 1, function (c) end),
c:emit_signal("request::activate", "mouse_click", {raise = true}) awful.button({ modkey }, 1, function (c)
awful.mouse.client.move(c) c:emit_signal("request::activate", "mouse_click", {raise = true})
end), awful.mouse.client.move(c)
awful.button({ modkey }, 3, function (c) end),
c:emit_signal("request::activate", "mouse_click", {raise = true}) awful.button({ modkey }, 3, function (c)
awful.mouse.client.resize(c) c:emit_signal("request::activate", "mouse_click", {raise = true})
end), awful.mouse.client.resize(c)
} end),
})
end)
-- }}} -- }}}
@ -465,7 +467,6 @@ awful.rules.rules = {
focus = awful.client.focus.filter, focus = awful.client.focus.filter,
raise = true, raise = true,
keys = clientkeys, keys = clientkeys,
buttons = clientbuttons,
screen = awful.screen.preferred, screen = awful.screen.preferred,
placement = awful.placement.no_overlap+awful.placement.no_offscreen placement = awful.placement.no_overlap+awful.placement.no_offscreen
} }