awful.placement: Keep client position when no space available in no_overlap() (#2139)

This commit is contained in:
Anatolii Aniskovych 2018-05-18 23:55:39 +03:00
parent da418b56ab
commit cbfe8274be
1 changed files with 11 additions and 6 deletions

View File

@ -908,13 +908,18 @@ function placement.no_overlap(c, args)
-- This makes sure to have the whole screen's area in case it has been
-- removed.
if not found then
if #areas == 0 then
areas = { screen.workarea }
end
for _, r in ipairs(areas) do
if r.width * r.height > new.width * new.height then
new = r
if #areas > 0 then
for _, r in ipairs(areas) do
if r.width * r.height > new.width * new.height then
new = r
end
end
elseif grect.area_intersect_area(geometry, screen.workarea) then
new.x = geometry.x
new.y = geometry.y
else
new.x = screen.workarea.x
new.y = screen.workarea.y
end
end