Bug 138520 - Toolbars and page too small with Wayland fractional scaling and Qt5 plugin
Summary: Toolbars and page too small with Wayland fractional scaling and Qt5 plugin
Status: RESOLVED DUPLICATE of bug 142882
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: graphics stack (show other bugs)
(earliest affected)
Hardware: x86-64 (AMD64) Linux (All)
: medium normal
Assignee: Not Assigned
Depends on:
Blocks: Wayland KDE
  Show dependency treegraph
Reported: 2020-11-27 05:50 UTC by Matthew Trescott
Modified: 2021-11-13 18:38 UTC (History)
4 users (show)

See Also:
Crash report or crash signature:

Screenshot showing the dialog widget size problem (202.93 KB, image/png)
2020-11-27 05:50 UTC, Matthew Trescott
Screenshot that shows the problem in normal (non-dialog) widgets (127.32 KB, image/png)
2020-11-27 05:56 UTC, Matthew Trescott

Note You need to log in before you can comment on or make changes to this bug.
Description Matthew Trescott 2020-11-27 05:50:48 UTC
Created attachment 167604 [details]
Screenshot showing the dialog widget size problem

LibreOffice UI displays with UI components and text at approximately the same size as other programs, to match the screen scaling configuration.

The top drop-down menu is scaled properly, while the other LibreOffice components are displayed as though the screen were much larger and had a lower pixel density. Also, dialog windows are the expected size, but their contents are shrunken to the upper left-hand corner.

1. Select a fractional scaling factor (such as 1.25) in Plasma System Settings.
2. Log out/log back in, using Wayland.
3. Start LibreOffice

I've attached a screenshot showing the scaling problem with the Options dialog. The incorrect scaling of the main UI is less noticeable, so I'll attach another screenshot after submitting this report. Note that the display is actually 1920x1080, even though the screenshot was scaled down.

Operating System:     openSUSE Tumbleweed
OpenGL Drivers:       Mesa 20.2.2/Intel HD Graphics 620
Qt Version:           5.15.1
LibreOffice Version:  7.1.0-beta (official development RPMs) and (openSUSE packages)

There are no relevant messages when running LibreOffice in the console. I have tried different options such as "Force font DPI" (in Plasma System Settings) without any effect. I'd be happy to provide any other information that might be useful, such as the values of relevant environment variables, if needed. Thanks!
Comment 1 Matthew Trescott 2020-11-27 05:56:43 UTC
Created attachment 167605 [details]
Screenshot that shows the problem in normal (non-dialog) widgets

It appears from this screenshot that UI components that are drawn directly with QWidgets are scaled correctly, while ones drawn QPainter are not. However, this is only a shakey guess because I don't know anything about the code and am only going off of the information in #130857 and #125943 with the assumption that the drop-down menus are now drawn natively with QWidgets.
Comment 2 whyhollis+aibei 2021-04-19 11:43:15 UTC
I'm facing the same issue under plasma 5.21.4, libreoffice, Arch Linux, wayland, display scale set to 135%. The text and icons are too small that libreoffice is unusable.

It is pretty confident that this issue is caused by vcl component [0] in libreoffice. If environment variable SAL_USE_VCLPLUGIN is set to gtk3, this would force VCL to use gtk for the UI. Somehow gtk supports fractional HiDPI (?) and the gui does not suffer from blurry rendering. This have some shortcomings:

1. It's GTK. Feels alien in KDE
2. This does not register toolbar to KDE's global menu

Another solution would be setting environment variable SAL_FORCEDPI. It seems that this options force VCL to render larger text. Setting it to 170 works for me. Writing the following script in ~/.config/plasma-workspace/env/libreoffice.sh and re-login make the force dpi patch permanent after re-login:

export SAL_FORCEDPI=170

Here are environment variables for controlling VCL if you're interested: https://github.com/LibreOffice/core/blob/master/vcl/README.vars

[0]: What is VCL TL;DR explained in arch wiki, https://wiki.archlinux.org/index.php/LibreOffice#Theme
Comment 3 Michael Weghorn 2021-06-23 10:17:24 UTC
That sounds like tdf#142882, tdf#137924 and tdf#137924.

*** This bug has been marked as a duplicate of bug 142882 ***
Comment 4 Brad 2021-11-13 18:38:03 UTC Comment hidden (spam)