placement: Check if the stored screen is valid (#2246)

Fixes #2088
This commit is contained in:
Emmanuel Lepage Vallée 2018-04-26 20:47:33 -04:00 committed by GitHub
parent 5b9180fc1b
commit b2f8c8df89
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 2 deletions

View File

@ -1434,8 +1434,9 @@ function placement.restore(d, args)
-- Some people consider that once moved to another screen, then
-- the memento needs to be upgraded. For now this is only true for
-- maximization until someone complains.
if memento.sgeo and memento.screen and args.context == "maximize"
and d.screen and get_screen(memento.screen) ~= get_screen(d.screen) then
if memento.sgeo and memento.screen and memento.screen.valid
and args.context == "maximize" and d.screen
and get_screen(memento.screen) ~= get_screen(d.screen) then
-- Use the absolute geometry as the memento also does
local sgeo = get_screen(d.screen).geometry