Fix GLES on X11

The patch is from http://forum.odroid.com/viewtopic.php?f=54&t=1244&p=7887#p7875 .
Tested by Олег Капустин <olegvedi@gmail.com>.