From ebcc19844e25705270243c614a35ca138a68f152 Mon Sep 17 00:00:00 2001 From: Yauhen Kirylau Date: Sat, 9 Sep 2017 22:26:54 +0200 Subject: [PATCH] fix(awful: placement: no_overlap): use new placement infrastructure (#2032) Fixes #2030 --- lib/awful/placement.lua | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/lib/awful/placement.lua b/lib/awful/placement.lua index 1de4c8bb1..1730b94f6 100644 --- a/lib/awful/placement.lua +++ b/lib/awful/placement.lua @@ -863,10 +863,12 @@ end --- Place the client where there's place available with minimum overlap. --@DOC_awful_placement_no_overlap_EXAMPLE@ -- @param c The client. +-- @tparam[opt={}] table args Other arguments -- @treturn table The new geometry -function placement.no_overlap(c) +function placement.no_overlap(c, args) c = c or capi.client.focus - local geometry = area_common(c) + args = add_context(args, "no_overlap") + local geometry = geometry_common(c, args) local screen = get_screen(c.screen or a_screen.getbycoord(geometry.x, geometry.y)) local cls = client.visible(screen) local curlay = layout.get() @@ -917,7 +919,8 @@ function placement.no_overlap(c) new.width = geometry.width new.height = geometry.height - return c:geometry({ x = new.x, y = new.y }) + geometry_common(c, args, new) + return fix_new_geometry(new, args, true) end --- Place the client under the mouse.