Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如果您这样做xwininfo,它将为您提供窗口 ID,但是,这需要在目标窗口上单击鼠标。有没有办法强制窗口管理器,或者至少建议窗口管理器使用特定的 id。就像是
xwininfo
gedit windowid=0x12345678
我已经将一些文件上传到 GitHub(参见此处或此处),展示了我是如何解决这个问题的。如果您查看它们,您会更好地了解我正在尝试做的事情。
不,这是不可能的。Window ID 由 X 服务器在调用 XCreateWindow/XCreateSimpleWindow 时给出,无法更改它们,让用户选择它们将是非常危险和错误的。如果您打算找到一个窗口,您可以尝试使用 XQueryTree 函数以及 XGetWindowProperty 和 WM_CLASS 属性。