Bug 159915 - LibreOffice scaled incorrectly when running with KF6 or Qt6 VCL on Wayland
Summary: LibreOffice scaled incorrectly when running with KF6 or Qt6 VCL on Wayland
Status: VERIFIED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: graphics stack (show other bugs)
Version:
(earliest affected)
24.2.0.3 release
Hardware: All All
: medium normal
Assignee: Michael Weghorn
URL:
Whiteboard: target:24.8.0 target:24.2.2.2 target:...
Keywords:
: 160083 160103 160113 160217 160268 160284 (view as bug list)
Depends on:
Blocks: Qt6
  Show dependency treegraph
 
Reported: 2024-02-26 23:07 UTC by Mike Lothian
Modified: 2024-07-12 13:37 UTC (History)
11 users (show)

See Also:
Crash report or crash signature:


Attachments
Screenshot (220.33 KB, image/jpeg)
2024-02-26 23:07 UTC, Mike Lothian
Details
Screenshot (140.59 KB, image/jpeg)
2024-02-26 23:07 UTC, Mike Lothian
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Mike Lothian 2024-02-26 23:07:35 UTC
Created attachment 192806 [details]
Screenshot

When LibreOffice is built with Qt6 VCL and running on Plasma 6 things are scaled to big
Comment 1 Mike Lothian 2024-02-26 23:07:52 UTC
Created attachment 192807 [details]
Screenshot
Comment 2 Mike Lothian 2024-02-28 15:21:14 UTC
This happens with both the KF6 and the Qt6 VCLs

Version: 24.2.1.2 (X86_64) / LibreOffice Community
Build ID: 420(Build:2)
CPU threads: 16; OS: Linux 6.8; UI render: default; VCL: qt6 (cairo+wayland)
Locale: en-GB (en_GB.UTF-8); UI: en-GB
Gentoo official package
Calc: threaded

Version: 24.2.1.2 (X86_64) / LibreOffice Community
Build ID: 420(Build:2)
CPU threads: 16; OS: Linux 6.8; UI render: default; VCL: kf6 (cairo+wayland)
Locale: en-GB (en_GB.UTF-8); UI: en-GB
Gentoo official package
Calc: threaded
Comment 3 Mike Lothian 2024-03-05 23:46:09 UTC
This is only an issue on Wayland, setting QT_QPA_PLATFORM=xcb works around the issue
Comment 4 Mike Lothian 2024-03-05 23:48:04 UTC
When running with Xwayland QT_QPA_PLATFORM=xcb LibreOffice shows:

