Live data from Hacker News

Ancient X11 scaling technology

flak.tedunangst.com

61–70 of 264 posts

Re: Ancient X11 scaling technology

#61
Sigh. And now that it's been long enough, everyone will conveniently forget all of the reasons why this wound up being insufficient, and think that all of the desktop environment and toolkit developers are simply stupid. (Importantly, applications actually did do this by default at one point. I remember a wonky-looking nvidia-xsettings because of this.)

The thing X11 really is missing (at least most importantly) is DPI virtualization. UI scaling isn't a feature most display servers implement because most display servers don't implement the actual UI bits. The lack of DPI virtualization is a problem though, because it leaves windows on their own to figure out how to logically scale input and output coordinates. Worse, they have to do it per monitor, and can't do anything about the fact that part of the window will look wrong if it overlaps two displays with different scaling. If anything doesn't do this or does it slightly differently, it will look wrong, and the user has little recourse beyond searching for environment variables or X properties that might make it work.

Explaining all of that is harder than saying that X11 has poor display scaling support. Saying it "doesn't support UI/display scaling" is kind of a misnomer though; that's not exactly the problem.

Re: Ancient X11 scaling technology

#62
post #38
post #6

Drawing a circle is kind of cheating. The hard part of scaling is drawing UI elements like raster icons or 1px hairlines to look non-blurry.

And also doing it for multiple monitors with differing scales. Nobody claims X11 doesn't support different DPIs. The problems occur when you have monitors with differing pixel densities. At the moment only Windows handles that use case perfectly, not even macOS. Wayland comes second if the optional fractional scaling is implemented by the toolkit and the compositor. I am skeptical of the Linux desktop ecosystem to do…

Speaking of X11 and Windows, any recommended Windows Xservers to add to this StackOverflow post? https://stackoverflow.com/questions/61110603/how-to-set-up-w...

I hadn't heard of WSLg, vcxsrv was the best I could do for free.

Re: Ancient X11 scaling technology

#64
post #4

That's probably better than most scaling done on Wayland today because it's doing the rendering directly at the target resolution instead of doing the "draw at 2x scale and then scale down" dance that was popularized by OSX and copied by Linux. If you do it that way you both lose performance and get blurry output. The only corner case a compositor needs to cover is when a client is straddling two outputs. And even in…

If the initial picture is large enough the blur from down-scaling isn't so bad. Say 1.3 pixel per pixel vs 10.1 pixels per pixel.

Re: Ancient X11 scaling technology

#65
post #60

Brilliant. This is another piece of evidence on the pile of why we got Wayland: it's because people who understood X11 mostly retired and everyone else couldn't be bothered to learn X11 because it's "yucky C code" or something. And it bothers me that we lose remote rendering with Wayland (unless one fights with waypipe) that was just built-in to X11. Yes, it was slow, but actually if you're running a VM on your local…

This is nonsensical myth-making. Despite the clickbait title, the APIs called in those code samples are very basic and not some forgotten wizardry.

What part is nonsensical? Because Wayland is basically a fulfillment of jwz's CADT.

Re: Ancient X11 scaling technology

#66
post #60

Earlier quoted context omitted.

This is nonsensical myth-making. Despite the clickbait title, the APIs called in those code samples are very basic and not some forgotten wizardry.

What part is nonsensical? Because Wayland is basically a fulfillment of jwz's CADT.

The part where we got Wayland because we lost a magic caste of rockstar engineers who could call XRRGetOutputInfo/XRRGetCrtcInfo.

Re: Ancient X11 scaling technology

#67
post #59
post #47

Earlier quoted context omitted.

That's what I referred to with "we'll be finally getting that in Wayland now". For many years the Wayland protocol could only communicate integer scale factors to clients. If you asked for 1.5 what the compositors did was ask all the clients to render at 2x at a suitably fake size and then scale that to the final output resolution. That's still mostly the case in what's shipping right now I believe. And even in integ…

In KDE Plasma we've supported the way you like for quite some years, because Qt is a cross-platform toolkit that supported fractional on e.g. Windows already and we just went ahead and put the mechanisms in place to make use of that on Wayland. The standardized protocols are more recent (and of course we heavily argued for them). Regarding the way the protocol works and something having to be retrofitted, I think you…

