Bug 124598 - gtk3_kde5: Opening file dialog makes LO hang if KIO libraries are not installed
Summary: gtk3_kde5: Opening file dialog makes LO hang if KIO libraries are not installed
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: UI (show other bugs)
Version:
(earliest affected)
6.2.2.2 release
Hardware: All Linux (All)
: medium normal
Assignee: Michael Weghorn
URL:
Whiteboard: target:6.3.0 target:6.2.4
Keywords:
Depends on:
Blocks: KDE, KF5
  Show dependency treegraph
 
Reported: 2019-04-08 03:19 UTC by yan12125
Modified: 2019-04-28 22:57 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description yan12125 2019-04-08 03:19:25 UTC
Description:
This is a follow-up of https://bugs.documentfoundation.org/show_bug.cgi?id=123595. See also https://github.com/lxqt/lxqt/issues/1673.

Currently in Arch Linux with LXQt, gtk3_kde5 is used when kio libraries are not installed, and thus file dialogs are broken. To workaround the issue, I propose to use pStandardFallbackList instead of pKDEFallbackList if DESKTOP_LXQT is detected in libreoffice/vcl/source/app/salplug.cxx.

Simon Quigley, the author of commits proposing DESKTOP_LXQT, is fine with changing upstream defaults:

> Sure, I think that's acceptable

(https://github.com/lxqt/lxqt/issues/1673#issuecomment-480558178)

Steps to Reproduce:
1. Install LXQt WITHOUT kio 
2. Unset all SAL_USE_VCLPLUGIN environment variables
3. Run LibreOffice
4. Hitting Ctrl+O

Actual Results:
LibreOffice hangs, waiting for the open file dialog, and there's an error in the terminal:

> /usr/lib/libreoffice/program/lo_kde5filepicker: error while loading shared libraries: libKF5KIOFileWidgets.so.5: cannot open shared object file: No such file or directory

Expected Results:
The open file dialog appears


Reproducible: Always


User Profile Reset: No



Additional Info:
Comment 1 Tsu Jan 2019-04-08 03:37:34 UTC
> I propose to use pStandardFallbackList instead of pKDEFallbackList if DESKTOP_LXQT is detected

Or, generally, outside KDE.
Comment 2 Michael Weghorn 2019-04-08 09:24:53 UTC
Reproduced with LXQt on Debian unstable (with KIO libraries uninstalled) with

Version: 6.3.0.0.alpha0+
Build ID: 625b186f96aea442546cfbfdee29030576b2a008
CPU threads: 64; OS: Linux 3.16; UI render: default; VCL: gtk3_kde5; 
Locale: de-DE (de_DE.UTF-8); UI-Language: en-US
Calc: threaded

I'm changing the title to reflect the actual bug, rather than the suggested workaround.
Comment 3 Michael Weghorn 2019-04-08 09:26:41 UTC
I'll take a quick look whether I can come up with an easy way to avoid the underlying issue.
Comment 4 yan12125 2019-04-09 12:50:32 UTC
> I'll take a quick look whether I can come up with an easy way to avoid the underlying issue.

Here's an idea: make libvclplug_gtk3_kde5lo.so links to KIO libraries so that it won't be loaded on systems without KIO. I got no luck after tweaking some Makefiles, though.
Comment 5 Michael Weghorn 2019-04-09 14:05:57 UTC
(In reply to Chih-Hsuan Yen from comment #4)
> Here's an idea: make libvclplug_gtk3_kde5lo.so links to KIO libraries so
> that it won't be loaded on systems without KIO. I got no luck after tweaking
> some Makefiles, though.

Thanks, that's an idea I had as well and I have a working patch here locally. It took me a while to get it working though, since the linker (at least on Ubuntu 18.04) initially was too smart for me and just didn't link the (unused) libraries. Adding a dummy use to a C++ file in addition did make it work in the end. 

Unless somebody comes up with a better idea, I'll probably upload that patch and ask for feedback from others.
Since gtk3_kde5 is more meant as a temporary solution in the migration to kde5, I'd currently avoid doing a fundamental change in how VCL plugins are loaded by LibreOffice.
Comment 6 Michael Weghorn 2019-04-24 13:17:05 UTC
Gerrit change: https://gerrit.libreoffice.org/#/c/71237/
Comment 7 yan12125 2019-04-24 16:17:00 UTC
I can confirm 6.2.3 + https://gerrit.libreoffice.org/#/c/71237/ patch works fine on Arch Linux. /usr/lib/libreoffice/program/libvclplug_gtk3_kde5lo.so links to libKF5KIOFileWidgets.so.5 and LibreOffice loads the GTK3 VCL plugin in LXQT. (without $SAL_USE_VCLPLUGIN, of course) Thank you very much for the work!
Comment 8 Commit Notification 2019-04-26 10:45:17 UTC
Michael Weghorn committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/+/1674c6964b585d944bcb34be1d937e7558a97453%5E%21

tdf#124598 gtk3_kde5: Link gtk3 side against kf5 libs

It will be available in 6.3.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 9 Michael Weghorn 2019-04-26 13:56:22 UTC
Thanks for testing!

Fixed now in master.
Backport for 6.2 pending at https://gerrit.libreoffice.org/#/c/71374/1
Comment 10 Commit Notification 2019-04-28 22:57:21 UTC
Michael Weghorn committed a patch related to this issue.
It has been pushed to "libreoffice-6-2":

https://git.libreoffice.org/core/+/64a9ea3106f3b8bdcd2f494345e1da54a7ee3e45%5E%21

tdf#124598 gtk3_kde5: Link gtk3 side against kf5 libs

It will be available in 6.2.4.

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.