Live data from Hacker News

A few HiDPI tricks for Linux

blog.yossarian.net

121–130 of 192 posts

Re: A few HiDPI tricks for Linux

#121

Earlier quoted context omitted.

Except the author is using X11 as many people will. And what this shows is how many different environments / toolkits / settings there are out there. It would be nice if distributions would do a better job of handling this for you. I’ve run into the same issues myself, and it’s kind of hard to believe that I even had to figure out these configuration dpi settings in 2021.

The point is, you don't have to figure out configuration dpi settings in 2021, if you use distributions as they are supposed to be used . If you insist on your favorite x11 window manager, the integration is on you. No point in complaining then, it is self-inflicted pain.

> distributions as they are supposed to be used.

As much as i like the concept of Wayland, until it's a one click always works without any caveats option in Ubuntu it essentially doesn't exist. Ubuntu 20.04, the latest of the most popular distributions, does not have wayland enabled by default. They actively discourages you from trying it if you have Nvidia, which again is the most popular gfx card - not sure if one is supposed skip the proprietary drivers or not with Wayland but on X11 using Nouveau is not a pleasant experience.

Re: A few HiDPI tricks for Linux

#122
post #121

Earlier quoted context omitted.

The point is, you don't have to figure out configuration dpi settings in 2021, if you use distributions as they are supposed to be used . If you insist on your favorite x11 window manager, the integration is on you. No point in complaining then, it is self-inflicted pain.

> distributions as they are supposed to be used. As much as i like the concept of Wayland, until it's a one click always works without any caveats option in Ubuntu it essentially doesn't exist. Ubuntu 20.04, the latest of the most popular distributions, does not have wayland enabled by default. They actively discourages you from trying it if you have Nvidia, which again is the most popular gfx card - not sure if one…

Nvidia is the most popular graphics for gamers; the most popular graphics for general computer users is integrated with an Intel CPU.

Re: A few HiDPI tricks for Linux

#123
post #113
post #96

Earlier quoted context omitted.

My MacBook powering my 4K monitor doesn’t look blurry at all, and I have it set to “2560x1440” scaling in the display settings. It does however run a tiny bit slower due to that non-integer retina scaling.

It does look surprisingly good, but it's still blurring unless they changed it this year. Alternating-color pixel grids always moire there.

I don’t believe they’ve changed it, but tbqh I swap back and forward daily from my MacBook to my gaming PC over the same DisplayPort connection, both set at 150% display scaling (basically), and for where I’m sitting I can’t tell the difference — and there are heap more UI elements on Windows (various icons, apps, etc) that look way way worse due to not being compatible, or having hi-res assets perhaps?

For me it’s a bit of a wash day to day

Re: A few HiDPI tricks for Linux

#124

Earlier quoted context omitted.

The solution in that email is essentially how it works, the only difference is that the scaling factor is forced to be an integer. >By faking them out and telling them "here's a 200x200 box to do your work" and then later scaling down that box to 150x150 prevents that code from working properly. Then question I was getting at is: how do you write a renderer that does the right thing and works properly when given a bo…

You already have to propagate code all over to handle integer multiples, don't you? The email seems to be worried about things happening at the wayland level with fractions, but that's easily solved by rounding entire windows to the nearest pixel.

You do have to propagate the scaling factor, but as long as it's an integer scale, you don't have to convert all your coordinates to use floating-point everywhere and enforce rounding rules.

I'd also like to point out that if you are rounding in your rendering anywhere, you are now likely either introducing blurriness again, or something is getting scaled incorrectly. The only real way I know to do this without causing artifacts or error build-up is to have to compositor only do the rounding as the last step, which is the way it works now, and you have to use an integer scale for that. As you describe, this is the "easily solved" way, but it's only really easy because the compositor gets to handle it internally -- once you push that problem to clients it gets significantly harder.

Re: A few HiDPI tricks for Linux

#125

Earlier quoted context omitted.

