title: XFetchName always returns 0
body: <p>im trying to write a C code to get the title of the Active Window in my Linux System, but the Function XFetchName always returnes zero, i also tried XGetWMName, same result...
  but using xprop, i can see that there is a string in the "WM_NAME" property</p>
  
  <p>can anyone tell me whats wrong with my code?</p>
  
  <pre><code>#include &lt;X11/Xlib.h&gt;
  #include &lt;stdio.h&gt;
  #include &lt;stdarg.h&gt;
  
  
  int main( int argc, char* argv[] )
  {
        Display *display;
        Window focus;
        char *window_name;
        int revert;
  
        display = XOpenDisplay(NULL);
        XGetInputFocus(display, &amp;focus, &amp;revert);
        int ret = XFetchName(display, focus, &amp;window_name);
        printf("ret = %d\n", ret);
        if (window_name) printf("Title = %s\n", window_name);
        return 0;
  }
  </code></pre>
  
  <p>thanks.</p>