Live data from Hacker News

Ancient X11 scaling technology

flak.tedunangst.com

211–220 of 264 posts

Re: Ancient X11 scaling technology

#211
post #46

It's like the "oh no, X11 suffers from tearing video" problem that they pull out all the time. (A) I have no idea what "video tear" is and (B) I play video all the time on my crappy laptop running X11 and it seems fine for me. But can I ssh to my remote server and run emacs or another program completely transparently yet with Wayland? Nope. I do that with X11 continuously.

I used to see it all the time on X11. I'd see it on YouTube/Firefox. I'd see it on VLC. I'd see it on MPV. Any video player, playing any fast paced video you'll see X11 struggle to keep up with drawing full frames that it'd just give up and draw half of one frame and another half of another frame and call it a day. The Intel driver luckily had an xorg.conf setting I could add to make this less of an issue -- I guess…

Maybe Wayland works without any faffing around for you, but the last time I ran it(via KDE), it completely hung my system whereas X11 worked out of the box.

And Wayland has been around for at least 15 years, btw, not 5. You'd think 15 years would be long enough to get something stable, but apparently not.

Re: Ancient X11 scaling technology

#212
post #176
post #151

Earlier quoted context omitted.

You can absolutely do that on X11, but you have to do it in the client, and no one cares to do it.

if you have to do it in the client, aka the application, then it's not transparent to the application

If we can require applications to draw their own window controls, I think we can ask them to handle their pixel densities.

Re: Ancient X11 scaling technology

#213
post #8

Earlier quoted context omitted.

> doing the "draw at 2x scale and then scale down" dance that was popularized by OSX Originally OS X defaulted to drawing at 2x scale without any scaling down because the hardware was designed to have the right number of pixels for 2x scale. The earliest retina MacBook Pro in 2012 for example was 2x in both width and height of the earlier non-retina MacBook Pro. Eventually I guess the cost of the hardware made this t…

Out of curiosity, do you happen to know why Apple thought that would be the cause for low adoption among 3rd party apps? Isn't scaling something that the OS should handle, that should be completely transparent, something that 3rd party devs can forget exists at all? Was it just that their particular implementation required apps to handle things manually?

I can only offer a hypothesis. Historically UI sizing was done in pixels, which means they are always integers. When developers support fractional scaling they can either update the app to do all calculations in floating point and store all intermediate results in floating point. That's hard. Or they could do calculations in floating point but round to integers eagerly. That results in inconsistent spacing and other layout bugs.

With 2x scaling there only needs to be points and pixels which are both integers. Developers' existing code dealing with pixels can usually be reinterpreted to mean points, with only small changes needed to convert to and from pixels.

With the 2x-and-scale-down approach the scaling is mostly done by the OS and using integer scaling makes this maximally transparent. The devs usually only need to supply higher resolution artwork for icons etc. This means developers only need to support 1x and 2x, not a continuum between 1.0 and 3.0.

Re: Ancient X11 scaling technology

#214
post #117

Earlier quoted context omitted.

> The bitter truth is that fractional scaling is impossible . That's overly prescriptive in terms of what users want. In my experience users who are used to macOS don't mind slightly blurred text. And users who are traditionalists and perhaps Windows users prefer crisper text at the expense of some height mismatches. It's all very subjective.

> In my experience users who are used to macOS don't mind slightly blurred text. It always makes me laugh when apple users say "oh it's become of the great text rendering!" The last time text rendering was any good on MacOS was on MacOS 9, since then it's been a blurry mess. That said, googling for "MacOS blurry text" yields pages and pages and pages of people complaining so I am not sure it is that subjective, simpl…

You can only search for complaints because those who enjoy it are the silent majority. You can however also search for pages and pages of discussions and tools to bring Mac style text rendering to Windows including the MacType tool. It is very much subjective.

"Great text rendering" is also highly subjective mind you. To me greatness means strong adherence to the type face's original shape. It doesn't mean crispness.

Re: Ancient X11 scaling technology

#215

It's not "can you provide the screen DPI to a window?" people bemoan, it's "can you draw one window across two screens with differing DPIs, transparent to the application?"

I'm struggling to imagine why would anyone ever want to do that. It's not even an edge case at this point, it's over the edge.