Thanks! By retrofitting I mean having to have a new protocol with this new opt-in method where some apps will be getting integer scales and go through a transform and some apps will be getting a fractional scale and rendering directly to the output resolution. If this had worked "correctly" from the start the compositors wouldn't even need to know anything about scaling. As far as they knew the scaling metadata could have been an opaque value that they passed from the user config to the clients to figure out. I assume we're stuck forever with all compositors having to understand all this instead of just punting the problem completely to clients.

When you say you supported this for quite some years was there a custom protocol in KWin to allow clients to render directly to the fractionally scaled resolution? ~4 years ago I was frustrated by this when I benchmarked a 2x slowdown from RAW file to the same number of pixels on screen when using fractional scaling and at least in sway there wasn't a way to fix it or much appetite to implement it. It's great to see it is mostly in place now and just needs to be enabled by all the stack.

Re: Ancient X11 scaling technology

#68
post #61

Sigh. And now that it's been long enough, everyone will conveniently forget all of the reasons why this wound up being insufficient, and think that all of the desktop environment and toolkit developers are simply stupid. (Importantly, applications actually did do this by default at one point. I remember a wonky-looking nvidia-xsettings because of this.) The thing X11 really is missing (at least most importantly) is D…

> can't do anything about the fact that part of the window will look wrong if it overlaps two displays with different scaling

It's silly that people keep complaining about this. It's a very minor effect, and one that can be solved in principle only by moving to pure vector rendering for everything. Generally speaking, a window will only ever span a single screen. It's convenient to be able to drag a window to a separate monitor, but having that kind of overlap as a permanent feature of one's workflow is just crazy.

> The thing X11 really is missing (at least most importantly) is DPI virtualization.

Shouldn't that kind of DPI virtualization be a concern for toolkits rather than the X server or protocol? As long as X is getting accurate DPI information from the hardware and reporting that to clients, what else is needed?

Re: Ancient X11 scaling technology

#69
post #27

Earlier quoted context omitted.

> 1994 Apparently you have to be criticizing X11 for more than three decades now. Since you seem to know your stuff, could you please post a link to your git repository containing your personal display server that solves all the problems?

Since they bought Sun Microsystems, Oracle now owns the rights to the NeWS source code, so unfortunately I'm not legally allowed to post the NeWS server source code on my Github page, although I spent many years unsuccessfully fighting to make NeWS free and evangelizing it to anyone who would listen, like RMS and my colleagues and customers at Sun: https://www.donhopkins.com/home/archive/NeWS/rms.news.txt https://www…

> Oracle owns the rights to the NeWS source code so I'm not allowed to post it on my Github page.

They are certainly not making any money with it right now. All patents should be expired by now. Have you ever sincerely asked if you are allowed to publish the code?

> Do you have any ... display servers that solve all the problems too?

X11 has extensions which correct for most of its original flaws. Most importantly XRandr (as mentioned in the article), DRI3 (fast hardware access) and XRender (accelerated drawing primitives that don't suck). With the exception for the availability of a decent toolkit and HDR extension X11 solves all the problems.

> Or comments on any of these?

Oh boy... well, you asked for it.

> Pie Menus

Great for demos and to collect grant money, i guess. But in principle a total anti-pattern. People read from left to right and from top to bottom. Traditional context menus are therefore far superior, especially for varying numbers of options.

> Weirdly dragable tabs

Not impressed at all, sorry. Creates much more visual confusion than generic title bars.

> HyperTIES

The most revolutionary component are links... which are not invented by HyperTIES.

> PSIBER

Genuinely very impressive. A proper visual postscript debugging tool. But also necessary for a rather unintuitive stack based language like postscript which is primarily designed to be machine readable.

> SimCity

Great Game. Thanks again for making that available to the FOSS community.

Re: Ancient X11 scaling technology

#70

It’s astounding to me that in Linux, in 2025, I can’t just simply output a custom resolution. You are probably typing a response right now with some xrandr nonsense and I PROMISE you, it won’t do it. I can’t even scale my screen within a normal resolution to make it fit within a boundary. But I can do this in windows with an nvidis gpu. Crazy

[flagged]
Post reply on HN