Bug 163648 - Wrong scaling on screens with different scaling factor on Wayland
Summary: Wrong scaling on screens with different scaling factor on Wayland
Status: UNCONFIRMED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: graphics stack (show other bugs)
Version:
(earliest affected)
24.8.2.1 release
Hardware: All Linux (All)
: medium normal
Assignee: Not Assigned
URL:
Whiteboard: QA:needsComment
Keywords:
Depends on:
Blocks:
 
Reported: 2024-10-27 16:27 UTC by Oleg
Modified: 2025-08-29 22:46 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments
UI elements have wrong scale on screen with 100% scaling factor (12.59 MB, video/webm)
2024-10-27 16:28 UTC, Oleg
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Oleg 2024-10-27 16:27:38 UTC
Description:
On Wayland with fractional scaling when moving any LibreOffice applications between screens with different scaling factor UI elements are not scaled properly. For example if Writer moved from screen with 125% scaling to screen with 100% scaling UI elements will appear huge. Or vice versa if moving from screen with 100% to screen with 125% UI elements will appear very small.

Steps to Reproduce:
1. Run LibreOffice on Wayland with fractional scaling and kf6 VCL
2. Try to move application window to a screen with different scaling factor

Actual Results:
UI elements would have wrong scaling

Expected Results:
UI elements should be scaled appropriately.


Reproducible: Always


User Profile Reset: No

Additional Info:
Version: 24.8.2.1 (X86_64) / LibreOffice Community
Build ID: d2333ca8202241beded14b8ee9021e67de4c50ce
CPU threads: 8; OS: Linux 6.11; UI render: default; VCL: kf6 (cairo+wayland)
Locale: ru-RU (ru_RU.UTF-8); UI: ru-RU
24.8.2-2.1
Calc: threaded
Comment 1 Oleg 2024-10-27 16:28:22 UTC
Created attachment 197263 [details]
UI elements have wrong scale on screen with 100% scaling factor

Here's the demonstration
Comment 2 Oleg 2025-02-08 12:15:21 UTC
Issue is still there

Version: 25.2.0.3 (X86_64) / LibreOffice Community
Build ID: 520(Build:3)
CPU threads: 16; OS: Linux 6.13; UI render: default; VCL: kf6 (cairo+wayland)
Locale: ru-RU (ru_RU.UTF-8); UI: ru-RU
25.2.0-1
Calc: threaded
Comment 3 Andrew 2025-05-11 05:04:33 UTC
I have a workaround.

TL;DR: "SAL_USE_VCLPLUGIN=gtk3" in your shortcut's "Environment variables"

The bug seems to be in LibreOficce's VCL (Visual Class Library), specifically how it works ("welds") with KDE. I have high confidence in this because the bug is perfectly reproducible even with the minimal "VCL weld" demo https://wiki.documentfoundation.org/Development/VCL/minweld by running "./bin/run minweld" in my local build.

VCL respects a number of environment variables, one can change which backend is used for UI construction.

https://wiki.documentfoundation.org/Development/Environment_variables#VCL

On KDE, I found these options useful:

1. 

SAL_USE_VCLPLUGIN=gtk3

this one straight up forces gtk3 instead, I find it scales correctly in terms of UI elements and modal windows, but can be more or less blurry at certain scales. was pefectly crisp for me on my big screens, blurry on the smaller laptop screen. I find this the most useful.

2.

SAL_USE_VCLPLUGIN=qt6 QT_SCALE_FACTOR=0.5

if you are experiencing this on KDE Wayland, the first part is likely redundant. The second part with QT_SCALE_FACTOR seems to not actually to do with part of LibreOffice, nor VCL per se, it's a feature of KDE in general, should work on any KDE application. Modifies whatever scaling is applied to the entire app. Since the issue we are having is LibreOffice scalling UP too much, fractional value like 0.5 makes everything smaller back again. Looks perfectly good on the screen where issue existed before. The downside? It's always applying this modifier even on previously correct screens, making my laptop screen show office for ants.

How to apply these and forget?

On KDE desktop, go to your "start menu" widget ("Application Launcher"/"Application Dashboard"/"Application Menu" or what have you), and right click on  each LibreOffice item -> "Edit application". Add the desired workaround in "Environment variables:" field and hit "Save". This should create the right files in the right places with the right changes for you, otherwise you would have to do it manually in ~/.local/share/applications/.

Once I did this, every single time a document is opened with LibreOffice, it looks correctly scaled for my needs.

Hope this gets a proper fix sooner than later, for now at least we can have usable office!
Comment 4 Martino 2025-08-29 22:46:47 UTC
Hello, I'm facing the same issue on Fedora 42 KDE (Wayland).

I tried the workarounds suggested by Andrew, but forcing GTK isn't ideal when you are using KDE theming.

Furthermore, I also tried the second option, but if I force the scaling with "SAL_USE_VCLPLUGIN=qt6 QT_SCALE_FACTOR=2" the problem becomes even more noticeable. The UI proportions between menus / icons are completely broken, and if I try to move the window out of the primary monitor (with the highest resolution) everything becomes huge.

The only thing that worked for me was forcing the program to start with X11 by setting the following environment variable:

  "QT_QPA_PLATFORM=xcb"

This way, the UI still inherits the theme from KDE and, most importantly, LibreOffice keeps the same scale across monitors.


  System Info:

Display 1: 2560x1440p@144Hz - 27’’ - Scale 115%
Display 2: 1920x1080p@60Hz - 24’’ - Scale 100%

Kernel: Linux 6.16.3-200.fc42.x86_64
GPU: GeForce RTX 4070 - Proprietary driver 575.64.05
KDE: Plasma 6.4.4 (Wayland) - Qt 6.9.1


  LibreOffice Version:

Version: 25.2.5.2* (X86_64)
Build ID: 520(Build:2)
CPU threads: 24; OS: Linux 6.16; UI render: default; VCL: kf6 (cairo+wayland)
Locale: it-IT (it_IT.UTF-8); UI: it-IT
Calc: threaded

(*latest version in the official Fedora Updates repository)