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