commit
40b1a99980
|
@ -761,8 +761,8 @@ function placement.under_mouse(d, args)
|
||||||
local m_coords = capi.mouse.coords()
|
local m_coords = capi.mouse.coords()
|
||||||
|
|
||||||
local ngeo = geometry_common(d, args)
|
local ngeo = geometry_common(d, args)
|
||||||
ngeo.x = m_coords.x - ngeo.width / 2
|
ngeo.x = math.floor(m_coords.x - ngeo.width / 2)
|
||||||
ngeo.y = m_coords.y - ngeo.height / 2
|
ngeo.y = math.floor(m_coords.y - ngeo.height / 2)
|
||||||
|
|
||||||
local bw = d.border_width or 0
|
local bw = d.border_width or 0
|
||||||
ngeo.width = ngeo.width - 2*bw
|
ngeo.width = ngeo.width - 2*bw
|
||||||
|
|
|
@ -403,6 +403,39 @@ table.insert(steps, function()
|
||||||
|
|
||||||
assert(c.first_tag == cur_tag)
|
assert(c.first_tag == cur_tag)
|
||||||
|
|
||||||
|
c:geometry {
|
||||||
|
x = 99,
|
||||||
|
y = 99,
|
||||||
|
width = 99,
|
||||||
|
height = 99,
|
||||||
|
}
|
||||||
|
|
||||||
|
return true
|
||||||
|
end)
|
||||||
|
|
||||||
|
-- Test that odd number sized clients don't move by accident
|
||||||
|
for _=1, 15 do
|
||||||
|
table.insert(steps, function()
|
||||||
|
local c = client.get()[1]
|
||||||
|
|
||||||
|
root.fake_input("button_press",1)
|
||||||
|
amouse.client.move(c)
|
||||||
|
root.fake_input("button_release",1)
|
||||||
|
|
||||||
|
|
||||||
|
return true
|
||||||
|
end)
|
||||||
|
end
|
||||||
|
|
||||||
|
table.insert(steps, function()
|
||||||
|
local c = client.get()[1]
|
||||||
|
root.fake_input("button_release",1)
|
||||||
|
|
||||||
|
assert(c.x == 99)
|
||||||
|
assert(c.y == 99)
|
||||||
|
assert(c.width == 99)
|
||||||
|
assert(c.height == 99)
|
||||||
|
|
||||||
return true
|
return true
|
||||||
end)
|
end)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue