XtMakeGeometryRequest(3)
π XtMakeGeometryRequest β the glow-up your widget's geometry has been waiting for π
okay bestie, sit down, hydrate, because we're talking XT FUNCTIONS and specifically the two lil functions that let a widget politely ask its parent "heyβ¦ can i be bigger? can i move? pls?" β that's XtMakeGeometryRequest and XtMakeResizeRequest, and yes they are a matched set, they're giving duo energy, they're iconic.
β¨ NAME β¨
XtMakeGeometryRequest, XtMakeResizeRequest β make geometry manager request π
like. that's the whole vibe. you're making a request. to the geometry manager. respect the hierarchy bestie.
πΈ SYNTAX πΈ
first things first, you gotta pull in the header, no cap:
#include <X11/Intrinsic.h>
then the two stars of the show:
XtGeometryResult XtMakeGeometryRequest(Widget w, XtWidgetGeometry
*request, XtWidgetGeometry *reply_return);
XtGeometryResult XtMakeResizeRequest(Widget w, Dimension width,
Dimension height, Dimension *width_return, Dimension
*height_return);
π¦ ARGUMENTS π¦
reply_returnβ this one hands you back the widget size you're actually allowed to have, okay? and plot twist: it can beNULLif the widget asking is justβ¦ not interested in dealing withXtGeometryAlmost. like, "don't tell me the compromise, i don't wanna hear it." valid honestly.requestβ specifies the desired widget geometry. and when we say geometry we mean the whole package: size, position, border width, and stacking order. the full fit check. πwβ specifies the widget that is making the request. the one with main character energy. the asker. β¨width_returnheight_returnβ these two return the allowed widget width and height. the compromise numbers. the "we can meet in the middle" numbers.
π DESCRIPTION π
okay so XtMakeGeometryRequest is out here doing different things depending on the condition, and we are going to go through every single one because we don't skip steps in this house:
- If the widget is unmanaged, or the widget's parent is not realized, it just makes the changes and returns
XtGeometryYes. no drama, no negotiation, slay. π«Ά - If the parent is not a subclass of
compositeWidgetClass, or the parent'sgeometry_managerisNULL, it issues an error. yeah. that's the bad timeline. not a vibe check you want to fail. π - If the widget's
being_destroyedfield isTrue, it returnsXtGeometryNo. it's over, it's done, don't ask for a resize on your way out the door. π - If the widget's
x,y,width,heightandborder_widthfields are all equal to the requested values, it returnsXtGeometryYesβ otherwise, it calls the parent'sgeometry_managerprocedure with the given parameters. basically: if nothing would change, why bother the parent? icon behavior. - If the parent's geometry manager returns
XtGeometryYes, andXtCWQueryOnlyis not set in therequest_mode, and the widget is realized, thenXtMakeGeometryRequestcalls theXConfigureWindowXlib function to reconfigure the widget's window β setting its size, location, and stacking order as appropriate. three conditions bestie. all three. no shortcuts. β - If the geometry manager returns
XtGeometryDone, the change has been approved and actually has been done. in this case,XtMakeGeometryRequestdoes no configuring and returnsXtGeometryYes. and heads up:XtMakeGeometryRequestnever returnsXtGeometryDone. never ever. it just doesn't. that's not its thing. π«
Otherwise, XtMakeGeometryRequest returns the resulting value from the parent's geometry manager. simple as that.
real talk though: children of primitive widgets are always unmanaged. soXtMakeGeometryRequestalways returnsXtGeometryYeswhen called by a child of a primitive widget. always. free yes. no negotiation arc. π
π the XtMakeResizeRequest part (the easy mode) π
XtMakeResizeRequest is a simple interface to XtMakeGeometryRequest β it's the low-effort, high-reward version. what it does:
- creates an
XtWidgetGeometrystructure - specifies that
widthandheightshould change
and listen β the geometry manager is free to modify any of the other window attributes (position or stacking order) to satisfy the resize request. it's got creative liberty. it's got range. π
so if the return value is XtGeometryAlmost, then width_return and height_return contain a compromise width and height. and if those are acceptable, the widget should immediately make an XtMakeResizeRequest and request that the compromise width and height be applied. immediately. don't be shy, don't wait around, go get your compromise. π₯
and if the widget is just not interested in XtGeometryAlmost replies? it can pass NULL for width_return and height_return. no thoughts, no return values, head empty. π
π SEE ALSO π
go read these too bestie, they're in the group chat:
XtConfigureWidget(3)XtQueryGeometery(3)- X Toolkit Intrinsics - C Language Interface
- Xlib - C Language X Interface
that's the whole page!! and before you go β this was served up fresh from X Version 11, libXt 1.3.1, dated XtMakeGeometryRequest(3). πβ¨π take care of your geometry, and remember: ask nicely, check your request_mode, and never expect XtGeometryDone back. mwah π«ΆπΈπ§π
π¦ where this page comes from
- alpine 3.22: libxt-doc 1.3.1-r0 Β· MIT
- alpine 3.23: libxt-doc 1.3.1-r0 Β· MIT
- alpine 3.24: libxt-doc 1.3.1-r0 Β· MIT
- arch rolling: libxt 1.3.1-1 Β· MIT AND HPND-sell-variant AND SMLNJ AND MIT-open-group AND X11
- fedora 43: libXt-devel 1.3.1-3.fc43 Β· MIT AND HPND-sell-variant AND SMLNJ AND MIT-open-group AND X11
- fedora 43: libXt-devel 1.3.1-3.fc43 Β· MIT AND HPND-sell-variant AND SMLNJ AND MIT-open-group AND X11
- fedora 44: libXt-devel 1.3.1-4.fc44 Β· MIT AND HPND-sell-variant AND SMLNJ AND MIT-open-group AND X11
- fedora 44: libXt-devel 1.3.1-4.fc44 Β· MIT AND HPND-sell-variant AND SMLNJ AND MIT-open-group AND X11
- opensuse-leap 16.0: libXt-devel 1.3.1-160000.3.2 Β· MIT
- opensuse-leap 16.0: libXt-devel 1.3.1-160000.3.2 Β· MIT
- opensuse-leap 16.0: libXt-devel 1.3.1-160000.3.2 Β· MIT
- opensuse-leap 16.0: libXt-devel 1.3.1-160000.3.2 Β· MIT
- Copyright 1993 X Consortium
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms