use X11 API to draw window content