fix portability bug for non-X11R6 systems