Backport patch for bug 1338614

Background resizing was happening in the foreground
Merge pull request #1 from jayofdoom/jay/FixBug1338614

Backport patch for bug 1338614