How to get the list of open windows from xserver

2019-01-13 10:20发布

Anyone got an idea how to get from an Xserver the list of all open windows?

标签: x11 xserver
2条回答
Melony?
2楼-- · 2019-01-13 10:55

From the CLI you can use

xwininfo -tree -root

If you need to do this within your own code then you need to use the XQueryTree function from the Xlib library.

查看更多
我只想做你的唯一
3楼-- · 2019-01-13 10:56

You can also take a look at the _NET_CLIENT_LIST value of the root window. This is set by most modern window managers:

xprop -root|grep ^_NET_CLIENT_LIST

That value can easily be obtained programmatically, see your Xlib documentation!

查看更多
登录 后发表回答