简体   繁体   English

如何使用xlib获取现有窗口的显示结构

[英]how to get Display structure of an existing window using xlib

I know that XOpenDisplay(), crates a connection to the xserver and returns Display structure, but is there any way to get the reference to the Display structure of the existing windows, So that I can get the window properties of all windows that are opened currently ? 我知道XOpenDisplay()会建立到xserver的连接并返回Display结构,但是有什么方法可以获取对现有窗口的Display结构的引用,以便可以获取所有打开的窗口的窗口属性。目前 ? I want to know the current focused window, but XGetInputFocus() is asking for Display ref. 我想知道当前的焦点窗口,但是XGetInputFocus()要求Display ref。 as an argument. 作为争论。 How do i get this Dsiplay ref. 我如何获得此Dsiplay参考。 ? Kindly help me as i'm a fresher to X11? 请问我是X11的新手,请帮我?

Correct me if i'm wrong any where.. 如果我在任何地方错了,请纠正我。

Thank you! 谢谢!

Just connect with XOpenDisplay() . 只需与XOpenDisplay()连接XOpenDisplay() The Display structure is just the information for your connection to the X server. Display结构只是您与X服务器连接的信息。

XGetInputFocus() will give you the client window with focus on the X server to which you are connected. XGetInputFocus()将为您提供客户端窗口,重点放在您连接到的X服务器上。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM