• by commoner on 11/3/2021, 12:46:21 PM

    > With X, all monitors must share the same pix density

    To get proper fractional scaling on X11 with monitors of different pixel densities, you'll want to use either:

    1. GNOME Shell with a patched version of Mutter, which is included by default in Ubuntu[1] and its derivatives (such as Pop!_OS and elementary OS). Manjaro also offers the patched version of Mutter as the mutter-x11-scaling package.[2] You'll need to enable the x11-randr-fractional-scaling experimental feature for any of these distros.[3]

    2. Cinnamon, included by default in Linux Mint

    To get proper fractional scaling on Wayland, you also have two options:

    1. GNOME Shell (no patch needed), with the scale-monitor-framebuffer experimental feature enabled[3]

    2. KDE Plasma, which is still a little bit buggy on Wayland

    [1] https://salsa.debian.org/gnome-team/mutter/-/blob/ubuntu/mas...

    [2] https://github.com/puxplaying/mutter-x11-scaling

    [3] https://www.omgubuntu.co.uk/2019/06/enable-fractional-scalin...

  • by okramcivokram on 11/3/2021, 9:57:33 AM

    It simply works for me. My desktop is on Debian sid, running GNOME 41.0 on Wayland with dual monitor setup 3840×2160 and 1920×1200 on AMD graphics, and everything just works. I did deliberately buy AMD graphics because of the support. Laptop is also on sid, with Intel graphics and 4k display and there absolutely no issues there too. I don't see any blurriness in vscode or any other application that I use. But also, I'm not using a lot of graphical apps. Mostly it's just Firefox, vscode, android-studio, tilda, and sublime-merge.

    [edit] Looks like this: https://imgur.com/a/Zcc031e

  • by yoavm on 11/3/2021, 10:24:04 AM

    You should be able to run VSCode without XWayland using `--enable-features=UseOzonePlatform --ozone-platform=wayland`. HiDPI just works for me. Intel graphics, Sway.

  • by marginalia_nu on 11/3/2021, 10:54:29 AM

    I had relatively little issues with this on Debian on my HP Spectre x360 (2019 model I think)

    Relevant excerpt from my install log

    > Setting global scale to 200-250% in KDE 5 and upping a few fonts seems to fix virtually all HiDPI-issues, except for SDDM and the console framebuffer. You may also want to resize the start bar size, but that is personal preference.

    > For SDDM:

    > Put in /etc/sddm.conf.d/kde_settings.conf

      [X11]
      ServerArguments=-dpi 240
      EnableHiDPI=true

  • by TBurette on 11/3/2021, 10:17:29 AM

    I have a laptop with hidpi (14" 2560x1440) and I gave up : I now use a non-native lower resolution.

    I tried x11, I tried wayland, I tried scaling, I tried fractional scaling, I tried changing default font size. I always ended up with text too small, text too blurry or inconsistencies between applications.

  • by neverminder on 11/3/2021, 10:18:42 AM

    Vanilla Ubuntu 20.04, Gnome, X server, RTX 2070 Super GPU, driver version 495.

    Laptop screen: 17 inch 3840x2160, 200% scaling

    Dual external screens: 27 inch 3840x2160, 150% scaling

    No issues with the above. I only have 4K screens, so I haven't tested this with different resolutions, but at the very least different scaling does work.

  • by thanatos519 on 11/3/2021, 12:53:37 PM

    > With X, all monitors must share the same pix density

    `xrandr` allows different per-output scaling.

    For example if you have a 4k laptop and and 4k monitor that is 50% bigger than the laptop display, X will pretend that the monitor is 5760x3240 and scale down to the actual pixels.

    Having said all that, I dislike scaled anything, so I choose a pixel density between the highest and lowest densities of my physical devices, and manually pick the font size of my terminals.

  • by akdor1154 on 11/3/2021, 12:47:16 PM

    Using PopOS 21.10 (Gnome Wayland), mixed dpi 2x and 1x on intel works pretty ok for wayland native apps. Xwayland stuff renders blurry on the hidpi screen but in practice i dont hit this often at all. Everything is blurry unless you disable shadows though because gnome went and did their own pretty thing without thinking it through.

    Also integer scale is a happy place - wayland still has no real non-integer scale protocol. (See: https://gitlab.freedesktop.org/wayland/wayland-protocols/-/i...)

  • by vbernat on 11/3/2021, 1:35:28 PM

    If you have one screen at 192 dpi, one at 96 dpi, double the resolution of the one at 96 dpi and scale down:

    xrandr --dpi 192 --output eDP-1 --auto --output HDMI-1 --left-of e-DP1 --auto --scale 2

    I don't have my laptop with me, so I am not 100% sure. You can also go the other way, but the result is more blurry.

    Otherwise, as said in another post, apply tips from ArchLinux wiki. I have also put my experience here: https://vincent.bernat.ch/en/blog/2018-4k-hidpi-dual-screen-... (notably if you want something a bit dynamic with a laptop).

  • by christophilus on 11/3/2021, 12:32:45 PM

    I’m running Fedora, and use two monitors, one of which is 5k. No blurriness on Gnome + Wayland. I may have set a flag for Electron … I don’t recall. But I can say it’s not only possible, it’s quite nice. I love Fedora.

  • by thriftwy on 11/3/2021, 9:57:38 AM

    When I were using a TV as an X11 display, I have set a very low DPI setting such as 96, which led to large fonts everywhere which was convenient, and of course they rendered just cool.

  • by jcelerier on 11/3/2021, 10:22:59 AM

       $ cat .Xresources 
       Xft.dpi: 144
       URxvt.font: xft:Anonymice Powerline:style=Regular:size=18
    
    is what I've been using in a no-DE setup on a 4k screen

  • by roca on 11/3/2021, 12:18:02 PM

    I solved this problem in 2016 by buying a 4K laptop (Dell Precision 9550) and a 4K external monitor. Similar pixel density; at 200% scale the pixels on the laptop are a bit small but most apps work well. Most GNOME apps, VSCode, Firefox, Chrome all work with HiDPI out of the box and everything looks great, and this has been true for the last 5 years.

  • by dijit on 11/3/2021, 12:44:22 PM

    For me I avoid running X apps altogether, electron can be told to render in alternative modes which are wayland native; others are using GTK or Qt so those can be told to be wayland native.

    The only application I use which is not wayland native is IntelliJ IDEA.

  • by creshal on 11/3/2021, 9:56:16 AM

    > How do you manage to have a functioning hidpi setup on Linux?

    Pure HiDPI works okay-ish by modifying density settings (blurriness is AFAIK solved in current Electron builds?); mixed setups are still hopeless in my experience.

  • by Scharkenberg on 11/3/2021, 12:44:51 PM

    My work machine has three monitors with different resolutions, different ideal scaling levels, and different refresh rates. The main one is also HDR-enabled. I completely gave up on getting Linux to work properly on that setup and settled on Windows 11 + WSL2 when needed.

    On the laptop I am writing from right now I multi-boot a couple of Linux distros and Windows 11. My preferred scaling level is 125% on Windows and it generally works great, but I stick to 100% on Linux because fractional scaling is still imperfect (yes, sadly even on Wayland).

  • by PaywallBuster on 11/3/2021, 9:46:59 AM

    Some applications (chrome or firefox) have some CLI options for improved HIDPI

    For most other applications, finding a resolution which you can run HIDPI at 2x (fractional scaling didn't look good)

  • by blablabla123 on 11/3/2021, 1:14:22 PM

    XFCE works quite well, also I found this guide really helpful:

    https://wiki.archlinux.org/title/HiDPI

    So in case you consider XFCE, also GTK and other frameworks need to be configured. With closed-source Nvidia drivers the configuration options with Xrandr are limited though IIRC.

  • by adrian_b on 11/3/2021, 10:26:40 AM

    I do not think I understand which is exactly your problem.

    I use monitors with different sizes and I am not aware of a way to specify in Linux a scale factor for each monitor, so if I move a window from a larger monitor to a smaller monitor, then the window, including its text, will become smaller (or possibly greater, if the second monitor has a much lower resolution), the ratio in sizes depending on both the ratio between the physical sizes and the ratio between the resolutions.

    If the monitors would have very different resolutions and/or sizes, then there is no doubt that the setup would become difficult to use, unless you use some applications that you always open on a certain monitor and then you do not move them to other monitors, so you can select in the application preferences a font size and a window size appropriate for that monitor.

    What I do not understand, is your reference to a blurry rendering, because the application window should be rendered in the same way on any monitor, which would lead to different text sizes, but not to differences in blurriness.

    I have been using HiDPI displays in Linux for 6 or 7 years, without any problems and I also do not understand what is meant when people talk about "scaling", this might be something specific to Gnome or KDE, which I do not use. In any case "scaling" (as in Windows) sounds like something that should be strictly avoided. The fonts must be rendered for the right number of dots per font size, they must not be scaled from renderings for other DPIs (which would indeed cause blurriness).

    In XFCE, you have one global setting for fonts "Custom DPI setting", which, together with the settings for anti-aliasing and hinting, determines how all the typefaces will be rendered.

    After setting an appropriate high value for DPI and choosing in your applications adequate font sizes, there are no blurriness problems whatsoever, if you take care to use decent typefaces. The default typefaces in most Linux distributions are seldom good, but there are many excellent typefaces, both free and commercial.

    The only programs with which I ever had problems on HiDPI in Linux are those written in Java, which very frequently lack any options for changing the font used by the program, which I consider to be a capital sin for any GUI program. Moreover, for many Java programs, the installers that use a GUI crash and die on monitors with more than 8 bit per pixel. In my experience Java is always the farthest from its claim of "write once, run everywhere".

  • by mithusingh32 on 11/3/2021, 12:42:33 PM

    I've tried Ubuntu, fedora and regolith-linux

    Regolith-linux was the easiest to set up for hdpi and best solution for me. Fedora used to be decent but the fractional scaling just doesn't work.

  • by JoshTriplett on 11/3/2021, 10:27:40 AM

    Current versions of VSCode support running under Wayland, though they don't do so by default.

    I would suggest running under Wayland, and making all apps use Wayland natively.