Added some magical code which seems to do the job of getting QMdiArea out of its confused state. re #1958