From d6568993e230f47cc8eaf724274d278b4172569d Mon Sep 17 00:00:00 2001 From: Emmanuel Lepage Vallee Date: Wed, 16 Oct 2019 02:49:05 -0400 Subject: [PATCH] awful.mouse: Add a "request::default_mousebindings" signal. `rc.lua` and the module must attach to this signal to add buttons to the default set. --- lib/awful/mouse/init.lua | 9 +++++++++ objects/client.c | 11 +++++++++++ 2 files changed, 20 insertions(+) diff --git a/lib/awful/mouse/init.lua b/lib/awful/mouse/init.lua index 67045f62f..0d4554a62 100644 --- a/lib/awful/mouse/init.lua +++ b/lib/awful/mouse/init.lua @@ -529,6 +529,15 @@ end) -- when button 1 is pressed. -- @staticfct mouse.coords +capi.client.connect_signal("scanning", function() + capi.client.emit_signal("request::default_mousebindings", "startup") +end) + +-- Private function to be used by `ruled.client`. +function mouse._get_client_mousebindings() + return default_buttons +end + return mouse -- vim: filetype=lua:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:textwidth=80 diff --git a/objects/client.c b/objects/client.c index e9b47a15c..734592ba3 100644 --- a/objects/client.c +++ b/objects/client.c @@ -244,6 +244,17 @@ * @signal request::urgent */ +/** Emitted during startup to gather the default client mousebindings. + * + * This signals gives a chance to all module to register new client keybindings. + * Assuming the client rules does not overwrite them with the `keys` property, + * they will be added to all clients. + * + * @signal request::default_mousebindings + * @tparam string context The reason why the signal was sent (currently always + * `startup`). +*/ + /** When a client gets tagged. * @signal tagged * @tag t The tag object.