placement: Stop detecting screen objects using `type(o.geometry)`.
All object type will now use tables instead of function, so this check will break.
This commit is contained in:
parent
d2b7d292b0
commit
36999de123
|
@ -392,10 +392,12 @@ local function geometry_common(obj, args, new_geo, ignore_border_width)
|
||||||
and obj.coords(new_geo) or obj.coords()
|
and obj.coords(new_geo) or obj.coords()
|
||||||
return {x=coords.x, y=coords.y, width=0, height=0}
|
return {x=coords.x, y=coords.y, width=0, height=0}
|
||||||
elseif obj.geometry then
|
elseif obj.geometry then
|
||||||
local geo = obj.geometry
|
if obj.get_bounding_geometry then
|
||||||
|
-- It is a screen, it doesn't support setting new sizes.
|
||||||
|
return obj:get_bounding_geometry(args)
|
||||||
|
end
|
||||||
|
|
||||||
-- It is either a drawable or something that implement its API
|
-- It is either a drawable or something that implement its API
|
||||||
if type(geo) == "function" then
|
|
||||||
local dgeo = area_common(
|
local dgeo = area_common(
|
||||||
obj, fix_new_geometry(new_geo, args), ignore_border_width, args
|
obj, fix_new_geometry(new_geo, args), ignore_border_width, args
|
||||||
)
|
)
|
||||||
|
@ -413,10 +415,6 @@ local function geometry_common(obj, args, new_geo, ignore_border_width)
|
||||||
end
|
end
|
||||||
|
|
||||||
return dgeo
|
return dgeo
|
||||||
end
|
|
||||||
|
|
||||||
-- It is a screen, it doesn't support setting new sizes.
|
|
||||||
return obj:get_bounding_geometry(args)
|
|
||||||
else
|
else
|
||||||
assert(false, "Invalid object")
|
assert(false, "Invalid object")
|
||||||
end
|
end
|
||||||
|
@ -1462,7 +1460,7 @@ function placement.next_to(d, args)
|
||||||
args = add_context(args, "next_to")
|
args = add_context(args, "next_to")
|
||||||
d = d or capi.client.focus
|
d = d or capi.client.focus
|
||||||
|
|
||||||
local osize = type(d.geometry) == "function" and d:geometry() or nil
|
local osize = type(d.geometry) == "function" and d:geometry() or d.geometry
|
||||||
local original_pos, original_anchors = args.preferred_positions, args.preferred_anchors
|
local original_pos, original_anchors = args.preferred_positions, args.preferred_anchors
|
||||||
|
|
||||||
if type(original_pos) == "string" then
|
if type(original_pos) == "string" then
|
||||||
|
|
Loading…
Reference in New Issue