fixed minimize crash

fixed where game tried to make application surface 0 size when
minimizing.