yet another attempt to fix restore maximized window. This is tricky because it
can break restore minimized (hides_on_minimize off)