Bug 469830 - High-DPI Fractional Scaling nonfunctional on KDE Plasma + Wayland
Summary: High-DPI Fractional Scaling nonfunctional on KDE Plasma + Wayland
Status: RESOLVED LATER
Alias: None
Product: krita
Classification: Applications
Component: Usability (show other bugs)
Version: git master (please specify the git hash!)
Platform: Arch Linux Linux
: NOR normal
Target Milestone: ---
Assignee: Krita Bugs
URL:
Keywords: wayland-only
Depends on:
Blocks:
 
Reported: 2023-05-16 01:52 UTC by Swiftloke
Modified: 2024-08-26 07:20 UTC (History)
4 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Swiftloke 2023-05-16 01:52:50 UTC
SUMMARY
***
On both 5.15 and the latest master (tested with aab9b91) the "fractional scaling" option is greyed out ([image](https://krita-artists.org/uploads/default/original/3X/9/4/943835869578160c9976a19f37da420dd628b2ce.png)). This causes Kritas UI to appear unusable on KDE Plasma Wayland with fractional scaling (I use 235% scaling on a 14" 4K screen) ([image](https://krita-artists.org/uploads/default/original/3X/6/4/64d66ec8a51f08095f6717e24b85e8a00aa1714e.png)).

I did some digging through the source code to figure out what's going on. On 5.15, the fractional scaling option is not present at all, but a [recent change](https://invent.kde.org/graphics/krita/-/commit/c59a6ce21e6a60fd351386b024c90c80b52146f6) makes it so that the option is now present, but greyed out. This is a welcome change, making it more clear that the option is not available, but doesn't fix the problem.

The option is gated behind ``#ifdef``s with [this](https://invent.kde.org/graphics/krita/-/blob/master/CMakeLists.txt#L472) CMake test. One can see that the option is gated behind this in the commit I show above, and the actual enabling of fractional scaling is [similarly gated](https://invent.kde.org/graphics/krita/-/blob/c59a6ce21e6a60fd351386b024c90c80b52146f6/krita/main.cc#L255) in main.cc. 

CMake reports that this test passes on my local build:
```
-- Performing Test HAVE_HIGH_DPI_SCALE_FACTOR_ROUNDING_POLICY
-- Performing Test HAVE_HIGH_DPI_SCALE_FACTOR_ROUNDING_POLICY - Success
```
However, the option still is greyed out and does not function.

After digging that far into this, the folks on IRC suggested I file a bug report here, to which I am obliging. I have some extra time this week, so I'm happy to help wherever possible.

***


STEPS TO REPRODUCE
1. Boot Krita on KDE Plasma Wayland with fractional scaling enabled.
2. Attempt to enable fractional scaling in Settings -> Configure Krita -> Window 

OBSERVED RESULT
Fractional scaling should be an available option, and should work as intended.

EXPECTED RESULT
Fractional scaling option is greyed out and cannot be enabled

SOFTWARE/OS VERSIONS
Linux/KDE Plasma:
(available in About System)
KDE Plasma Version: 5.27.5
KDE Frameworks Version: 5.105.0
Qt Version: 5.15.9

ADDITIONAL INFORMATION
Graphics Platform: Wayland
Comment 1 ENisse 2024-01-12 10:26:39 UTC
Encountered and reproduced this bug as described with scaling unavailable. 
Starting Krita with " QT_SCALE_FACTOR 1.5 krita " improves usability but not greatly.
Maybe toolbars and dockers in general should be customizable like the toolbox docker is now.
Comment 2 That One Seong 2024-08-26 02:05:59 UTC
For what it's worth, I can reproduce this.
With the fractional scaling option set in KDE Plasma 6.1.3's Display Settings to 150%, under X11 the scaling is automatic. But under Wayland (whether launched normally or with `WAYLAND_DISPLAY= krita` to force XWayland, assuming Krita even has a native Wayland implem), Krita's scale is always 100%, even with "Enable HiDPI Support" enabled in the settings. I have to now explicitly prepend `QT_SCREEN_SCALE_FACTORS=1.5` (or whatever my desktop happens to be using at the time) to get the same effect under Wayland.
Comment 3 Halla Rempt 2024-08-26 07:20:25 UTC
Krita doesn't support native wayland at this point. If fractional scaling doesn't work with xwayland, it's more likely to be a bug or limitation in xwayland, since that should function like native x11.

Wayland support is something that will come, but don't expect it for quite some time, and don't expect wayland to be a good platform for applications like Krita: for instance, it's ideas about color management are completely bonkers.