Hacker News new | past | comments | ask | show | jobs | submit login

Wayland supports it quite well but any app that uses the legacy XWayland compatibility layer does not work. Which is basically everything using Electron.

It's not a fault of Wayland but it is reflective of the whole Linux laptop experience.




It doesn't even require multi dpi. High dpi with XWayland is simply Broken in every compositor today: you have to choose between not scaling you Wayland windows and accepting super pixelated X windows (due to applying bitmap based scaling that almost no one would want with no option to disable it).

KDE's upcoming release in October should hopefully be addressing this by allowing you to disable the bitmap-based scaling.


If it's using a recent build of Electron you can in fact use proper Wayland. Electron supports it, if something doesn't; they're on an old version.

Even sharing with the help of various 'portals', e.g. xdg-desktop-portal-gnome or xdg-desktop-portal-wlr

It 'simply' takes some arguments at runtime. Below are what I use -- taken from my Sway 'start on login' script [some is superfluous]:

    ElectronThingHere --silent --enable-gpu --use-gl=egl --enable-features='VaapiVideoDecoder,VaapiVideoEncoder,WebRTCPipeWireCapturer,UseOzonePlatform' --ozone-platform=wayland
You'll find they're basically identical to what you'd use to enable/force Wayland on Chrome. Also VAAPI {en,de}coding and pipewire based sharing

You can also replace --ozone-platform=wayland with --ozone-platform-hint=auto for less strong-handed encouragement

I use quite a few different Electron-driven things on Wayland. Discord is the only one seemingly refusing to update their Electron base... and getting free Wayland support

If not for them I'd remove XWayland support entirely from my Sway configuration


Well, it took a long time for all Windows programs to work somewhat decently, and even now the OS still does not have great multi-DPI support.

For example when I move my mouse from my 192 DPI screen to my 96 DPI screen, the mouse position translates in physical pixel, not in physical location. So at the bottom it matches but near the middle of the 192 DPI screen it stops going to the left (it already ends up on the top of the 96 DPI screen going from the middle of the 192 DPI screen) and becomes an 'invisible wall'. Even in Windows 11 they didn't bother to fix this :(

The only OS that had a good transition to multi-DPI capabilities was macOS and that's really because Apple doesn't care about legacy and forces app devs to update their stuff. But it's not just Linux that's having a hard time with this.

But I didn't know this was a specific problem. I'm not using Wayland yet and won't for the foreseeable future. I'm on FreeBSD and KDE on Wayland has been broken a long time. When I hear this it sounds like a good decision anyway :)


Windows' HiDPI does have some glitches (like the mouse positioning thing), but most apps work seamlessly (including browsers, Electron, and IDEs) or reasonably well (Microsoft Office). Also, Windows supports any scaling level, whereas macOS only supports 100% and 200%, which makes it easier to mask any sort of issues or bugs (pixel-doubling looks less blurry than scaling things up by 125%). Many (most?) 13-15 inch Windows laptops ship with a 1080p screen, which works best with a 150%-125% scale.


MacOS supports intermediary DPIs, it has multiple "looks like resolutions". You may have to press ALT while clicking "scaled". But you can't (easily?) set any arbitrary scaling, like 123%. You can on Windows, but it recommends against it. And I've noticed that most apps work fine at 150%, but many feel weird at 125% (which is also "standard").

The Windows mouse thing has been somewhat fixed in Win11 22H2, where you can now even move your mouse to the side "above" the other screen and it will still move there.

As for apps working seamlessly, I'm really not convinced. Not even the taskbar works well. If you change the DPI while it's running, the taskbar icons become blurry. The initial start menu (on first click) adapts fine, but then if you start typing to search something, the results are a blurry mess. Edge has weird artefacts in the tab animation after a DPI change, where half of the icon moves at a different speed. IntelliJ has funny fonts, with some of them huge, others tiny.

To me, the killer feature of MacOS when it comes to multi-DPI setups is that it remembers the per-screen-per-setup DPI. In my case, my PC has a 14" 1920x1080 screen. When I use it alone, it's much closer than with an external screen. I like it in 100% mode. When I plug in the screen, a 32" 4k, they're both much further away. They have roughly the same DPI (by design - I mostly use Linux) so there's no "matching" to do, but I'd like both of them to be at say 125%. Tough luck. If I change the laptop's screen to 125% while the external screen is plugged in, it will stay at 125% when on its own, too. MacOS would remember that with this screen it's 125%, alone it's 100.


> MacOS supports intermediary DPIs, it has multiple "looks like resolutions". You may have to press ALT while clicking "scaled".

The “looks like resolutions” work by setting your screen to the resolution it claims to be multiplied by two, and then downsampling the image to your native size. Depending on the resolutions involved, the screen might feel a bit blurry. On Windows, setting an intermediary scale changes the way the UI is drawn, while keeping your native resolution.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: