Added a test to check if window state is restored after a client unmaximizing itself.

This commit is contained in:
Xinhao Yuan 2019-10-15 19:14:31 -04:00
parent 8beb0286ea
commit 33570e45d7
2 changed files with 29 additions and 0 deletions

View File

@ -40,6 +40,8 @@ local function open_window(class, title, options)
window:show_all() window:show_all()
if options.maximize_after then if options.maximize_after then
window:maximize() window:maximize()
elseif options.unmaximize_after then
window:unmaximize()
end end
if options.resize_after_width and options.resize_after_height then if options.resize_after_width and options.resize_after_height then
window:resize( window:resize(
@ -142,6 +144,9 @@ return function(class, title, sn_rules, callback, resize_increment, args)
if args.maximize_after then if args.maximize_after then
options = options .. "maximize_after," options = options .. "maximize_after,"
end end
if args.unmaximize_after then
options = options .. "unmaximize_after,"
end
if args.size then if args.size then
options = table.concat { options = table.concat {
options, options,

View File

@ -232,6 +232,30 @@ gears.table.merge(steps, {
return true return true
end, end,
-- Maximize then unmaximize. The window state should be restored.
function()
if #client.get() > 0 then return end
test_client(nil,nil,nil,nil,nil,{maximize_before=true,unmaximize_after=true})
return true
end,
function()
local c = client.get()[1]
if not c then return end
assert(not c.maximized_horizontal)
assert(not c.maximized_vertical)
-- May need to retry
if c.maximized then return end
assert(not c.immobilized_horizontal)
assert(not c.immobilized_vertical)
c:kill()
return true
end,
function() function()
if #client.get() > 0 then return end if #client.get() > 0 then return end