My old 23" cinema display died, and I have a new 24" DGM 1920 x 1200 display with DVI input.
I have a Thunderbolt to DVI male cable which connects from the iMac to the DGM display. It was working fine earlier, but when I woke up from sleep, the login screen flashed blue then login then blue, over and over about once every 3 seconds.
Now if the second monitor is plugged in the main iMac screen flashes blue every 3-4 seconds, over and over.
It seems that Apple change the mini-Display parameters, perhaps to kill off 3rd party connectors, not sure.
I tried 4 different mini-Display to DVI adaptors. All of them used to work fine, but only one works now.
Same thing happened with previous monitor; the md-to-DVI worked fine for a while, then on a system update it stopped working.
I think if you have random blue screen on your main system, it might be a loose cable, so OSX detects a loss of monitor and resizes desktop, then the connection gets solid again and again Blue to resize etc