I have two monitors, but only one of them is 4k and a couple cm bigger, and I dont like to buy stuff unless I really need. It is good enough for me. But this case also comes up on the edge of my laptop when I have the 4k plugged in at the same time. In the days of eclipse I'd keep the code editor top half on monitor, and the console output on the laptop, worked quite nice.

Re: Ancient X11 scaling technology

#216

Earlier quoted context omitted.

> (it is the video itself not YouTube being a resource hog, I checked) Did you check by downloading the video and playing it with a good standalone video player like mplayer, vlc, or mpv? If you didn't, then you didn't disentangle the web browser from the video playback.

I've spent a lot of time in my career working on weird rendering issues on websites/devices. Believe me when I said "I checked", I know WTF I am talking about. The only thing that was different was Wayland vs X11. Same browser, same browser settings, same OS and same plugins.

> Same browser, same browser settings, same OS and same plugins.

Neat. Did you test outside of the browser? Based on your report, it sounds like you didn't. As you must know, the renderers in web browsers are very, very complex. I suggest you test with a standalone video player before you go blaming the underlying windowing system for performance issues.

Re: Ancient X11 scaling technology

#217

Earlier quoted context omitted.

I disagree, I don't want a relative metric. You're saying scale factor neatly encapsulates viewing distance, eyesight, preference, but compared to what? Scale is meaningless if I don't have a reference point. If I have two different size monitors you have now created a metric where a scale of 2x means something completely different. So to get things look the same I either have to manually calculate DPI or I have to m…

What you actually want is not DPI (or PPI, pixels per inch) but PPD (pixels per degree). But that depends on the viewing distance.

Not even that - my mom and I might sit the same distance from screens of the same size but she will want everything to be scaled larger than I do. Ultimately, it's a preference and not something that should strictly match some objective measurement.

Re: Ancient X11 scaling technology

#218
post #135

Earlier quoted context omitted.

I see where you are coming from and it makes sense. I will also say though that in the most common cases where people request mixed scale factor support from us (laptop vs. docked screen, screen vs. TV) there are also other form factor differences such as viewing distance that doesn't make folks want to match DPI, and "I want things bigger/smaller there" is difficult to respond to with "calculate what that means to y…

> I see where you are coming from and it makes sense. I actually agree (even though I did not express that in my original post) that DPI is probably not a good "user visible" metric. However, I find that the scaling factor relative to some arbitrary value is inferior in every way. Maybe it comes the fact that we did not have proper fractional scaling support earlier, but we are now in the non-sensical situation that…

The only place were this is a problem though is the configuration UI though. The display configuration could be changed to show a scale relative to the display size (so 100% on all displays means means sizes match) while the protocol keeps talking to applications in scale relative to the pixel size (so programs don't need to care about DPI and instead just have one scale factor).

Re: Ancient X11 scaling technology

#219
post #81

Earlier quoted context omitted.

The end-user UIs don't ask you to calculate anything. Typically they have a slider from 100% to, say, 400% and let you set this to something like 145%. This may take some getting used to if you're familiar with DPI and already know the value you like, but for non-technical users it's more approachable. Not everyone knows DPI or how many dots they want to their inches. That the 145% is 1.45 under the hood is really an…

Not to mention that only a small fraction of the world uses inches...

For display (diagonal) sizes inches have become the default unit everywhere I've been to.

Re: Ancient X11 scaling technology

#220
post #164

Earlier quoted context omitted.

> Free-scaling UIs were tried for years before that and never once got to acceptable quality. The web is a free-scaling UI, which scales "responsively" in a seamless way from feature phones with tiny pixelated displays to huge TV-sized ultra high-resolution screens. It's fine.

You are correct. I worked on this for years at Mozilla. See https://robert.ocallahan.org/2007/02/units-patch-landed_07.h... and https://robert.ocallahan.org/2014/11/relax-scaling-user-inte... for example. Some of the problems were pretty hard but the Web ended up in a pretty good place --- Web developers pretty much don't think about whether scaling factors are fractional or not, and things just work... well enough t…

It mostly works but you can still run into issues when you e.g. want to have an element size match the border of another. Things like that that used to work don't anymore due to the tricks needed to make fractional scaling work well enough for other uses.
Post reply on HN