fix client:activate action mouse_center (#3257)

This commit is contained in:
jpkotta 2021-03-01 01:03:14 -06:00 committed by GitHub
parent db330e0cfe
commit aba1cf398f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -1531,13 +1531,13 @@ function client.object.activate(c, args)
elseif new_args.action and new_args.action == "mouse_resize" then
amousec.resize(c)
elseif new_args.action and new_args.action == "mouse_center" then
local coords, geo = mouse.mouse.coords(), c:geometry()
local coords, geo = capi.mouse.coords(), c:geometry()
coords.width, coords.height = 1,1
if not grect.area_intersect_area(geo, coords) then
-- Do not use `awful.placement` to avoid an useless circular
-- dependency. Centering is *very* simple.
mouse.mouse.coords {
capi.mouse.coords {
x = geo.x + math.ceil(geo.width /2),
y = geo.y + math.ceil(geo.height/2)
}