title: XCB EWMH getting client list returns only Google Chrome windows
body: <p>I am using XCB to write my own window manager. To create a taskbar I need to get list of all the windows. I could track them and keep it somewhere, but I can see on the github that many other solutions are using EWMH to do this.</p>
  <p>However, no matter what are the circumstances, my code has only the Google Chrome windows. I am using Arch linus with Gnome 41. When using Xephyr, no windows are returned at all.</p>
  <pre><code>#include &quot;tasks.h&quot;
  #include &quot;log.h&quot;
  
  #include &lt;stdio.h&gt;
  #include &lt;stdlib.h&gt;
  #include &lt;xcb/xcb.h&gt;
  #include &lt;xcb/xcb_ewmh.h&gt;
  #include &lt;xcb/xcb_icccm.h&gt;
  #include &lt;xcb/xproto.h&gt;
  
  Task *tasks_get_all(xcb_connection_t *conn, xcb_ewmh_connection_t *ewmh,
                      int screen_number) {
    xcb_get_property_reply_t *reply;
    xcb_get_property_cookie_t cookie;
    xcb_window_t *windows;
    cookie = xcb_ewmh_get_client_list(ewmh, screen_number);
    xcb_ewmh_get_windows_reply_t winlist;
  
    if (!xcb_ewmh_get_client_list_reply(ewmh, cookie, &amp;winlist, NULL)) {
      log_error(&quot;Cannot get windows list&quot;);
  
      return NULL;
    }
  
    Task *prev_task = NULL;
  
    Task *tasks = NULL;
    xcb_ewmh_get_utf8_strings_reply_t ewmh_txt_prop;
  
    for (int i = 0; i &lt; winlist.windows_len; i++) {
      Task *task = malloc(sizeof(Task));
      task-&gt;next = NULL;
      task-&gt;name = &quot;&quot;;
      cookie = xcb_ewmh_get_wm_visible_name_unchecked(ewmh, winlist.windows[i]);
  
      xcb_ewmh_get_wm_name_reply(ewmh,
                                 xcb_ewmh_get_wm_name(ewmh, winlist.windows[i]),
                                 &amp;ewmh_txt_prop, NULL);
  
      task-&gt;name = ewmh_txt_prop.strings;
  
      ewmh_txt_prop.strings = NULL;
  
      if (tasks == NULL) {
        tasks = task;
      }
  
      if (prev_task != NULL) {
        prev_task-&gt;next = task;
      }
  
      prev_task = task;
    }
  
    xcb_ewmh_get_windows_reply_wipe(&amp;winlist);
  
    return tasks;
  }
  </code></pre>