This fix keeps the dim surface below the highest shown layer. If two shown layers were both dim it was ambiguous where the dim surface would appear causing dialogs to first be dimmed and then flash when the dim was put behind them. Fixes bug 6497476. Change-Id: I360cf2d23d58fc4c03edbbed16d79c08c29e48b9