Bug 494299

Summary: LibreOffice writer documents scroll slowly under KDE plasma on Wayland
Product: [Plasma] kwin Reporter: ppaanncchhoo507
Component: performanceAssignee: KWin default assignee <kwin-bugs-null>
Status: RESOLVED DOWNSTREAM    
Severity: normal CC: 1gsiqkbz, francisco278herrera, m.weghorn, mahen, nate, robby.engelmann
Priority: NOR    
Version: master   
Target Milestone: ---   
Platform: Fedora RPMs   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description ppaanncchhoo507 2024-10-08 17:04:25 UTC
SUMMARY
LibreOffice writer documents scroll slowly under KDE plasma on Wayland 

STEPS TO REPRODUCE
1. Use fedora 40 with KDE plasma 6.1.5 or Ubuntu 24.04 with KDE plasma 5.27 installed
2. Open an ODT or DOCX document with several pages of only text on LibreOffice writer 
3. Scroll through the document

OBSERVED RESULT
Scrolling through the document is laggy

EXPECTED RESULT
Smooth scrolling through the document 

SOFTWARE/OS VERSIONS
Windows: 
macOS: 
(available in the Info Center app, or by running `kinfo` in a terminal window)
Linux/KDE Plasma: 6.10.12-200.fc40.x86_64
KDE Plasma Version: 6.1
KDE Frameworks Version: 6.6
Qt Version: 6.7.2

