From b71d522f8c1a280d6e13192bafef1c245d7f8a1a Mon Sep 17 00:00:00 2001 From: actionless Date: Thu, 23 Apr 2020 06:23:49 +0200 Subject: [PATCH] feat(awful: placement): add "skip_fullscreen" --- lib/awful/placement.lua | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/lib/awful/placement.lua b/lib/awful/placement.lua index c67de4e95..fafeb0ad9 100644 --- a/lib/awful/placement.lua +++ b/lib/awful/placement.lua @@ -1624,6 +1624,26 @@ function placement.restore(d, args) return true end +--- Skip all preceeding results of placement pipeline for fullscreen clients. +--@DOC_awful_placement_skip_fullscreen_EXAMPLE@ +-- @tparam drawable d A drawable (like `client`, `mouse` or `wibox`) +-- @tparam[opt={}] table args Other arguments +-- @treturn table The new geometry +-- @staticfct awful.placement.skip_fullscreen +function placement.skip_fullscreen(d, args) + args = add_context(args, "skip_fullscreen") + d = d or capi.client.focus + + if d.fullscreen then + return {d:geometry(), {}, true} + else + local ngeo = geometry_common(d, args) + remove_border(d, args, ngeo) + geometry_common(d, args, ngeo) + return fix_new_geometry(ngeo, args, true) + end +end + return placement -- vim: filetype=lua:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:textwidth=80