X11 works.. when noone actually uses X11, but actually some wrapper API that was made alongside the development of X11, or suffered through effectively replaying history. Some fun things I recall encountering while trying to use it:<p>Want to detect a left click? Sure! How about the back/forward buttons on the mouse? nope, not in the API; well, if you try pressing them you'll see them going to mouse button constants 8 & 9, but I didn't find that in any documentation.<p>Want to get scrolling events? There are mouse press things for that (even left/right!). Want to also handle touchpads which may have fractional scrolls? Well, there is some confusing "valuator" stuff, and you can take a delta between two valuator event floats.. but after using it for a while, you'll notice that the app will like randomly scroll by large distances. Turns out... that valuator value is <i>a globally accumulated value</i>, so you have to hack in a thing to "reset" the "calibration" of that any time the mouse exits a window (try it -
move mouse out & in a window, scroll one tick, repeat - you'll never scroll anywhere).<p>For text input, you can thankfully call a thing that'll do XCompose & most key handling for you, but to handle xmodmap I believe you have to write the mapping functionality yourself; didn't bother. Then there's some stuff about how in some context a window was not focusable through some specific method for some undetermined amount of time after being made visible, but there might be some reason for that (never bothered to figure it out).<p>Now, I don't know if wayland does any better on any of this, but I sure hope it does, as it does seem to at least make an attempt at being usable. Maybe wayland will go the same route, with a middle-man library that handles all the DE-specific stuff. There's already some of that for window decorations.