Basic display detection code.