XReparentEvent(3)

πŸ’… XReparentEvent(3) πŸ’…

okay bestie, welcome to the XLIB FUNCTIONS zone β€” this page is all about XReparentEvent, the ReparentNotify event structure. No cap, it's giving β€œwindow got a new parent” energy, and we're gonna read the whole struct together. 🫢

πŸ’– NAME πŸ’–

XReparentEvent β€” ReparentNotify event structure. That's the whole name, periodt. ✨

🧚 STRUCTURES 🧚

The structure for ReparentNotify events contains:

       typedef struct {
               int type;       /* ReparentNotify */
               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 event;
               Window window;
               Window parent;
               int x, y;
               Bool override_redirect;
       } XReparentEvent;

When you receive this event, the structure members are set as follows. πŸ’…

First the general event bookkeeping, so you know what's what:

  • type β€” set to the event type constant name that uniquely identifies it. 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. Iconic.
  • display β€” set to a pointer to the display the event was read on. That's your display bestie. πŸ–₯️
  • send_event β€” set to True if the event came from a SendEvent protocol request. Not me checking where it came from, but yes. πŸ™ˆ
  • 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. Math-ish, but make it make sense. πŸ”’
  • window β€” set to the window that is most useful to toolkit dispatchers. (More specific window tea below, don't worry.) πŸͺŸ

Then the reparent-specific members do their thing:

  • event β€” set either to the reparented window or to the old or the new parent, depending on whether StructureNotify or SubstructureNotify was selected. Pick your notifier, get your event. πŸ‘€
  • window β€” set to the window that was reparented. That's the main character of this event, fr fr. πŸ‘‘
  • parent β€” set to the new parent window. New parent just dropped. πŸŽ€
  • x, y β€” set to the reparented window's coordinates relative to the new parent window's origin, and they define the upper-left outer corner of the reparented window. Coordinates, but make it cute. πŸ“
  • override_redirect β€” set to the override-redirect attribute of the window specified by the window member.
🚨 window manager clients: normally you should ignore this window if the override_redirect member is True. That's the rule, bestie. Don't fight it. πŸ’€

🌈 SEE ALSO 🌈

All the sibling event pages and the big Xlib reference, in all their glory:


mwah πŸ’‹ okay that's the page. The footer sign-off is X Version 11, libX11 1.8.14, on page XReparentEvent(3) β€” and there's no separate date line in the footer, so that's the whole source/version vibe. 🫢✨

πŸ“¦ where this page comes from