<html><body><div style="color:#000; background-color:#fff; font-family:times new roman, new york, times, serif;font-size:12pt"><span style="font-weight:bold;">I still don't know why the "hello world" code does not working as I expect. But I write a piece of code who works as expected. I'm not sure that's well written, (if someone want to take a look). Mouse pointer is rendered, when a button is pressed or when a key is release the </span><span>while</span> <span style="font-weight: bold;">loop is stoped</span>.<br><div style="font-family: times new roman, new york, times, serif; font-size: 12pt;"><div style="font-family: times new roman, new york, times, serif; font-size: 12pt;"><div class="y_msg_container"><div id="yiv3027487615"><div><div style="color:#000;background-color:#fff;font-family:times new roman, new york, times, serif;font-size:12pt;"><span
 style="font-weight:bold;"></span><br>#include<X11/Xlib.h><br>#include<X11/cursorfont.h><br>#include<stdio.h><br>#include<stdlib.h><br>#include<string.h><br><br>#define DPYW DisplayWidth(dpy,scr)<br>#define DPYH DisplayHeight(dpy,scr)<br><br><br>int main(int argc, char *argv[]){<br>        Display *dpy;<br>        int scr, stop=0;<br>       
 Window rootwin;<br>        Window wbg;<br>        XEvent e;<br>    Cursor theCursor;<br><br>    dpy = XOpenDisplay(NULL);<br><br>        scr=DefaultScreen(dpy);<br>        rootwin=RootWindow(dpy, scr);<br>        wbg=XCreateSimpleWindow(dpy,rootwin,0,0,<br>                                DPYW,DPYH,0,<br>                                BlackPixel(dpy,
 scr),<br>                                BlackPixel(dpy, scr) );<br><br><br>        XStoreName(dpy, wbg, "background");<br>        XSelectInput(dpy, wbg, ExposureMask|KeyPressMask|KeyReleaseMask|ButtonPressMask|ButtonReleaseMask);<br>        XMapWindow(dpy, wbg);<br><br><br>    theCursor = XCreateFontCursor(dpy, XC_left_ptr);<br><br>    XDefineCursor(dpy,wbg,theCursor);<br><br>        while(stop==0) {<br>                XNextEvent(dpy, &e);<br>                if(e.type==Expose
 && e.xexpose.count<1) {<br>        XFlush(dpy);<br>                }<br><br>        switch(e.type){<br>            case KeyRelease     : stop=1;break;<br>            case ButtonPress     : stop=1;break;<br>        }        <br><br>        }<br><br>    XFreeCursor(dpy,theCursor);<br>        XCloseDisplay(dpy);<br><br>        return 0;<br>}<div style="font-family:times new roman, new york, times, serif;font-size:12pt;"><div style="font-family:times new roman, new york, times, serif;font-size:12pt;"><div
 class="yiv3027487615y_msg_container"><div id="yiv3027487615"><div><div style="color:#000;background-color:#fff;font-family:times new roman, new york, times, serif;font-size:12pt;"><div style="font-family:times new roman, new york, times, serif;font-size:12pt;"><div style="font-family:times new roman, new york, times, serif;font-size:12pt;"><div class="yiv3027487615y_msg_container"><br><br></div> </div> </div>  </div></div></div><br><br></div> </div> </div>  </div></div></div><br><br></div> </div> </div>  </div></body></html>