XtQueryGeometry(3)

✨ NAME ✨

XtQueryGeometry β€” bestie, this is the one that asks a child widget what geometry it actually wants πŸ’…


πŸŽ€ SYNTAX πŸŽ€

#include <X11/Intrinsic.h>

XtGeometryResult XtQueryGeometry(Widget w, XtWidgetGeometry *intended,
       XtWidgetGeometry *preferred_return);

🌸 ARGUMENTS 🌸

  • intended β€” whatever changes the parent is planning to make to the child's geometry, or NULL if it's not planning anything. No cap, just vibes and intentions.
  • preferred_return β€” this is where the child's preferred geometry gets handed back to you. It's giving "return to sender but make it geometry" 🫢
  • w β€” the widget in question. The main character, if you will πŸ‘‘

πŸ’– DESCRIPTION πŸ’–

Okay so picture this: a parent widget wants to know what geometry its child would prefer. So the parent takes all the changes it's thinking about making to the child's geometry, drops them into the matching fields of the intended structure, sets the matching bits in intended.request_mode, and then calls XtQueryGeometry. That's the whole ritual, bestie. ✨

Here's the tea on what XtQueryGeometry actually does:

  1. It clears all the bits in preferred_return->request_mode. Every single one. Gone. Cleared. Slay.
  2. Then it peeks at the query_geometry field of the specified widget's class record. πŸ‘€
  3. If query_geometry is not NULL, it calls that query_geometry procedure and passes it the specified widget, plus the intended and preferred_return structures as arguments. The widget gets to speak its truth.
  4. And if intended happens to be NULL? No worries, it doesn't just pass the NULL along β€” XtQueryGeometry swaps it out for a pointer to an XtWidgetGeometry structure with request_mode=0 before it calls query_geometry. Very considerate. Very demure. πŸ’…
Lowkey important: that request_mode=0 swap only happens before the query_geometry call, so the procedure always gets a real struct to work with instead of a NULL situation. 🌈

πŸ¦‹ SEE ALSO πŸ¦‹


And that's the whole page, bestie β€” this was X Version 11, rocking libXt 1.3.1, and it's XtQueryGeometry(3) forever and ever, periodt. πŸ’–βœ¨πŸŽ€

πŸ“¦ where this page comes from