ADDITIONAL INFORMATION
Bug is reported at https://bugs.documentfoundation.org/show_bug.cgi?id=152911 many people have the same issue. 
LibreOffice writer scrolls fine on gnome and the cosmic desktop environment regardless of Linux distro. The common factor seems to be KDE plasma on Wayland.
Comment 1 ppaanncchhoo507 2024-10-08 17:09:12 UTC
(In reply to ppaanncchhoo507 from comment #0)
> SUMMARY
> LibreOffice writer documents scroll slowly under KDE plasma on Wayland 
> 
> STEPS TO REPRODUCE
> 1. Use fedora 40 with KDE plasma 6.1.5 or Ubuntu 24.04 with KDE plasma 5.27
> installed
> 2. Open an ODT or DOCX document with several pages of only text on
> LibreOffice writer 
> 3. Scroll through the document
> 
> OBSERVED RESULT
> Scrolling through the document is laggy
> 
> EXPECTED RESULT
> Smooth scrolling through the document 
> 
> SOFTWARE/OS VERSIONS
> Windows: 
> macOS: 
> (available in the Info Center app, or by running `kinfo` in a terminal
> window)
> Linux/KDE Plasma: 6.10.12-200.fc40.x86_64
> KDE Plasma Version: 6.1
> KDE Frameworks Version: 6.6
> Qt Version: 6.7.2
> 
> ADDITIONAL INFORMATION
> Bug is reported at
> https://bugs.documentfoundation.org/show_bug.cgi?id=152911 many people have
> the same issue. 
> LibreOffice writer scrolls fine on gnome and the cosmic desktop environment
> regardless of Linux distro. The common factor seems to be KDE plasma on
> Wayland.

Tested on LibreOffice 24.2.6.2. it happens regardless of provider of the LibreOffice package.
Comment 2 ppaanncchhoo507 2024-10-08 20:06:35 UTC
(In reply to ppaanncchhoo507 from comment #0)
> SUMMARY
> LibreOffice writer documents scroll slowly under KDE plasma on Wayland 
> 
> STEPS TO REPRODUCE
> 1. Use fedora 40 with KDE plasma 6.1.5 or Ubuntu 24.04 with KDE plasma 5.27
> installed
> 2. Open an ODT or DOCX document with several pages of only text on
> LibreOffice writer 
> 3. Scroll through the document
> 
> OBSERVED RESULT
> Scrolling through the document is laggy
> 
> EXPECTED RESULT
> Smooth scrolling through the document 
> 
> SOFTWARE/OS VERSIONS
> Windows: 
> macOS: 
> (available in the Info Center app, or by running `kinfo` in a terminal
> window)
> Linux/KDE Plasma: 6.10.12-200.fc40.x86_64
> KDE Plasma Version: 6.1
> KDE Frameworks Version: 6.6
> Qt Version: 6.7.2
> 
> ADDITIONAL INFORMATION
> Bug is reported at
> https://bugs.documentfoundation.org/show_bug.cgi?id=152911 many people have
> the same issue. 
> LibreOffice writer scrolls fine on gnome and the cosmic desktop environment
> regardless of Linux distro. The common factor seems to be KDE plasma on
> Wayland.

KDE plasma was used while it was running on Wayland.
Comment 3 ppaanncchhoo507 2024-10-08 20:08:44 UTC
(In reply to ppaanncchhoo507 from comment #2)
> (In reply to ppaanncchhoo507 from comment #0)
> > SUMMARY
> > LibreOffice writer documents scroll slowly under KDE plasma on Wayland 
> > 
> > STEPS TO REPRODUCE
> > 1. Use fedora 40 with KDE plasma 6.1.5 or Ubuntu 24.04 with KDE plasma 5.27
> > installed
> > 2. Open an ODT or DOCX document with several pages of only text on
> > LibreOffice writer 
> > 3. Scroll through the document
> > 
> > OBSERVED RESULT
> > Scrolling through the document is laggy
> > 
> > EXPECTED RESULT
> > Smooth scrolling through the document 
> > 
> > SOFTWARE/OS VERSIONS
> > Windows: 
> > macOS: 
> > (available in the Info Center app, or by running `kinfo` in a terminal
> > window)
> > Linux/KDE Plasma: 6.10.12-200.fc40.x86_64
> > KDE Plasma Version: 6.1
> > KDE Frameworks Version: 6.6
> > Qt Version: 6.7.2
> > 
> > ADDITIONAL INFORMATION
> > Bug is reported at
> > https://bugs.documentfoundation.org/show_bug.cgi?id=152911 many people have
> > the same issue. 
> > LibreOffice writer scrolls fine on gnome and the cosmic desktop environment
> > regardless of Linux distro. The common factor seems to be KDE plasma on
> > Wayland.
> 
> KDE plasma was used while it was running on Wayland.

In both Fedora and Ubuntu.
Comment 4 ppaanncchhoo507 2024-10-10 10:05:22 UTC
I updated to plasma 6.2 and it seems scrolling is smoother now, but it is still laggy in comparison with the cosmic desktop environment or Gnome
Comment 5 Robby Engelmann 2024-10-10 10:30:12 UTC
I can reproduce here being on master git builds on top of recent openSUSE Tumbleweed:
Operating System: openSUSE Tumbleweed 20241009
KDE Plasma Version: 6.2.80
KDE Frameworks Version: 6.7.0
Qt Version: 6.7.3
Kernel Version: 6.11.2-1-default (64-bit)
Graphics Platform: Wayland
Processors: 20 × 13th Gen Intel® Core™ i7-13700H
Memory: 62.5 GiB of RAM
Graphics Processor: Mesa Intel® Graphics
Manufacturer: TUXEDO
Product Name: TUXEDO InfinityBook Pro Gen8 (MK1)
Comment 6 Robby Engelmann 2024-10-10 10:33:13 UTC
The common thing is KDE, right. However, under KDE (as compared to GNOME) at least two difference are there:
1. Using KF+Plasma (KDE dev part)
2. Libreoffice uses the KF5/KF6-VCL (LO dev part)

Are we sure, whether 1. or 2. or even interaction between 1. or 2. is the cause?
Comment 7 Robby Engelmann 2024-10-10 10:39:28 UTC
Having de-installed the -qt5/6 packages and thus forcing to use the gtk-based vcl the scolling is OK here.
Comment 8 ppaanncchhoo507 2024-10-10 13:28:12 UTC
Seems to be a Qt issue now. Plasma 6.2 offers improved scrolling smoothness even though the Qt version was 6.7.2 when I reported this and still is now that scrolling is smoother. But it could still be more smooth
Comment 9 ppaanncchhoo507 2024-10-10 13:31:54 UTC
(In reply to ppaanncchhoo507 from comment #8)
> Seems to be a Qt issue now. Plasma 6.2 offers improved scrolling smoothness
> even though the Qt version was 6.7.2 when I reported this and still is now
> that scrolling is smoother. But it could still be more smooth

So it used to be a KDE plasma 6.1 issue and a qt 6.7.2 issue. Seems to be fixed on the plasma side now
Comment 10 Robby Engelmann 2024-10-10 14:19:24 UTC
Is there any reference for being an Qt issue?
Here scrolling is still not OK, I do not see any change at all during the last months being continuously on plasma master and having always latest Qt.
Again, switching LO to the GTK-VCL solves the issue under KDE (but bringing bad integration into KDE).

But yes, the issue is longstanding, present under KDE and annoying :-)
Would be nice to hear from KDE devs about it. The LO bugtracker (https://bugs.documentfoundation.org/show_bug.cgi?id=152911) offered nothing during the last months or say years :(.
Comment 11 Francisco H 2024-10-10 17:44:06 UTC
testing libreoffice by running SAL_USE_VCLPLUGIN=gtk3 libreoffice --writer and 
SAL_USE_VCLPLUGIN=kf6 libreoffice --writer  under mutter in gnome  on wayland and kwin in kde plasma on wayland. 

scrolling is laggier in libreoffice writer on kwin in kde plasma on wayland regardless of whether you use gtk3 or qt(kf6). 

however, under mutter on gnome on wayland, using gtk3 or kf6 doesn't make a difference and scrolling is equally smooth on both in libreoffice writer. so we know its not a qt issue but it may be a kwin issue.

tested under fedora 40, on a lenovo 15ach6h, 
kernel: 6.10.12-200.fc40.x86_64 (64-bit)
qt 6.7.2
kde frameworks 6.6.0
kde plasma 6.2.0
14.9 gb of ram. on a ryzen 5 5600h with hybrid graphics running with nouveau. Although i used to use propietary nvidia drivers and they didn't seem to make a difference. i have no idea what gpu libreoffice us using.
Comment 12 Mahendra Tallur 2024-10-14 07:58:56 UTC
Hi ! 

Found a workaround on the ArchLinux wiki. Apparently that's a wayland/Libo issue. ("KDE Plasma/GNOME + Wayland with or without fractional scaling results in terrible lag when scrolling")

cf https://wiki.archlinux.org/title/LibreOffice

A workaround is to switch to X.org or start Libreoffice with : QT_QPA_PLATFORM=xcb libreoffice

Cheers !
Comment 13 Mahendra Tallur 2024-10-14 08:32:27 UTC
Hi ! Btw, is it possible to turn it into a more general report ? (not just Fedora-related)

It occurs under KDE Neon (24.04 but also 22.04) as well.
It makes LibreOffice crawl under normal usage and it makes it almost impossible to use if documents get a bit heavier (on a modest i5 Intel-HD machine).

(I wonder if anyone could ping Nate Graham about it, it seems pretty major -- but well, I guess everyone tends to think the same about bugs they encounter ;-)

Anyway, I added the QT_QPA_PLATFORM=xcb environment variable in all Libo related .desktop files and it does the trick. Not super smooth but massively better.
Comment 14 Alexander Sanderson 2024-10-24 15:21:52 UTC
I'd like to chime in and point out that window size affects performance massively here. For instance, if you make the window small, the scrolling speed might be comparable to its speed under the xcb / x11 backend. Conversely, if you make the window fullscreen, it will be at its choppiest.

I would also like to ask if the issue is KWin or the QT backend for LibreOffice. I've noticed some people point out the scrolling is smoother on GNOME and COSMIC, but I don't believe they specified if they were using the QT or GTK3 backend for LibreOffice in these cases.
Comment 15 Francisco H 2024-10-24 16:31:16 UTC
(In reply to Alexander Sanderson from comment #14)
> I'd like to chime in and point out that window size affects performance
> massively here. For instance, if you make the window small, the scrolling
> speed might be comparable to its speed under the xcb / x11 backend.
> Conversely, if you make the window fullscreen, it will be at its choppiest.
> 
> I would also like to ask if the issue is KWin or the QT backend for
> LibreOffice. I've noticed some people point out the scrolling is smoother on
> GNOME and COSMIC, but I don't believe they specified if they were using the
> QT or GTK3 backend for LibreOffice in these cases.

I'd say it's a Kwin issue. When I ran in the terminal "SAL_USE_VCLPLUGIN=gtk3 libreoffice --writer" and 
"SAL_USE_VCLPLUGIN=kf6 libreoffice --writer" with the LibreOffice window maximized, LibreOffice writer ran fine under gnome 46 on Wayland but scrolled poorly with on KDE plasma 6.2 on Wayland.
Comment 16 Francisco H 2024-10-24 16:32:03 UTC
(In reply to Alexander Sanderson from comment #14)
> I'd like to chime in and point out that window size affects performance
> massively here. For instance, if you make the window small, the scrolling
> speed might be comparable to its speed under the xcb / x11 backend.
> Conversely, if you make the window fullscreen, it will be at its choppiest.
> 
> I would also like to ask if the issue is KWin or the QT backend for
> LibreOffice. I've noticed some people point out the scrolling is smoother on
> GNOME and COSMIC, but I don't believe they specified if they were using the
> QT or GTK3 backend for LibreOffice in these cases.

The kf6 backend would be the Qt backend in this case I believe
Comment 17 Francisco H 2024-10-24 16:34:58 UTC
(In reply to Francisco H from comment #15)
> (In reply to Alexander Sanderson from comment #14)
> > I'd like to chime in and point out that window size affects performance
> > massively here. For instance, if you make the window small, the scrolling
> > speed might be comparable to its speed under the xcb / x11 backend.
> > Conversely, if you make the window fullscreen, it will be at its choppiest.
> > 
> > I would also like to ask if the issue is KWin or the QT backend for
> > LibreOffice. I've noticed some people point out the scrolling is smoother on
> > GNOME and COSMIC, but I don't believe they specified if they were using the
> > QT or GTK3 backend for LibreOffice in these cases.
> 
> I'd say it's a Kwin issue. When I ran in the terminal
> "SAL_USE_VCLPLUGIN=gtk3 libreoffice --writer" and 
> "SAL_USE_VCLPLUGIN=kf6 libreoffice --writer" with the LibreOffice window
> maximized, LibreOffice writer ran fine under gnome 46 on Wayland but
> scrolled poorly with on KDE plasma 6.2 on Wayland.

I ran the commands in the terminal first and later made sure LibreOffice was maximized then proceeded to try to scroll
Comment 18 Nate Graham 2024-11-05 22:04:25 UTC
I can confirm this issue, but it's a LibreOffice issue, not a KWin issue.