diff --git a/tests/examples/awful/placement/skip_fullscreen.lua b/tests/examples/awful/placement/skip_fullscreen.lua new file mode 100644 index 00000000..bf020e2d --- /dev/null +++ b/tests/examples/awful/placement/skip_fullscreen.lua @@ -0,0 +1,21 @@ +--DOC_GEN_OUTPUT --DOC_GEN_IMAGE --DOC_HIDE +local awful = {placement = require("awful.placement")} --DOC_HIDE + +--DOC_HIDE no_offscreen is auto-called when startup is true, avoid this. +awesome.startup = false -- luacheck: globals awesome.startup --DOC_HIDE + +local c = client.gen_fake {x = 0, y = 0, width= screen[1].geometry.width, height=screen[1].geometry.height} --DOC_HIDE +c.fullscreen = true --DOC_HIDE +print("Before:", "x="..c.x..", y="..c.y..", width="..c.width..", height="..c.height) --DOC_HIDE +awful.placement.no_offscreen(c, {honor_workarea=true, }) +print("After:", "x="..c.x..", y="..c.y..", width="..c.width..", height="..c.height) --DOC_HIDE +c:kill() --DOC_HIDE + +c = client.gen_fake {x = 0, y = 0, width= screen[1].geometry.width, height=screen[1].geometry.height} --DOC_HIDE +c.fullscreen = true --DOC_HIDE +print("Before:", "x="..c.x..", y="..c.y..", width="..c.width..", height="..c.height) --DOC_HIDE +local f = (awful.placement.no_offscreen + awful.placement.skip_fullscreen) +f(c, {honor_workarea=true, }) +print("After:", "x="..c.x..", y="..c.y..", width="..c.width..", height="..c.height) --DOC_HIDE + +--DOC_HIDE vim: filetype=lua:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:textwidth=80 diff --git a/tests/examples/awful/placement/skip_fullscreen.output.txt b/tests/examples/awful/placement/skip_fullscreen.output.txt new file mode 100644 index 00000000..fe735dd9 --- /dev/null +++ b/tests/examples/awful/placement/skip_fullscreen.output.txt @@ -0,0 +1,4 @@ +Before: x=0, y=0, width=320, height=240 +After: x=10, y=10, width=320, height=240 +Before: x=0, y=0, width=320, height=240 +After: x=0, y=0, width=320, height=240