awful: implement under_mouse placement
Signed-off-by: Julien Danjou <julien@danjou.info>
This commit is contained in:
parent
ba20d32d10
commit
f0fe2e03c6
|
@ -71,6 +71,7 @@ widget.tasklist.label = {}
|
|||
client.urgent = {}
|
||||
client.urgent.stack = {}
|
||||
client.urgent.stack.data = {}
|
||||
placement = {}
|
||||
|
||||
--- Strip alpha part of color.
|
||||
-- @param color The color.
|
||||
|
@ -1605,6 +1606,15 @@ function widget.button(args)
|
|||
return w
|
||||
end
|
||||
|
||||
--- Place the client under the mouse.
|
||||
-- @param c The client.
|
||||
function placement.under_mouse(c)
|
||||
local c_coords = c:coords()
|
||||
local m_coords = capi.mouse.coords()
|
||||
c:coords({ x = m_coords.x - c_coords.width / 2,
|
||||
y = m_coords.y - c_coords.height / 2 })
|
||||
end
|
||||
|
||||
-- Register standards hooks
|
||||
hooks.arrange.register(tag.history.update)
|
||||
|
||||
|
|
Loading…
Reference in New Issue