XResizeRequestEvent(3)

πŸ’… XResizeRequestEvent β€” the ResizeRequest event struct, explained

okay so bestie, this is a page from XLIB FUNCTIONS (the Xlib girlies, you know the ones) and it's all about XResizeRequestEvent β€” literally the ResizeRequest event structure. that's the whole name section, we move 🫢


✨ NAME ✨

XResizeRequestEvent β€” ResizeRequest event structure. that's it, that's the name, iconic behaviour πŸ’…


πŸŽ€ STRUCTURES πŸŽ€

the structure for ResizeRequest events contains this, and yes you're gonna want to copy it exactly:

typedef struct {
        int type;       /* ResizeRequest */
        unsigned long serial;   /* # of last request processed by server */
        Bool send_event;        /* true if this came from a SendEvent request */
        Display *display;       /* Display the event was read from */
        Window window;
        int width, height;
} XResizeRequestEvent;

so when you receive this event (and you will), the structure members are set as follows, no cap:

  • type β€” this one gets set to the event type constant name that uniquely identifies it. fr fr. example time: when the X server reports a GraphicsExpose event to a client application, it sends an XGraphicsExposeEvent structure with the type member set to GraphicsExpose. see the pattern? slay.
  • display β€” set to a pointer to the display the event was read on.
  • send_event β€” set to True if the event came from a SendEvent protocol request.
  • serial β€” set from the serial number reported in the protocol, but expanded from the 16-bit least-significant bits to a full 32-bit value. glow-up energy honestly ✨
  • window β€” set to the window that is most useful to toolkit dispatchers.

and then there's a second thing about window, because it's a main character with layers πŸ’œ:

window is set to the window whose size another client attempted to change. and the width and height members are set to the inside size of the window, excluding the border. so the border is not invited to this party, ok? πŸ™ˆ

lowkey important: the width/height are the inside size. border not included. don't come for me if you forget and your layout is off by a couple pixels πŸ’€

🌈 SEE ALSO 🌈

the whole friend group, all of them, iykyk:

XAnyEvent(3), XButtonEvent(3), XCreateWindowEvent(3), XCirculateEvent(3), XCirculateRequestEvent(3), XColormapEvent(3), XConfigureEvent(3), XConfigureRequestEvent(3), XCrossingEvent(3), XDestroyWindowEvent(3), XErrorEvent(3), XExposeEvent(3), XFocusChangeEvent(3), XGraphicsExposeEvent(3), XGravityEvent(3), XKeymapEvent(3), XMapEvent(3), XMapRequestEvent(3), XPropertyEvent(3), XReparentEvent(3), XSelectionClearEvent(3), XSelectionEvent(3), XSelectionRequestEvent(3), XUnmapEvent(3), XVisibilityEvent(3)

and of course the big one, the mothership: Xlib - C Language X Interface πŸ‘‘


and that's the page babes πŸ¦‹ this was X Version 11, libX11 1.8.14, dated XResizeRequestEvent(3) β€” go forth and handle your resize requests responsibly, mwah πŸ’–πŸŽ€

πŸ“¦ where this page comes from