From 462055cb36ffabb022333509a6eaadfe7bf50e35 Mon Sep 17 00:00:00 2001 From: Tim Roes Date: Sat, 22 Aug 2015 14:50:42 +0200 Subject: [PATCH] Add finish callback to awful.mouse.client.move --- lib/awful/mouse/init.lua | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/awful/mouse/init.lua b/lib/awful/mouse/init.lua index 5127e0b04..00f638c07 100644 --- a/lib/awful/mouse/init.lua +++ b/lib/awful/mouse/init.lua @@ -155,7 +155,10 @@ end --- Move a client. -- @param c The client to move, or the focused one if nil. -- @param snap The pixel to snap clients. -function mouse.client.move(c, snap) +-- @param finished_cb An optional callback function, that will be called +-- when moving the client has been finished. The client +-- that has been moved will be passed to that function. +function mouse.client.move(c, snap, finished_cb) local c = c or capi.client.focus if not c @@ -206,6 +209,9 @@ function mouse.client.move(c, snap) return true end end + if finished_cb then + finished_cb(c) + end return false end, "fleur") end