Replaced X11 dependant funtion.