Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>I have a solution!</p> <p>Well, sort of.</p> <p>If your window manager uses the extended window manager hints (EWMH), you can query the root window using the "<code>_NET_CLIENT_LIST</code>" atom. This returna list of client windows the window manager is managing. For more information, see <a href="http://standards.freedesktop.org/wm-spec/wm-spec-1.3.html#id2449346" rel="noreferrer">here</a>.</p> <p>However, there are some issues with this. For a start, the window manager in use must support the EWMH. KDE and GNOME do, and I'm sure some others do as well. However, I'm sure there are many that don't. Also, I've noticed a few issues with KDE. Basically, some non-KDE applications don't get included in the list. For example, if you run xcalc under KDE it won't show up in this list.</p> <p>If anyone can provide any improvements on this method, I'd be glad to hear them. For reference, the code I'm using is listed below:</p> <pre><code> Atom a = XInternAtom(m_pDisplay, "_NET_CLIENT_LIST" , true); Atom actualType; int format; unsigned long numItems, bytesAfter; unsigned char *data =0; int status = XGetWindowProperty(m_pDisplay, rootWindow, a, 0L, (~0L), false, AnyPropertyType, &amp;actualType, &amp;format, &amp;numItems, &amp;bytesAfter, &amp;data); if (status &gt;= Success &amp;&amp; numItems) { // success - we have data: Format should always be 32: Q_ASSERT(format == 32); // cast to proper format, and iterate through values: quint32 *array = (quint32*) data; for (quint32 k = 0; k &lt; numItems; k++) { // get window Id: Window w = (Window) array[k]; qDebug() &lt;&lt; "Scanned client window:" &lt;&lt; w; } XFree(data); } </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload