从 shell 启动程序时是否可以分配窗口 ID?
如果您执行xwininfo
,它将为您提供窗口 ID,但是,这需要在目标窗口上单击鼠标。有没有办法强制窗口管理器,或者至少建议窗口管理器使用特定的ID。类似于
gedit windowid=0x12345678
我已将一些文件上传到 GitHub(请参阅此处 或此处)演示我如何设法工作围绕这个。如果你看看它们,你就会更好地理解我正在尝试做的事情。
If you do xwininfo
it will give you the window id, however, this requires clicking the mouse over a target window. Is there any way to force the window manager, or at least suggest to the window manager, to use a specific id. Something like
gedit windowid=0x12345678
I have uploaded some files to GitHub (see here or here) demonstrating how I managed to work around this. If you look at them you'll get a better feel for what it is I am attempting to do.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
不,这是不可能的。窗口 ID 由 X 服务器在调用 XCreateWindow/XCreateSimpleWindow 时给出,并且无法更改它们,让用户选择它们将是非常危险和错误的。如果您打算查找窗口,可以尝试使用 XQueryTree 函数以及 XGetWindowProperty 和 WM_CLASS 属性。
No, it is not possible. The Window IDs are given by the X server as XCreateWindow/XCreateSimpleWindow are called, and there is no way to change them, it would be terribly dangerous and wrong to let user choose them. If you are planning to find a window, you can try using the XQueryTree function along with XGetWindowProperty and the WM_CLASS property.