tests: Fix a regression in the placement rendering.

One is a real bug introduced by some ruled.client changes which
cause the clients to be moved twice in the first loop. This needs
fixing, but is mitigated for the doc.

The other is mostly fixed in the last commit and was a shim bug.
This commit is contained in:
Emmanuel Lepage Vallee 2020-03-21 20:26:58 -04:00
parent e5a84e2fda
commit f982cecd6b
5 changed files with 6 additions and 3 deletions

View File

@ -7,7 +7,7 @@ for _, pos in ipairs{
"left", "right", "top", "bottom", "centered", "left", "right", "top", "bottom", "centered",
} do } do
local c1 = client.gen_fake {x = 80, y = 55, width=75, height=50} local c1 = client.gen_fake {x = 80, y = 55, width=75, height=50}
c1:_hide() c1:_hide_all()
placement.align(client.focus, {position = pos, honor_workarea=true}) placement.align(client.focus, {position = pos, honor_workarea=true})
c1:set_label(pos) c1:set_label(pos)
end end

View File

@ -10,6 +10,7 @@ for k, pos in ipairs{ --DOC_HIDE
local c1 = client.gen_fake {--DOC_HIDE local c1 = client.gen_fake {--DOC_HIDE
x = screen[k].geometry.x+40, --DOC_HIDE x = screen[k].geometry.x+40, --DOC_HIDE
y = screen[k].geometry.y+40, width=75, height=50, screen=screen[k]} --DOC_HIDE y = screen[k].geometry.y+40, width=75, height=50, screen=screen[k]} --DOC_HIDE
c1:_hide_all() --DOC_HIDE
placement.maximize(c1, {axis = pos ~= "" and pos or nil}) --DOC_HIDE placement.maximize(c1, {axis = pos ~= "" and pos or nil}) --DOC_HIDE
if k == 1 then --DOC_HIDE if k == 1 then --DOC_HIDE

View File

@ -8,6 +8,7 @@ screen[1]._resize {width = 128, height = 96} --DOC_HIDE
local placement = require("awful.placement") --DOC_HIDE local placement = require("awful.placement") --DOC_HIDE
local c = client.gen_fake {x = 45, y = 35, width=40, height=30} --DOC_HIDE local c = client.gen_fake {x = 45, y = 35, width=40, height=30} --DOC_HIDE
c:_hide_all() --DOC_HIDE
placement.maximize_horizontally(c) placement.maximize_horizontally(c)
assert(c.width + 2*c.border_width == screen[1].geometry.width) --DOC_HIDE assert(c.width + 2*c.border_width == screen[1].geometry.width) --DOC_HIDE

View File

@ -8,6 +8,7 @@ screen[1]._resize {width = 128, height = 96} --DOC_HIDE
local placement = require("awful.placement") --DOC_HIDE local placement = require("awful.placement") --DOC_HIDE
local c = client.gen_fake {x = 45, y = 35, width=40, height=30} --DOC_HIDE local c = client.gen_fake {x = 45, y = 35, width=40, height=30} --DOC_HIDE
c:_hide_all() --DOC_HIDE
placement.maximize_vertically(c) placement.maximize_vertically(c)
assert(c.height+2*c.border_width == screen[1].geometry.height)--DOC_HIDE assert(c.height+2*c.border_width == screen[1].geometry.height)--DOC_HIDE

View File

@ -3,14 +3,14 @@ local awful = { placement = require("awful.placement") }--DOC_HIDE
screen[1]._resize {x= 0, width = 640, height=200} --DOC_HIDE screen[1]._resize {x= 0, width = 640, height=200} --DOC_HIDE
local parent_client = client.gen_fake {x = 0, y = 0, width=350, height=70} --DOC_HIDE local parent_client = client.gen_fake {x = 0, y = 0, width=350, height=70} --DOC_HIDE
parent_client:_hide() --DOC_HIDE parent_client:_hide_all() --DOC_HIDE
awful.placement.centered(client.focus) --DOC_HIDE awful.placement.centered(client.focus) --DOC_HIDE
parent_client:set_label("Parent client") --DOC_HIDE parent_client:set_label("Parent client") --DOC_HIDE
for _, pos in ipairs{"left", "right", "top", "bottom"} do for _, pos in ipairs{"left", "right", "top", "bottom"} do
for _, anchor in ipairs{"front", "middle", "back"} do for _, anchor in ipairs{"front", "middle", "back"} do
local c1 = client.gen_fake {x = 0, y = 0, width=80, height=20} --DOC_HIDE local c1 = client.gen_fake {x = 0, y = 0, width=80, height=20} --DOC_HIDE
c1:_hide() --DOC_HIDE c1:_hide_all() --DOC_HIDE
local _,p,a = --DOC_HIDE local _,p,a = --DOC_HIDE
awful.placement.next_to( awful.placement.next_to(
client.focus, client.focus,