XQueryTree(3)

πŸ’– NAME πŸ’–

XQueryTree β€” query window tree information. She's the main character of XQueryTree(3), and she lives under the XLIB FUNCTIONS umbrella, iykyk 🫢✨

πŸŽ€ SYNTAX πŸŽ€

Status XQueryTree(Display *display, Window w, Window *root_return,
       Window *parent_return, Window **children_return, unsigned int
       *nchildren_return);

πŸ¦‹ ARGUMENTS πŸ¦‹

  • children_return β€” this is where the list of children comes back to you, bestie. Literally the child list output. πŸ’–
  • display β€” specifies the connection to the X server. Your link to the X server, periodt.
  • nchildren_return β€” returns the number of children. The count, the total, the β€œhow many are we talking” value.
  • parent_return β€” returns the parent window. Your window's parent, delivered right here. πŸ‘‘
  • root_return β€” returns the root window. The root window ID, slaying in its output slot.
  • w β€” specifies the window whose list of children, root, parent, and number of children you want to obtain. So yes, this is the window you're doing the whole tree-info vibe check on. 🌸

🌈 DESCRIPTION 🌈

Okay so the XQueryTree function returns the root ID, the parent window ID, a pointer to the list of children windows (NULL when there are no children), and the number of children in the list for the specified window. No cap, all of that comes back together. ✨

The children are listed in current stacking order, from bottom-most (first) to top-most (last). So first = bottom of the stack, last = top of the stack. That's the order, bestie, don't rearrange it. πŸ¦‹

XQueryTree returns zero if it fails and nonzero if it succeeds. Simple vibe check: zero = nope, nonzero = yep. πŸ’…

To free a non-NULL children list when it is no longer needed, use XFree. Clean up after yourself, iconic behavior only. πŸŽ€

XQueryTree can generate a BadWindow error.

πŸ’€ BUGS πŸ’€

The bug note is literally: This really should return a screen *, not a root window ID. And honestly? Valid. 😭

πŸ’… DIAGNOSTICS πŸ’…

  • BadWindow β€” A value for a Window argument does not name a defined Window.

⭐ SEE ALSO ⭐


mwah πŸ’œ sign-off time: this page is source X Version 11, version libX11 1.8.14, and the date? Not listed on this footer, bestie β€” no invented numbers, no fake date, just the facts with a bow on top πŸŽ€βœ¨

πŸ“¦ where this page comes from