diff --git a/lib/awful/mouse/init.lua b/lib/awful/mouse/init.lua index 23d11d4bb..9e094fb6f 100644 --- a/lib/awful/mouse/init.lua +++ b/lib/awful/mouse/init.lua @@ -234,22 +234,11 @@ function mouse.resize_handler(c, context, hints) local lay = c.screen.selected_tag.layout if lay == layout.suit.floating or c.floating then - local offset = hints and hints.offset or {} - - if type(offset) == "number" then - offset = { - x = offset, - y = offset, - width = offset, - height = offset, - } - end - c:geometry { - x = hints.x + (offset.x or 0 ), - y = hints.y + (offset.y or 0 ), - width = hints.width + (offset.width or 0 ), - height = hints.height + (offset.height or 0 ), + x = hints.x, + y = hints.y, + width = hints.width, + height = hints.height, } elseif lay.resize_handler then lay.resize_handler(c, context, hints) diff --git a/lib/awful/placement.lua b/lib/awful/placement.lua index 8ea8fba1c..f79fca4c8 100644 --- a/lib/awful/placement.lua +++ b/lib/awful/placement.lua @@ -144,15 +144,16 @@ local function compose(...) -- Only apply the geometry once, not once per chain node, to do this, -- Force the "pretend" argument and restore the original value for -- the last node. - local pretend_real = args.pretend - local attach_real = args.attach - - args.pretend = true - args.attach = false + local attach_real = args.attach + args.pretend = true + args.attach = false + args.offset = {} for k, f in ipairs(queue) do if k == #queue then - args.pretend = pretend_real or false + -- Let them fallback to the parent table + args.pretend = nil + args.offset = nil end local r = {f(d, args, ...)} @@ -802,6 +803,8 @@ function placement.under_mouse(d, args) ngeo.width = ngeo.width - 2*bw ngeo.height = ngeo.height - 2*bw + geometry_common(d, args, ngeo) + return fix_new_geometry(ngeo, args, true) end