How do I obtain, and synchronize, a complete list of all X11 windows?

后端 未结 3 1701
无人及你
无人及你 2020-12-13 01:03

I want to monitor all the open windows under X11. Currently, I\'m doing this as follows:

  1. Initially walking the whole tree by recursively calling XQueryTree fro
3条回答
  •  清歌不尽
    2020-12-13 01:39

    I believe that grabbing the X server (XGrabServer(3)) will prevent changes to the window hierarchy. It is a bit heavy handed though, so you should probably only do it if you really need it.

    For an example of code that walks the window hierarchy, builds up a tree, uses window events to keep it up to date, and ignores X protocol errors which are unavoidable due to races, see the file src/VBox/Additions/x11/VBoxClient/seamless-x11.cpp in the source code for VirtualBox.

提交回复
热议问题