Add finish callback to awful.mouse.client.move

This commit is contained in:
Tim Roes 2015-08-22 14:50:42 +02:00
parent 66c4ff7f2c
commit 462055cb36

View file

@ -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