from Hacker News

Xplain – Explaining X11 for the rest of us

by b3h3moth on 7/6/16, 12:17 PM with 44 comments

  • by microtherion on 7/6/16, 10:15 PM

    Personally, my favorite explanation of X11 is found on page 139 of the Unix Hater's Handbook http://web.mit.edu/~simsong/www/ugh.pdf

    "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"

    Read the original for the hilariously accurate dialog that follows…

  • by Jasper_ on 7/6/16, 10:30 PM

    Author here, let me know if you have any questions or comments! Given how much attention this is getting, I should probably finally finish one of the three articles I have sitting around in the backlog.
  • by lil1729 on 7/7/16, 4:49 AM

    https://medium.com/@slavapestov/yesterdays-news-c52f2be95205...

    "Unlike X11, where the graphics primitives were rather low-level and all input event handling involved round-trips to the client, NeWS was advanced enough that simple widgets, such as scroll bars and sliders, could be implemented entirely server-side, only sending high-level state changes to the client, more along the lines of “slider value is now set to 15” than “mouse button 2 released”. Similarly, the client could ask the server to render a widget in a given state, rather than repeatedly transmitting sequences of graphics primitives."

  • by eschaton on 7/6/16, 11:15 PM

    The author appears to credit the X Window System or Microsoft Windows with repaint-on-expose. To my knowledge that was first implemented (along with regions) by Bill Atkinson for the Apple Lisa, because he misremembered what he saw on the visit to PARC; overlapped windows in the PARC systems at the time didn't automatically and efficiently repaint only the affected area.
  • by sdegutis on 7/6/16, 9:49 PM

    The interactivity of this series is just amazingly helpful in visualizing what the heck is going on. Honestly, for me that makes this one of the few links on HN that I might actually read all the way through. And may even use it as a homeschool lesson for our kids, if it seems written simply enough (which at first glance it is).
  • by SXX on 7/7/16, 2:40 AM

    For those who might want to understand why Wayland was created. Also tons of fun facts about X11. Really nice talk of Daniel Stone about X server from 2013:

    https://www.youtube.com/watch?v=RIctzAQOe44

  • by therein on 7/6/16, 9:25 PM

    Even my manager who worked on the original X/Motif codebase in the 80s when DEC and HP was working on it doesn't enjoy talking about these details. Pretty good write up, though.
  • by shmerl on 7/6/16, 9:30 PM

    > Several new technologies have appeared

    You should probably also add Vulkan + WSI to the list.

    UPDATE: I just realized, this article is from 2013.

  • by hathym on 7/7/16, 8:53 AM

    the X11 server written in Javascript here: https://magcius.github.io/xplain/src/server/server.js
  • by digi_owl on 7/7/16, 3:13 PM

    > While I do personally believe Wayland is going to become The Linux Display Server Of The Future®

    Best i can understand, wayland is a protocol spec rather than a set of code like X. Each compositor/wm is individually responsible for implementing said protocol and thus take over the job of X (input handling et al).

    Meaning that there will no longer be an X server to act as a independent arbiter of behavior. Whatever the devs of whatever DE you are logged into will have the final word.

    The more i learn of Wayland, the more i expect it to turn into a hairball to match X. Only now without a network option ("too insecure"), and with GPU acceleration.

    BTW, why are we so bent out of shape about this seats concept? Why oh why are we continually trying to turn a single user piece of hardware into a desktop mainframe?!

  • by rikkus on 7/7/16, 9:00 AM

    Anyone who's interested in X11 (the protocol) and the Ruby language should have a look at Mathieu Bouchard's incredible implementation [1]

    There's some quite beautiful Ruby code in there, e.g.:

      module X11
        k = Keysymdef = {}
        c = Cursorfont = {}
        [k,c].each {|x| x.extend X11::MAssignForHash }
        k[%w| space exclam quotedbl numbersign dollar percent ampersand |]=32..38
        k[%w| quoteright parenleft parenright asterisk plus comma minus |]=39..45
        [...]
    
    [1] http://artengine.ca/matju/RubyX11/
  • by daveloyall on 7/6/16, 9:42 PM

  • by jd3 on 7/6/16, 10:54 PM

    Excellent description of the (somewhat needlessly) complex X Window System (the Blit and Rio are so beautiful). Still makes me sad that COMPOSITE doesn't build in XQuartz for OS X. I posted on the mailing list, but got a pretty non-helpful response.. [0]

    [0]: http://comments.gmane.org/gmane.os.apple.xquartz.devel/912

  • by swiley on 7/6/16, 11:43 PM

    This looks like a great article but on a phone the margins are as wide as the text! And they used that wrapping mode that stretches lines out instead of truncating them which looks great if you don't want to read the text but is super annoying when you are.
  • by known on 7/7/16, 7:26 AM

  • by foo101 on 7/7/16, 8:52 AM

    How are the interactive windows that are displayed in the page created? Is that a complete simulation of X server done with JavaScript or is it something unrelated to X server?