Fix modal popup position when unmaximizing

At least on Firefox 25, when I maximize and unmaximize a modal popup, its position is badly restored.

Tested on Firefox 25 and WebKit 2.0.4.