Added a test to check if window state is restored after a client unmaximizing itself.
This commit is contained in:
parent
8beb0286ea
commit
33570e45d7
|
@ -40,6 +40,8 @@ local function open_window(class, title, options)
|
|||
window:show_all()
|
||||
if options.maximize_after then
|
||||
window:maximize()
|
||||
elseif options.unmaximize_after then
|
||||
window:unmaximize()
|
||||
end
|
||||
if options.resize_after_width and options.resize_after_height then
|
||||
window:resize(
|
||||
|
@ -142,6 +144,9 @@ return function(class, title, sn_rules, callback, resize_increment, args)
|
|||
if args.maximize_after then
|
||||
options = options .. "maximize_after,"
|
||||
end
|
||||
if args.unmaximize_after then
|
||||
options = options .. "unmaximize_after,"
|
||||
end
|
||||
if args.size then
|
||||
options = table.concat {
|
||||
options,
|
||||
|
|
|
@ -232,6 +232,30 @@ gears.table.merge(steps, {
|
|||
|
||||
return true
|
||||
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()
|
||||
if #client.get() > 0 then return end
|
||||
|
||||
|
|
Loading…
Reference in New Issue