←back to thread

X and NeWS history

(minnie.tuhs.org)
177 points colinprince | 5 comments | | HN request time: 0s | source
Show context
badsectoracula ◴[] No.15327002[source]
> The only really worthwhile thing about X was the distributed extension registration mechanism. All of the input, graphics and other crap should be moved to extension #1. That way, it won't be mandatory in conforming implementations once that stuff was obsolete. As you probably know, that's where we are today; nobody uses that stuff but it's like the corner of an Intel chip that implements the original instruction set.

On the other hand, all of the input, graphics and "other crap" being mandatory means that as a developer you can pretty much guarantee that they are there and if you care about having your stuff work everywhere (well, everywhere X is available anyway) you can simply rely on that without having to support a bunch of different APIs that may or may not be there (see the audio situation a few years ago in Linux).

(also FWIW a lot of people use the X primitives, not everyone uses Gtk or Qt)

replies(2): >>15327581 #>>15328599 #
1. adrianratnapala ◴[] No.15327581[source]
Yes, the 2d primitives in X are actually fine -- a bunch of dumb obvious primitives of the kind that just about every graphics system has.

Where it fell down was all the complication about XVisuals and colours etc. Those things were solving real problems for the era but doing so with an unnecessarily complicated interface that tied the 2d-primitives and much else into the assumptions of that era.

Thus as things developed, whole new APIs like XRender had to be invented in order to do the dumb basic primitives again.

replies(1): >>15327810 #
2. DonHopkins ◴[] No.15327810[source]
I beg to differ. X11 2D primitives are "actually fine" in the same sense that there were "very fine people" marching in Charlottesville. By which I mean "not actually very fine". ;)

But I totally agree with you about colors (the X approach to device independence is to treat everything like a MicroVAX framebuffer on acid), and xRender (which was wonderful work that transcended X11 and led to Cairo and html's canvas).

And don't get me started about window borders, and the SHAPES extension, and their fractally complex interactions!

http://www.art.net/~hopkins/Don/unix-haters/x-windows/disast...

A task as simple as filing and stroking shapes is quite complicated because of X's bizarre pixel-oriented imaging rules. When you fill a 10x10 square with XFillRectangle, it fills the 100 pixels you expect. But you get extra "bonus pixels" when you pass the same arguments to XDrawRectangle, because it actually draws an 11x11 square, hanging out one pixel below and to the right!!! If you find this hard to believe, look it up in the X manual yourself: Volume 1, Section 6.1.4. The manual patronizingly explains how easy it is to add 1 to the x and y position of the filled rectangle, while subtracting 1 from the width and height to compensate, so it fits neatly inside the outline. Then it points out that "in the case of arcs, however, this is a much more difficult proposition (probably impossible in a portable fashion)." This means that portably filling and stroking an arbitrarily scaled arc without overlapping or leaving gaps is an intractable problem when using the X Window System. Think about that. You can't even draw a proper rectangle with a thick outline, since the line width is specified in unscaled pixel units, so if your display has rectangular pixels, the vertical and horizontal lines will have different thicknesses enen though you scaled the rectangle corner coordinates to compensate for the aspect ratio.

replies(2): >>15327952 #>>15336175 #
3. adrianratnapala ◴[] No.15327952[source]
I beg to differ. X11 2D primitives are "actually fine" in the same sense that there were "very fine people" marching in Charlottesville. By which I mean "not actually very fine". ;)

Probably we are agreeing past each-other. I meant they were OK in a very board sense that you want primitives for drawing lines, drawing polygons, filling things, blitting things etc. I think you agree with me about that.

And I also think we both agree that the details of those primitives in X11 were a disaster.

4. badsectoracula ◴[] No.15336175[source]
Yeah the details are kinda weird (although i wonder if there is some reasoning behind that because Windows also has the same off-by-one-pixel thing - and even more confusingly it is done through the same API call but it is a special case when you use a null pen) but for me the most important thing is that they are there and you can safely rely on that they are there despite the weirdness.
replies(1): >>15343980 #
5. adrianratnapala ◴[] No.15343980{3}[source]
Off-by-one pixel stuff is not surprising in world where your API deals explicitly with individual pixels. Newer systems are a bit simpler here because they treat the screen as continuous plane that only gets mapped to pixels at the last moment.

The flip side is that you have to worry about weird aliasing (or anti-aliasing!) artifacts, such as black lines turning grey.