test-maximize.lua: Test all gravities
Signed-off-by: Uli Schlachter <psychon@znc.in>
This commit is contained in:
parent
3e0eefe3bc
commit
e90f3ef253
|
@ -4,6 +4,7 @@ local runner = require("_runner")
|
||||||
local awful = require("awful")
|
local awful = require("awful")
|
||||||
local test_client = require("_client")
|
local test_client = require("_client")
|
||||||
local lgi = require("lgi")
|
local lgi = require("lgi")
|
||||||
|
local gears = require("gears")
|
||||||
|
|
||||||
local function geo_to_str(g)
|
local function geo_to_str(g)
|
||||||
return "pos=" .. g.x .. "," .. g.y ..
|
return "pos=" .. g.x .. "," .. g.y ..
|
||||||
|
@ -12,21 +13,15 @@ end
|
||||||
|
|
||||||
local original_geo = nil
|
local original_geo = nil
|
||||||
|
|
||||||
local counter = 0
|
local steps = {}
|
||||||
|
|
||||||
local function geometry_handler(c, context, hints)
|
for _, gravity in ipairs { "NORTH_WEST", "NORTH", "NORTH_EAST", "WEST",
|
||||||
hints = hints or {}
|
"CENTER", "EAST", "SOUTH_WEST", "SOUTH", "SOUTH_EAST", "STATIC" } do
|
||||||
assert(type(c) == "client")
|
gears.table.merge(steps, {
|
||||||
assert(type(context) == "string")
|
|
||||||
assert(type(hints.toggle) == "boolean")
|
|
||||||
assert(type(hints.status) == "boolean")
|
|
||||||
counter = counter + 1
|
|
||||||
end
|
|
||||||
|
|
||||||
local steps = {
|
|
||||||
function(count)
|
function(count)
|
||||||
if count == 1 then
|
if count == 1 then
|
||||||
test_client(nil,nil,nil,nil,nil,{gravity=lgi.Gdk.Gravity.STATIC})
|
print("testing gravity " .. gravity)
|
||||||
|
test_client(nil,nil,nil,nil,nil,{gravity=lgi.Gdk.Gravity[gravity]})
|
||||||
else
|
else
|
||||||
local c = client.get()[1]
|
local c = client.get()[1]
|
||||||
if c then
|
if c then
|
||||||
|
@ -164,7 +159,22 @@ local steps = {
|
||||||
c:kill()
|
c:kill()
|
||||||
|
|
||||||
return true
|
return true
|
||||||
end,
|
end
|
||||||
|
})
|
||||||
|
end
|
||||||
|
|
||||||
|
local counter = 0
|
||||||
|
|
||||||
|
local function geometry_handler(c, context, hints)
|
||||||
|
hints = hints or {}
|
||||||
|
assert(type(c) == "client")
|
||||||
|
assert(type(context) == "string")
|
||||||
|
assert(type(hints.toggle) == "boolean")
|
||||||
|
assert(type(hints.status) == "boolean")
|
||||||
|
counter = counter + 1
|
||||||
|
end
|
||||||
|
|
||||||
|
gears.table.merge(steps, {
|
||||||
-- Now, start some clients maximized
|
-- Now, start some clients maximized
|
||||||
function()
|
function()
|
||||||
if #client.get() > 0 then return end
|
if #client.get() > 0 then return end
|
||||||
|
@ -249,7 +259,7 @@ local steps = {
|
||||||
|
|
||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
}
|
})
|
||||||
|
|
||||||
runner.run_steps(steps)
|
runner.run_steps(steps)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue