From 21c9766aa605c79c5a4c1cd8e188e2f05e989724 Mon Sep 17 00:00:00 2001 From: Emmanuel Lepage Vallee Date: Sun, 15 May 2016 03:26:58 -0400 Subject: [PATCH] placement: Fix under_mouse The function stopped actually setting the geometry... This was missed by tests because of an oversaw elsewhere. --- lib/awful/mouse/init.lua | 19 ++++--------------- lib/awful/placement.lua | 15 +++++++++------ 2 files changed, 13 insertions(+), 21 deletions(-) diff --git a/lib/awful/mouse/init.lua b/lib/awful/mouse/init.lua index 23d11d4b..9e094fb6 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 8ea8fba1..f79fca4c 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