Version: 24.2.1.2 (X86_64) / LibreOffice Community
Build ID: 420(Build:2)
CPU threads: 16; OS: Linux 6.8; UI render: default; VCL: kf6 (cairo+xcb)
Locale: en-GB (en_GB.UTF-8); UI: en-GB
Gentoo official package
Calc: threaded
Comment 5 Landgraf132 2024-03-07 18:45:57 UTC
(In reply to Mike Lothian from comment #3)
> This is only an issue on Wayland, setting QT_QPA_PLATFORM=xcb works around
> the issue

On xwayland apps are blinking and completely unusable. The only workaround is to use a variable "SAL_USE_VCLPLUGIN=gtk4"

Operating System: Arch Linux 
KDE Plasma Version: 6.0.1
KDE Frameworks Version: 6.0.0
Qt Version: 6.6.2
Kernel Version: 6.7.8-zen1-1-zen (64-bit)
Graphics Platform: Wayland
Processors: 16 × AMD Ryzen 7 2700X Eight-Core Processor
Memory: 31.3 GiB of RAM
Graphics Processor: NVIDIA GeForce RTX 3060/PCIe/SSE2

Version: 24.2.1.2 (X86_64) / LibreOffice Community
Build ID: 420(Build:2)
CPU threads: 16; OS: Linux 6.7; UI render: default; VCL: kf6 (cairo+wayland)
Locale: ru-RU (en_US.UTF-8); UI: en-US
24.2.1-1
Calc: threaded
Comment 6 Vinu Moses 2024-03-08 10:07:21 UTC
I have the same problem with  KDE6 + Wayland and Display Scale set to 125%.

With the default kf6 backend, LO does not scale proportionately and dialogs are cut off.

Forcing LO to use kf5 with SAL_USE_VCLPLUGIN=kf5 worked for me.

A detailed description of the problem is posted here with pictures:
https://bbs.archlinux.org/viewtopic.php?id=293531
Comment 7 Rafael Lima 2024-03-09 14:42:33 UTC
*** Bug 160083 has been marked as a duplicate of this bug. ***
Comment 8 Rafael Lima 2024-03-09 14:42:54 UTC
*** Bug 160103 has been marked as a duplicate of this bug. ***
Comment 9 Rafael Lima 2024-03-09 14:43:14 UTC
*** Bug 160113 has been marked as a duplicate of this bug. ***
Comment 10 Rafael Lima 2024-03-09 14:44:14 UTC
@Michael, you had done some work with Qt6. Any idea what might be causing this?
Comment 11 johann.hoechtl 2024-03-09 18:34:36 UTC
Endeaverous got version 24.2.1.2 and the issue disappeared.So either it got fixed downstream (which I doubt) or something else happened.
Comment 12 andreas.sturmlechner 2024-03-12 09:50:01 UTC
(In reply to johann.hoechtl from comment #11)
> Endeaverous got version 24.2.1.2 and the issue disappeared.So either it got
> fixed downstream (which I doubt) or something else happened.
Please always check what plugin is in use at runtime via LO's "About" dialog. Arch reverted back to kf5 plugin from what I know.
Comment 13 Mike 2024-03-13 07:35:19 UTC
I had this issue on Manjaro unstable, and recently it was fixed, so yeah, I confirm that Arch reverted it, fixing the problem temporarily.

Version: 24.2.1.2 (X86_64) / LibreOffice Community
Build ID: 420(Build:2)
CPU threads: 16; OS: Linux 6.7; UI render: default; VCL: kf5 (cairo+wayland)
Locale: pl-PL (pl_PL.UTF-8); UI: pl-PL
24.2.1-3
Calc: threaded
Comment 14 Evert 2024-03-13 07:48:14 UTC
Arch is just working around the bug that is very much still there if you use the QT6 plugin by using the QT5 plugin for now.
Comment 15 Michael Weghorn 2024-03-13 11:55:50 UTC
Observations:

* I can reproduce brokenness e.g. with the Help -> About dialog, only part of it is rendered for the bad case.
* Issue can be reproduced with qt6, but not qt5.
* This issue is not specific Plasma 6, but can also be reproduced in a Plasma 5 Wayland session (when forcing the qt6 VCL plugin using SAL_USE_VCLPLUGIN=qt6).
* One screen is enough.
* It happens with fractional scaling set in the KDE system settings ("Display settings"), e.g. setting a scale factor of 150 % for the screen.
* It's not an issue when applying scaling by using the `QT_SCALE_FACTOR=1.5` environment variable instead (which is what I usually use to test scaling without having to change system settings).

Qt 6 changed the default scaling policy from "Round" to "PassThrough" (see [1]), which is related.

Forcing the use of the "Round" policy makes this work again for me with qt6 as well.

Pending Gerrit change:
https://gerrit.libreoffice.org/c/core/+/164768

As mentioned in that change, an alternative workaround is setting the QT_SCALE_FACTOR_ROUNDING_POLICY="Round" environment variable.

@affected users:
Could you please check whether that makes things work as expected for you as well, to make clear whether this is all or there are any additional issues you are running into?


[1] https://doc.qt.io/qt-6/highdpi.html#environment-variable-reference
Comment 16 Michael Weghorn 2024-03-13 12:06:11 UTC
(In reply to Michael Weghorn from comment #15)

> @affected users:
> Could you please check whether that makes things work as expected for you as
> well, to make clear whether this is all or there are any additional issues
> you are running into?

... besides the known issue described in tdf#141578, i.e. when using multiple screens with different scale factors applied, it's still a known issue that scaling is only properly applied on one of them, but single-screen setups or multiple screens with the same scale factor should work fine with the fix or workaround described in comment 15.
Comment 17 Commit Notification 2024-03-13 13:32:03 UTC
Michael Weghorn committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/86abb6fd8a8f680f9fc5ff1db775845c9f4e254b

tdf#159915 qt: Force Qt::HighDpiScaleFactorRoundingPolicy::Round

It will be available in 24.8.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 18 Michael Weghorn 2024-03-13 13:33:30 UTC
Fixed in master.

Cherry-picks for 24-2 and 7-6 pending in Gerrit:
https://gerrit.libreoffice.org/c/core/+/164744
https://gerrit.libreoffice.org/c/core/+/164745
Comment 19 Commit Notification 2024-03-13 16:09:22 UTC
Michael Weghorn committed a patch related to this issue.
It has been pushed to "libreoffice-24-2":

https://git.libreoffice.org/core/commit/7989a04cee3b614d493a5acbd1ff0363596efc00

tdf#159915 qt: Force Qt::HighDpiScaleFactorRoundingPolicy::Round

It will be available in 24.2.3.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 20 Commit Notification 2024-03-13 21:07:08 UTC
Michael Weghorn committed a patch related to this issue.
It has been pushed to "libreoffice-7-6":

https://git.libreoffice.org/core/commit/a64d0da7d09cd27a332060f61a25980131e48a56

tdf#159915 qt: Force Qt::HighDpiScaleFactorRoundingPolicy::Round

It will be available in 7.6.7.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 21 Rafael Lima 2024-03-15 17:37:36 UTC
*** Bug 160217 has been marked as a duplicate of this bug. ***
Comment 22 andreas.sturmlechner 2024-03-19 08:11:46 UTC
*** Bug 160268 has been marked as a duplicate of this bug. ***
Comment 23 Commit Notification 2024-03-19 16:59:57 UTC
Michael Weghorn committed a patch related to this issue.
It has been pushed to "libreoffice-7-6-6":

https://git.libreoffice.org/core/commit/eaf9c8ccb68dfdfb1f509c43ed922f18fa6f5e74

tdf#159915 qt: Force Qt::HighDpiScaleFactorRoundingPolicy::Round

It will be available in 7.6.6.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 24 Xisco Faulí 2024-03-20 11:30:01 UTC
*** Bug 160284 has been marked as a duplicate of this bug. ***
Comment 25 Commit Notification 2024-03-22 18:36:54 UTC
Michael Weghorn committed a patch related to this issue.
It has been pushed to "libreoffice-24-2-2":

https://git.libreoffice.org/core/commit/17fe161389df04b16a4c61bf089a3ce113ea22e7

tdf#159915 qt: Force Qt::HighDpiScaleFactorRoundingPolicy::Round

It will be available in 24.2.2.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 26 Mike 2024-04-01 18:16:05 UTC
I can confirm, that with version 24.2.2.2 the issue is gone.
Comment 27 Michael Weghorn 2024-04-01 20:33:04 UTC
(In reply to Mike from comment #26)
> I can confirm, that with version 24.2.2.2 the issue is gone.

Great, thanks for reporting back!
Comment 28 amanita+LIBREOFFICE 2024-06-25 15:19:28 UTC
I have this issue on Libreoffice 24.4.2.4 Flatpak from Flathub.

Fedora KDE Wayland 125% scaling

not selected cells and icons are very blurry, selected cells are not blurry.

Switching to non-SVG icons ironically reduced the blur.

Forcing XWayland removes this but also prevents fractional scaling.
Comment 29 Michael Weghorn 2024-06-26 04:18:14 UTC
(In reply to amanita+LIBREOFFICE from comment #28)
> I have this issue on Libreoffice 24.4.2.4 Flatpak from Flathub.
> 
> Fedora KDE Wayland 125% scaling
> 
> not selected cells and icons are very blurry, selected cells are not blurry.
> 
> Switching to non-SVG icons ironically reduced the blur.
> 
> Forcing XWayland removes this but also prevents fractional scaling.

Please create a new bug report and give more details (like the exact version information from "Help" -> "About LibreOffice", what distro, a screenshot), and add a link to the new bug report here.