From 767a8e4f6d121e0fc7b9b8ac239bd24f6ced2a05 Mon Sep 17 00:00:00 2001 From: Emmanuel Lepage Vallee Date: Wed, 16 Oct 2019 02:55:35 -0400 Subject: [PATCH] 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. --- awesomerc.lua | 29 +++++++++++++++-------------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/awesomerc.lua b/awesomerc.lua index 11d4cf82..9d0e042a 100644 --- a/awesomerc.lua +++ b/awesomerc.lua @@ -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 }