From d686a0e35735f02086674fc68e035ccce2b97c52 Mon Sep 17 00:00:00 2001 From: actionless Date: Thu, 23 Apr 2020 08:29:27 +0200 Subject: [PATCH] test(examples: awful: placement: skip_fullscreen): cover non-fullscreen clients --- .../skip_fullscreen-no_fullscreen.lua | 25 +++++++++++++++++++ .../skip_fullscreen-no_fullscreen.output.txt | 6 +++++ 2 files changed, 31 insertions(+) create mode 100644 tests/examples/awful/placement/skip_fullscreen-no_fullscreen.lua create mode 100644 tests/examples/awful/placement/skip_fullscreen-no_fullscreen.output.txt diff --git a/tests/examples/awful/placement/skip_fullscreen-no_fullscreen.lua b/tests/examples/awful/placement/skip_fullscreen-no_fullscreen.lua new file mode 100644 index 00000000..7207f460 --- /dev/null +++ b/tests/examples/awful/placement/skip_fullscreen-no_fullscreen.lua @@ -0,0 +1,25 @@ +--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 + +-- using just no_offscreen with honor_workarea: +local c = client.gen_fake {x = 0, y = 0, width= screen[1].geometry.width, height=screen[1].geometry.height} --DOC_HIDE +c.fullscreen = false --DOC_HIDE +print("no_offscreen:") --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 + +-- using no_offscreen + skip_fullscreen: +c = client.gen_fake {x = 0, y = 0, width= screen[1].geometry.width, height=screen[1].geometry.height} --DOC_HIDE +c.fullscreen = false --DOC_HIDE +print("no_offscreen + skip_fullscreen:") --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-no_fullscreen.output.txt b/tests/examples/awful/placement/skip_fullscreen-no_fullscreen.output.txt new file mode 100644 index 00000000..432b85aa --- /dev/null +++ b/tests/examples/awful/placement/skip_fullscreen-no_fullscreen.output.txt @@ -0,0 +1,6 @@ +no_offscreen: +Before: x=0, y=0, width=320, height=240 +After: x=10, y=10, width=320, height=240 +no_offscreen + skip_fullscreen: +Before: x=0, y=0, width=320, height=240 +After: x=10, y=10, width=320, height=240