简体   繁体   中英

Xlib, how to make an application draw directly on the root window?

How do I make an application draw directly on the root window? For example I want to print some line on the root window, like conky does. How do I do this using Xlib in C/C++?

Try getting the root window handle by calling XRootWindow function. Probably, you are already doing this before creating your other windows. Then use the XCreateGC to create graphics context. After that, render to the root window as you would usually do using XLib.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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