The solution in that email is essentially how it works, the only difference is that the scaling factor is forced to be an integer. >By faking them out and telling them "here's a 200x200 box to do your work" and then later scaling down that box to 150x150 prevents that code from working properly. Then question I was getting at is: how do you write a renderer that does the right thing and works properly when given a bo…

You already have to propagate code all over to handle integer multiples, don't you? The email seems to be worried about things happening at the wayland level with fractions, but that's easily solved by rounding entire windows to the nearest pixel.

[deleted]

Re: A few HiDPI tricks for Linux

#126

Credit where credit is due this is the one area where Windows is the best OS these days. It not only will do fractional scaling but it will do display independent fractional scaling - whack in the scaling percentage on each screen and in the recent versions of Windows 10 it works well and looks great and remembers your settings when you plug that monitor back in. It is perhaps THE thing along with WSL2 (now giving me…

Yep. Windows 10 is fantastic in this regard. MacOS on the other hand sucks. Basically the recommendation is to run a lower and blurry resolution if you want bigger buttons and text... At the same time, iOS has great scaling and text sizing options, and macOS’ interface is so abstract that it should be very easy to vectorize it, enabling seamless scaling to any size wanted. Really baffling.

Have you even used macOS on a HiDPI display? I use this every day on several setups and it shines at handling this. Windows, while it can do HiDPI as well, it's basically become a turd in terms of user friendliness and experience.

Re: A few HiDPI tricks for Linux

#128

Earlier quoted context omitted.

This also works well on GNOME Wayland (and probably other Wayland compositors) since about 1.5 years ago (for me at least). In the display settings you can pick a scale per monitor and almost all apps will respect it. (It seems some apps with custom toolkits are lagging but I can't remember the last time I ran into one of these).

I've got 4K display for my Linux machine in 2017; Fedora+Gnome+Wayland worked fine at 200% scale back then. That's 4 years. After those 4 years, there are people still trying to make their X11 square peg fit into the HiDPI round hole. X11 is dead. Nobody is going to retrofit HiDPI into it as it is in Wayland. In another 4 years, it is still going to be as annoying as it is today to fix up X11 desktops and apps; maybe…

Been using Ubuntu Mate X11 for five years on two 4k monitors and have to correct posts like this once every few days.

Re: A few HiDPI tricks for Linux

#129

Earlier quoted context omitted.

This also works well on GNOME Wayland (and probably other Wayland compositors) since about 1.5 years ago (for me at least). In the display settings you can pick a scale per monitor and almost all apps will respect it. (It seems some apps with custom toolkits are lagging but I can't remember the last time I ran into one of these).

I've got 4K display for my Linux machine in 2017; Fedora+Gnome+Wayland worked fine at 200% scale back then. That's 4 years. After those 4 years, there are people still trying to make their X11 square peg fit into the HiDPI round hole. X11 is dead. Nobody is going to retrofit HiDPI into it as it is in Wayland. In another 4 years, it is still going to be as annoying as it is today to fix up X11 desktops and apps; maybe…

> worked fine at 200% scale

My X11 setup also works perfectly fine back then, at 200%. Maybe even earlier, 2016 or so.

The caveat is, of course, 200%. Try 150% and it is really a pain in the ass.

Re: A few HiDPI tricks for Linux

#130

I set up Linux on a Dell XPS 13 with the HiDPI screen. With both Ubuntu and Manjaro it was relatively painless, especially using GNOME via Wayland. i3 and sway also worked well too. I had heard a lot of issues with Linux and HiDPI, and was worried I would have to return/swap for a FHD screen, but everything has worked almost flawlessly.

I have used a 4k screen for several years now without any issues on GNOME with 200% scaling. However, I recently bought a ThinkPad T14 with a 1080p screen. With 100% scaling, the fonts and widgets are too small. The ideal scaling seems to be 125% or 150%. GNOME has experimental support for fractional scaling. This works generally ok for Wayland applications, but windows of X11 applications are incredibly blurry both…

Get rid of the 1080, it's 2021.
Post reply on HN