Live data from Hacker News

A few HiDPI tricks for Linux

blog.yossarian.net

131–140 of 192 posts

Re: A few HiDPI tricks for Linux

#131

HPDI support on Linux is terrible. After stuggling to make it work consistently accross various applications on my Dell XPS 13 with HDPI screen, I conciously choose my next laptop to have just HD screen. I am so happy as everything is finally working normally.

Nope, I've had two 4k screens under Ubuntu Mate for five years. It's literally one checkbox in the control panel.

Re: A few HiDPI tricks for Linux

#132

Earlier quoted context omitted.

Like I said, it is something that should be pull requested to the upstream, and if that fails, then fork. The fork is a secondary path to cooperation. If the conclusions are that the platform cannot support cursor acceleration the proper way (i.e. the way all commercial OSes do), the premise of the library is flawed. If not, then it must be the whole OS that's flawed, because that needs to be possible on a desktop sy…

I think "there is only one person working full-time on maintaining Linux input libraries and he's overworked" is probably a decent excuse. I don't know what you plan to do, but I would advise against forking unless you can hire a team to accumulate testing hardware and work on this for multiple years. What we have seen too often is these forks just fizzle and get forgotten, especially if they are only focused on gett…

I’ve heard of tons of these patches people write for libinput, yet they are never in master. There’s nothing in the libinput README or FAQ about how they’re looking for help, and there are quite a few different authors. How is anyone supposed to know help is needed?

Re: A few HiDPI tricks for Linux

#133

Earlier quoted context omitted.

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.

I'm sorry what? I've used Windows 10 scaling and it looks horrible compared to MacOS native 2x HiDPI scaling. The computers are made for HiDPI or not and it looks very natural compared to windows which doesn't scale all elements by the same amount.

I use macOS on a good old 24” 1080p monitor. It’s either “tiny text town” or “blurry shit town”.

Re: A few HiDPI tricks for Linux

#134

Earlier quoted context omitted.

I think "there is only one person working full-time on maintaining Linux input libraries and he's overworked" is probably a decent excuse. I don't know what you plan to do, but I would advise against forking unless you can hire a team to accumulate testing hardware and work on this for multiple years. What we have seen too often is these forks just fizzle and get forgotten, especially if they are only focused on gett…

I’ve heard of tons of these patches people write for libinput, yet they are never in master. There’s nothing in the libinput README or FAQ about how they’re looking for help, and there are quite a few different authors. How is anyone supposed to know help is needed?

well i put it out there, but it was (apparently) very personal. I use zowie mice at 800 dpi and setting gui settings to 0.1 sensitivity (or 1 etc,c whatever is lowest) would result in several desktops worth of movement per mousepad (22 inches), really bad over all. i just wanted a single left-right corresponding with monitor edges which was never a problem across any os until recently which oddly started treating low dpi at 1000 hz really weird

i still got the patches somewhere and will post them soon. it basically let you set mouse speed scaling on a larger scale

Re: A few HiDPI tricks for Linux

#135

Earlier quoted context omitted.

I think "there is only one person working full-time on maintaining Linux input libraries and he's overworked" is probably a decent excuse. I don't know what you plan to do, but I would advise against forking unless you can hire a team to accumulate testing hardware and work on this for multiple years. What we have seen too often is these forks just fizzle and get forgotten, especially if they are only focused on gett…

I’ve heard of tons of these patches people write for libinput, yet they are never in master. There’s nothing in the libinput README or FAQ about how they’re looking for help, and there are quite a few different authors. How is anyone supposed to know help is needed?

This post was going around a while ago, I don't think anything has really changed for the better since then: https://who-t.blogspot.com/2019/10/libinputs-bus-factor-is-1...

Re: A few HiDPI tricks for Linux

#136
Wayland has proper scaling support as a first-class thing, so you just configure it once and forget about it. This includes per-output scaling.

I was actually surprised when using a 2020 Mac that macOS doesn't actually support scaling on external displays. It seems that Linux/Wayland is on the lead here.

Re: A few HiDPI tricks for Linux

#137
post #93

Earlier quoted context omitted.

> This was discussed at length years ago and it was decided that passing a fractional scale value to the client is not what you want, makes the code much more complicated and doesn't really solve the blurriness. From your link: """ > While rendering at rational factor can't be of better quality, it can > however be done at a much higher quality than downscaling, faster and with > less memory usage. Perhaps, but that…

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…

It's not how it works at all for fractional scaling, which is the point. And you don't give it a 133.33 box. That's what you're in effect doing now by having the compositor scale the whole screen. You give it an actual 133px box because since you're working at native resolution apps get snapped to pixel boundaries.

> It actually is much worse for the one that doesn't match, because now you have lost the ability to do pixel-perfect scaling.

I don't know what you mean by this. Pixel perfect scaling is precisely what's not possible right now. If you have a 1.3x screen and a 1.5x screen you can't render 1:1 to any of them. With this you could at least have 1:1 in the 1.5x screen and be pixel perfect there.

Re: A few HiDPI tricks for Linux

#138

Earlier quoted context omitted.

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 causi…

Quite the opposite. Once you push the problem to the client a lot of them already know how to do it and by not doing two scaling steps you can make much better decisions. And you don't need coordinates as floating point at all. What you need to do is tell the app "you have a 150x150 window on which to display content at 1.33x scale, just give me back a buffer with those properties". Wayland can work at integer coordinates all the way. The app also draws at integer coordinates it just uses the scaling factor to know what to do. It can even just replicate the 2x and then scale down solution if it doesn't know how to do anything better but plenty of code does know how to do something better and much faster. Browsers, image viewers, 3D renderers, PDF viewers, are all natively able to scale arbitrarily and yet are forced by wayland to draw at 2x and be scaled down.

Re: A few HiDPI tricks for Linux

#139

Earlier quoted context omitted.

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 causi…

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

Some things will be blurry, but no worse than having the compositor do it. Other things will not be blurry, and that's a huge huge benefit.

> artifacts or error build-up

Integer multiples risk artifacts too, if the program is actually supposed to be rendering in high resolution. Error build-up I'm not sure should be a big worry when you can have 53 bits of precision for a window a couple thousand pixels across.

> As you describe, this is the "easily solved" way

I'm not sure you understood what I meant. I was saying that when possible the compositor should round the window to the nearest pixel, then have the client render at that resolution, so then the compositor would not do any scaling at all.

Re: A few HiDPI tricks for Linux

#140

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…

In my experience with Windows 10, it depends on the app. A lot of apps are blurry. Even some of the ones shipped with the OS, made by Microsoft, not to mention third-party apps. Linux with KDE works better than Windows here[1].

I've also read the opposite opinion about macOS - namely, that it's the platform that does it best. I've ordered my first Mac (mini). It's arriving in 2 weeks. Will see then.

Overall, poor HiDPI support on Windows is one of the main reasons why I decided that I don't want to switch to Windows as my main driver and instead try macOS.

[1]: GNOME on the other hand is terrible. It's possible to get i3 to work with HiDPI, but there's no end to the work you need to perform to do that.

Post reply on HN