High DPI update

I’d like to share a brief update regarding the state of high DPI support. Since getting a laptop with a 4K screen, I’ve found all sorts of subtle papercuts and have been doing my best to fix them or at least file bug reports. Here’s what’s been fixed recently:

Fixed recently

…And the work continues! Here are the bugs next on my list to investigate and try to fix:

Next up

A lot of the above issues are sort of stretch goals for me as each one requires a great deal of learning before I can even begin to try to put together a halfway-intelligent fix. So feel free to help out if you find this work useful and have relevant skills!

46 thoughts on “High DPI update

  1. Here’s one of those things that I’ll never understand: how FOSS developers can stay apolitical when they know full well that proprietary technology can only result in a cyberpunk dystopia…

    Preach, damn it, preach! Stop pretending that tracking and proprietary software are A-OK! Look at what F-Droid does:

    They even go as far as to mark anonymous telemetry as an anti-feature unless it’s opt-in, even in FOSS applications like Firefox. For this reason alone, I have more respect for them than for all Linux distributions (except the FSF-approved ones) and app stores combined.

    So please break the mold and integrate an anti-feature tracker into Discover!

    Like

  2. Thanks for the hard work! Recently switched to Manjaro+Plasma from Win10 and high DPI definitely was one of the problem areas. Other parts are much better than Windows, so I am a happy new user.

    Liked by 1 person

  3. Thanks for this. One of the main reasons I moved to KDE a few years back was for the fractional scaling support, but even then it’s been a bit hit-and-miss. Glad to see things are being rectified! Cheers.

    Like

  4. I’m so glad that you had to switch your laptop and got a 4K screen. Do you use fractional scaling (at least for testing)?

    Like

    1. Indeed; I’m using 250% scale on my 4K screen, which is the equivalent of 125% on a 1080p screen. To be honest, I kind of wish I had gotten the 1440p screen option instead, as this would have allowed me to use a nice even 200% and not deal with fractional scaling glitches. I guess now I just need to fix them. 🙂

      Longer version:

      After believing for years that 1080p and 4k were fine for 13″ – 15.6″ screens, I’ve changed my mind. I think these resolutions only really make sense for a 17″ laptop screen, and for the smaller sizes, 1440p is what hardware makers should be selling. 1366×768 results in everything being roughly the correct physical size, but it’s too low-resolution to look good, and most of these panels are garbage nowadays, so I think the better approach is 1440p which is double the size and allows using a 200% scale factor. So you get high resolution which makes everything look nice and crisp, and everything on screen is roughly the correct physical size. Also it’s not as power hungry as 4k so your battery life shouldn’t suffer as much. And of course even better would be a 1600p size for those with the wisdom to ship 16:10 screens. 🙂

      However until all the manufacturers get religion, we’re probably going to have to support fractional scaling to make sure that people with small 1080p and 4K screens have a good visual experience and don’t have to squint at everything on the screen.

      See https://phabricator.kde.org/T13158

      Like

      1. Dell had some XPS 13 models with 3200×1800 screen (equivalent to 1600×900) and it looked great with a scale factor of 2. Too bad they went for 4K on 13-inch models later.

        Like

      2. Interesting, I own an 14″ X1 with 1440p but a 2.0 scaling makes elements appear way too big for me. Thus I use 1.5 scaling.

        Like

      3. I’m curious what size screen do you have because 200% scaling on 1440p is way too big for a 14” and 15” screen. Also going 4K on bigger sizes will still require fractional scaling for most people, take some of the the most popular sizes 27″ and 32″, on 27 4K a 200% is way too big, but at 150% you have the same working resolution of 1440p but with way higher pixel density, on 32 4K again 200% is too big, 175% is about right.

        Thanks for all your efforts, they are very much appreciated.

        Like

  5. I notice lots of issues are mentioned for X11 specifically, and none for Wayland. Is this because you’re concentrating on testing X11 first, or is Wayland actually working much better for HiDPI?

    Like

    1. Both. I’m still using X11 for various reasons, but also the Wayland session does indeed work much better overall for HiDPI. I’m planning to move to Wayland full-time as soon as the last few irritating bugs affecting my workflows get fixed.

      Like

  6. Ca I please recommend a papercut ? Here goes: Deleting something in Dolphin, requires refreshing to recalculate available space ( in right corner, down). However, this function is missing. So the only option is to exit , and go back into the folder…Simple, but unpleasant 😀

    Like

  7. Honestly, if I would have known that this is the reason for the state of HiDPI support, I would be happy to support you for buying a machine years ago.

    What about mixed-dpi support? Wayland apps are good, but X11 apps under Wayland are very blurry (I call it unusable and use X11, which I am happy with, except of annoying way of having to run either xrandr and have slightly blurry fonts or have to login-logout with changed dpi settings). There are patches proposed by Roman Gilg pending for years now, that should fix the issue.

    At least, would it be possible to change DPI under X11 without re-logging into the environment? So if one switches to an external screen without the internal active, then it can switch to low-dpi, and vice versa? Similarly to what Gnome X11 does currently.

    Like

    1. AFAIK the blurry XWayland high DPI apps is something that’s either already been fixed, or is being fixed soon.

      Mixed DPI in X11 is not supported and making it work properly is quite challenging. My current approach is to make Qt scaling work properly in Plasma on X11 to improve the HiDPI use case for non-mixed DPI screens, but unfortunately it makes things worse for the mixed DPI use case and will make it harder to get that working on X11. In the end, probably the real solution for mixed DPI will be Wayland.

      Switching DPI on the fly based on which screen is plugged in should already work if you use the “Save displays’ properties for on;y this specific display arrangement” setting in the KScreen KCM. If that’s not working, it’s a bug and I would encourage you to report it on https://bugs.kde.org to KScreen | Common.

      Like

      1. Oh wow, XWayland would be so great! Does this fix also fixes it for fractional scaling (150% on my X1 Carbon)?

        To be more precise: I don’t know for other users, but I don’t care much about simultaneously having multiple different DPI screens active. What I care about is docking the machine and removing it from being docked without too much additional effort.

        I’m by far not an expert in Linux desktop GUI, but for the mixed-dpi X11 (also maybe for XWayland): wouldn’t it work to start one instance of X for each DPI, kind of what optirun does when running apps on Nvidia GPUs. Then apps could be launched with DPI matching the highest DPI screen currently active. It would not be the nicest solution, but it would be so much more usable for docking.

        On X11, it is not a problem of remembering the choice. The problem is switching: one has to log out and restart the session. It would be nice if it can just switch the scaling for newly scaled apps, and keep the already running apps as they are. It would be not an ideal solution but would be much less painful than now. As far as I know, there is also a Xorg message that most of the GTK apps (Chrome, PyCharm, etc) support for rescaling the DPI on the fly (only works for integer scaling tough). For QT programs I don’t think it is an issue, as they run already very well on Wayland.

        Thanks a lot for your work!

        Like

        1. If Gnome can do it, it is certainly possible to do it (imperfectly) without Xwayland modifications. It might not change the DPI when moved to another screen (except with int scaling and apps that can handle it), but that’s much better than the current unusable state.

          Like

          1. See comment 29 on the bug report. The current status is that by default, GNOME does not allow either multiple monitors with different DPI or fractional scaling. If you turn on that experimental feature, it’s then no different from other Wayland compositors (as long as there is a HiDPI monitor that requires scaling).

            Possible solutions (or rather workarounds) are discussed in the bug report. My understanding is that KWin devs would instead prefer XWayland changes that benefit all Wayland compositors, not just some hacks in KWin.

            Like

  8. https://www.phoronix.com/forums/forum/software/distributions/1192382-mx-linux-kde-plasma-review

    MX Linux KDE Review on Phoronix (yes MX Linux Makes KDE version!):

    In lieu of MX Linux KDE Plasma version here is the honest review from the perspective of KDE GURU:

    I’m a KDE user and long time Fedora, Debian and now Arch user. I ate my teeth on KDE and Plasma and I am 120% sure you are going to fuck up up KDE respin. You don’t know a shit about KDE.

    Plasma is not GTK and you do not have idea about KDE applications, what libraries they use, what libraries are used and what for; what you should install to make KDE usable in terms of them and you are going to impose bunch of inferior crap while superior applications, databases, modules and libraries are already in KDE and KDE Software Compilations. Users are going to end up with half arsed KDE with half of GTK shit, that has absolutely no place in KDE. You know a squat. I haven’t even tried your ISO, but guess users do not have KDE PIM in your respin, but a POS Mozilla side project that has no place in KDE, where it has nterprise graded PIM. GTK POS instead of Enterprise graded PIM.

    You don’t have libraries to display video thumbs in Dolphin; you install GTK apps because you are missing important libraries to display graphics format and you don’t know what to install and from where (jpg, jpeg2000/jp2, jpeg arithmetical coding, jpeg floating point, webp, avif). I haven’t even tried your beta respin and I already know you can’t display thumbs of videos and those graphic formats in Dolphin and you don’t know what to do to display thumbs in Dolphin, not to mention you think its Gwenview rendering them and since Gwenview doesn’t display them you install GTK app and pollute whole Qt Plasma with GTK POS instead. And you can’t figure what is going on. Why? Because you know a shit about KDE.

    And none of your precious ISOs can render videos via VAAPi (yes 99% of laptops are Intel). But I guess you don’t know that VLC is coded on Windows and for Windows. You never heard of Suse Open Build System, because you associate OBS with something else (you know I’m talking about Smplayer and mpv to play Youtube via VAAPi don’t you? I guess not! Not to mention missing graphics memory management library).

    You know I am not even going to bother with your ISO download, I already know I am going to end up with bunch of Terminals and dot folders and dot files in Home folder with bunch of bloatware from GTK world, that absolutely has no place in Qt/Plasma world. You don’t even know what has to be back-ported to Debian 10.4 from Plasma LTS. I bet you don’t even know that such thing as Plasma LTS exist and Debian 10.4 doesn’t have it.

    All in all users are going to end up with half arsed KDE experience with inferior Mozilla side project, while never discovering enterprise grade KDE PIM. They end up with dark themes hard-coded that cannot be reverted, useless, non working GTK/Mutter apps in the Qt world, because you don’t know software and libraries from KDE. And your POS GTK apps will not work anyway (like graphic files will not be displayed, video thumbs will be missed). Moreover you are going to pollute settings with bunch of useless crap from GTK having separate setting for them, while plasma has already amazing settings.

    I bet you will even have VB shit installed by default to make “these youtubers happy” and system startup will end with bunch of popup errors, not to mention you will make it look like a “mac” and “windows” with these “combined” launcher/app swithcher, so we will not know which is running and which is shortcut. They will be indistinguishable and we will no know which is which and we will have to click multiple times (like in Mutter/GNOME3) to switch between open windows/apps. Yes but users will be happy – it will look like MAC and Windows. Yay!!! Hurrray!

    Then you will put the whole panel to the side making vertical, completely unusable POS. Awesome! Now you differentiated yourself. Yay! Hurray! Moreover you will substitute Kick-off menu with Windows 95 style POS. More Yay! Huuuurrrraaay! Look what we’ve done! We are different!

    Moreover, I haven’t even tried, but I already know you don’t know about services and that voids any firewall useless (I am 200% sure when you reboot your system it will not run at all). You will pollute menus and whats not with fake (g)ufw which does not start (openRC) and there will be nothing in plasma firewall menu in network WiFi menu in the tray to chose the default firewall zone (I bet you don’t even know what I am talking about -zones in plasma WiFi plasmoid in the tay – what the fuck is this dude taking about ?!).

    Yeah, stick to this frame skipping Mutter/GTK3/Xfce POS of yours with bunch of bloatware on top and another conky shit on desktop! Yay! Hurray! Look how awsesome we are! Don’t you forget: Conky! And give us 10 terminals with bunch of bloatware within on startup! Awesome. Bluerrrghh!

    And don’t you forget to install avahi/zeroconf and SSH server and client!! We need those for security. Don’t you dare to forget them!! 100% users need them! And java, yes java iced tea!

    To further fuck-up Plasma experience and pollute it with shit I bet you will bring kvantum and qt5ctl to the plasma because you will try to differentiate yourself and don’t know a squat about making KDE Global Themes. Hey you can also pollute plasma with Plank/Apple Style POS because you don’t know how to create and use app shortcuts (eg. Meta+F for File Manager or Meta+B for Web Browser) or how to use Krunner. And even then you will pollute the panel with bunch of unnecessary app shortuts (GTK shit incl. Xfce doesn’t have Krunner, so why would you know you don’t need app shortcuts on the panel at all).

    And since you don’t know which version of Plasma has working SDDM (Debian 10.4 doesn’t) you are going to substitute it for another non fitting, non-KDE module. Awesome KDE experience awesome! Buuueeerrrllgh!

    Like

    1. Ugh, I hate that one! I’ve managed to find a combination of scale factor (250%) and font (11pt Hack) that makes the lines not appear for me. IIRC it was the same for 11pt Hack with 125% scaling on a 1080p display.

      Like

      1. Edit the shortcut and put QT_SCREEN_SCALE_FACTOR=1 in front of the konsole command. For me, it works perfectly afterward (without noticing any scaling difference, just no lines), although mine is 150%, not sure for 2x.

        Like

        1. That causes the app to not use Qt scaling and fall back to only increasing the size of the UI elements according to the font DPI value. This results in icons and other non-font-size-based UI elements being too small.

          This is what Plasma currently does instead of using Qt scaling and we get a ton of complaints about it. See https://bugs.kde.org/show_bug.cgi?id=356446

          Like

          1. True, the icons will be small. In my opinion, this is a cheap price to pay for making the lines disappear, considering that it is Konosle, where moving around in menus with the mouse is not the main way of using it. I’m not saying it is not a bug but just suggesting a way of making it usable in the meantime.

            Like

    1. A lot of that stuff is unnecessary or harmful in recent Plasma versions. GDK_SCALE is now automatically set but only accept integer values, so setting it to a fractional value will produce undefined results. QT_AUTO_SCREEN_SCALE_FACTOR is unnecessary and will conflict with the value set by using the scale slider.

      I don’t have any problems with Firefox and Thunderbird using the wrong scale when I simply use the slider. They look perfect. The only manual things that are still needed are to sync the DPI to SDDM (I would like to have this done automatically if possible) and to set PLASMA_USE_QT_SCALING=1 so that Plasma uses the Qt scale factor properly. I’m working on that one. 🙂

      Like

      1. This is hilarious! I just tried that script this afternoon on the Manjaro KDE build on my Surface Pro 4. The script. You’re right, Nate. Most of the stuff didn’t work properly (like SDDM scaling) or caused GTK apps, like Firefox and Opera, to display huge fonts and icons. The author of the script had good intentions, but most of the issues the script tries to fix are handled better by Plasma’s built in fractional scaling.

        I did notice that adding “ServerArguments=-nolisten tcp -dpi 192” (without the quotes) to the [X11] section of the /etc/sddm.conf file does a better job of scaling SDDM than other solutions I tried in the past. This also fixed some weird scaling issues I had in non-QT/non-GTK apps. The splash screen for MATLAB wouldn’t work in KDE Plasma until I added this. It also made OpenRocket a little more bearable.

        Like

        1. There’s a built-in method to sync your settings to SDDM that does that for you, no need to edit a config file by hand anymore! 🙂 Check out System Settings > Startup and Shutdown > Login Screen > Advanced > Sync.

          Like

      2. Curious, I recall that in some earlier version QT_AUTO_SCREEN_SCALE_FACTOR was essential to make mixed-HiDPI to at least somehow work.

        Where can I read more about relation between QT_AUTO_SCREEN_SCALE_FACTOR (though it’s deprecated since Qt 5.14), QT_ENABLE_HIGHDPI_SCALING and PLASMA_USE_QT_SCALING?

        Especially, what is better to set in which KDE version.

        Like

        1. Mixed DPI on X11 is not something we explicitly support so you’re always going to be banging your head against unavoidable problems until we put some engineering effort into it. For the moment Wayland is probably your best bet.

          Like

  9. Thank you Nate! When I decided to change the icon for a .desktop file on my Surface Pro 4’s HiDPI screen and saw that the icons weren’t tiny and clipped anymore, I almost cried tears of joy! I’ve been dealing with the HiDPI paper cuts in Plasma for over two years! Had I known that all it took to fix the problems was you getting a HiDPI display, I would have sent you one two years ago! This is the best news I’ve read and witnessed on the Plasma desktop in a very long time! Now if we could just get a full featured (and reliable) virtual keyboard, my digital life would be complete!

    Liked by 1 person

  10. Hi.

    Is this possible to disable behaviour of task manager to raise above everything when apps demand attention? This is annoying to focus every time it does that.
    I’d really like to disable this urgency indication. These things never urgent enough, only distracting.

    Like

  11. I can’t wait for Plasma 5.20 to be released, adjusting the size of the icons based on the panel is really welcome, I’ve always asked myself the reason for the current behavior.

    Like

Leave a comment

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s