Fix for X11 due to API changes