backgroundpixelxlibpixmapcreatewindow

For xlib, how to create a child window with the background pixel or pixmap of its parent window?


I want to create a child window with the background pixel or pixmap of its parent window. But i can not find refer Xlib API. The workaround I can think of is this: create a child window first, and then use XCopyArea to copy part of parent window. Is there a more direct method?

I searched this question on search engines such as Bing, but couldn't find an answer. Asked this question on chatgpt, and the answer was to use the background_pixel member of XWindowAttributes, or use XQueryColor. This is obviously nonsense.


Solution

  • According to Xlib - C Language X Interface: Background Attribute

    Edit:

    According to Window Attributes, the default value for background-pixmap is None and for background-pixel the value is undefined.