The Devil is in the details. And in the case of the X11 Devil, they're literally named "detail", and they sound weird enough for Elon Musk to name his children after.

https://tronche.com/gui/x/xlib/events/window-entry-exit/

typedef struct {
int type; /* EnterNotify or LeaveNotify */
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; /* ``event'' window reported relative to */
Window root; /* root window that the event occurred on */
Window subwindow; /* child window */
Time time; /* milliseconds */
int x, y; /* pointer x, y coordinates in event window */
int x_root, y_root; /* coordinates relative to root */
int mode; /* NotifyNormal, NotifyGrab, NotifyUngrab */
int detail;
/*
* NotifyAncestor, NotifyVirtual, NotifyInferior,
* NotifyNonlinear,NotifyNonlinearVirtual
*/
Bool same_screen; /* same screen flag */
Bool focus; /* boolean focus */
unsigned int state; /* key or button mask */
} XCrossingEvent;
typedef XCrossingEvent XEnterWindowEvent;
typedef XCrossingEvent XLeaveWindowEvent;

More details (these are just the "normal" ones, just wait till you read about "abnormal" NotifyGrab and NotifyUngrab mode and input focus events, and how grabbing interacts with input focus, and key map state notifications):

https://tronche.com/gui/x/xlib/events/window-entry-exit/norm...

https://tronche.com/gui/x/xlib/events/window-entry-exit/grab...

https://tronche.com/gui/x/xlib/events/input-focus/

https://tronche.com/gui/x/xlib/events/input-focus/normal-and...

https://tronche.com/gui/x/xlib/events/input-focus/grab.html

https://tronche.com/gui/x/xlib/events/key-map.html

And then you have colormaps and visuals:

https://donhopkins.medium.com/the-x-windows-disaster-128d398...

>The color situation is a total flying circus. The X approach to device independence is to treat everything like a MicroVAX framebuffer on acid. A truly portable X application is required to act like the persistent customer in Monty Python’s “Cheese Shop” sketch, or a grail seeker in “Monty Python and the Holy Grail.” Even the simplest applications must answer many difficult questions:

WHAT IS YOUR DISPLAY?
display = XOpenDisplay("unix:0");

WHAT IS YOUR ROOT?
root = RootWindow(display, DefaultScreen(display));

AND WHAT IS YOUR WINDOW?
win = XCreateSimpleWindow(display, root, 0, 0, 256, 256, 1,
BlackPixel(
display,
DefaultScreen(display)),
WhitePixel(
display,
DefaultScreen(display)));

OH ALL RIGHT, YOU CAN GO ON.

(the next client tries to connect to the server)

WHAT IS YOUR DISPLAY?
display = XOpenDisplay("unix:0");

WHAT IS YOUR COLORMAP?
cmap = DefaultColormap(display, DefaultScreen(display));

AND WHAT IS YOUR FAVORITE COLOR?
favorite_color = 0; /* Black. */
/* Whoops! No, I mean: */
favorite_color = BlackPixel(display, DefaultScreen(display));
/* AAAYYYYEEEEE!! */
(client dumps core & falls into the chasm)

WHAT IS YOUR DISPLAY?
display = XOpenDisplay("unix:0");

WHAT IS YOUR VISUAL?
struct XVisualInfo vinfo;
if (XMatchVisualInfo(display, DefaultScreen(display),
8, PseudoColor, &vinfo) != 0)
visual = vinfo.visual;

AND WHAT IS THE NET SPEED VELOCITY OF AN XConfigureWindow REQUEST?
/* Is that a SubstructureRedirectMask or a ResizeRedirectMask? */

WHAT??! HOW AM I SUPPOSED TO KNOW THAT? AAAAUUUGGGHHH!!!!
(server dumps core & falls into the chasm)