Bug 123080 - TDF 64-bit linux builds require GTK3 with Wayland backend
Summary: TDF 64-bit linux builds require GTK3 with Wayland backend
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: LibreOffice (show other bugs)
Version:
(earliest affected)
6.2.0.3 release
Hardware: All Linux (All)
: medium normal
Assignee: Caolán McNamara
URL:
Whiteboard: target:6.3.0 target:6.2.1
Keywords:
Depends on:
Blocks: GTK3
  Show dependency treegraph
 
Reported: 2019-01-31 05:38 UTC by Yury
Modified: 2019-02-14 10:57 UTC (History)
6 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 Yury 2019-01-31 05:38:11 UTC
GTK3 VCL in 64-bit linux binary RPM builds requires Wayland installation, which is unexpected. The requirement is created by linking the RPM builds against the GTK3 shared libraries which were, in their turn, built requiring Wayland.

(using VCLs for X11, KDE4, QT5, GTK with the SAL_USE_VCLPLUGIN var works, at least LO reaches new Writer doc opened state)

If you do not have a Wayland installed, starting LO fails after showing the splash screen:

$ ./soffice
/d/p/lo62/opt/libreoffice6.2/program/soffice.bin: symbol lookup error: /d/p/lo62/opt/libreoffice6.2/program/libvclplug_gtk3lo.so: undefined symbol: gdk_wayland_display_get_type

Doing `ldd -r libvclplug_gtk3lo.so` in /opt/libreoffice6.2/program produces this:

<...resolved dependencies skipped...>
undefined symbol: gtk_scrolled_window_set_propagate_natural_width       (./libvclplug_gtk3lo.so)
undefined symbol: gdk_wayland_window_set_dbus_properties_libgtk_only    (./libvclplug_gtk3lo.so)
undefined symbol: gdk_display_get_default_seat  (./libvclplug_gtk3lo.so)
undefined symbol: gtk_scrolled_window_set_propagate_natural_height      (./libvclplug_gtk3lo.so)
undefined symbol: gdk_seat_grab (./libvclplug_gtk3lo.so)
undefined symbol: gdk_wayland_display_get_type  (./libvclplug_gtk3lo.so)
undefined symbol: gdk_seat_ungrab       (./libvclplug_gtk3lo.so)
undefined symbol: gdk_wayland_window_get_wl_surface     (./libvclplug_gtk3lo.so)
undefined symbol: gtk_menu_popup_at_rect        (./libvclplug_gtk3lo.so)
Comment 1 Maxim Monastirsky 2019-02-01 13:59:00 UTC
That's usually not a problem, as most distros do have Wayland-enabled gtk3 builds nowadays. And the gtk3 vclplug works fine with either X or Wayland, it just that the system gtk3 lib needs to be compiled with the Wayland backend turned on.

But what do you propose? Should we build our own gtk3 version with --disable-wayland-backend, and compile/link against it? This will create problems for users that do use Wayland, as anything inside #if defined(GDK_WINDOWING_WAYLAND) will be left out of the binary. And using gtk3 under a Wayland session defaults to the Wayland backend, regardless of what version was present on the build machine.
Comment 2 Yury 2019-02-01 15:22:42 UTC
I don't know how to answer the arguments of 'most distros' sort.
You could put a warning in the description at least, 'the default configuration on linux requires Wayland-enabled GTK3'.
Comment 3 Maxim Monastirsky 2019-02-02 21:20:25 UTC
Turns out that Mozilla had the same problem (see link in 'See Also'), and they solved it by using !GDK_IS_X11_DISPLAY(gdkDisplay) instead of GDK_IS_WAYLAND_DISPLAY(gdkDisplay). We can do that too, and it indeed works (I tried it). Of course that won't work with Wayland-only gtk3 builds, but hopefully such configuration is rarer than X-only. It's sad that gtk doesn't allow checking the current backend, in a way that doesn't depend on what's currently installed.

Adding Caolán to CC, maybe he has any better idea.
Comment 4 Caolán McNamara 2019-02-02 23:03:44 UTC
seeing as GDK_IS_WAYLAND_DISPLAY is...

#define GDK_IS_WAYLAND_DISPLAY(object)        (G_TYPE_CHECK_INSTANCE_TYPE ((object), GDK_TYPE_WAYLAND_DISPLAY))

and GDK_TYPE_WAYLAND_DISPLAY is...

#define GDK_TYPE_WAYLAND_DISPLAY              (gdk_wayland_display_get_type())

perhaps some dlsyming replacement somethink like...

bool Gdk_Is_Wayland_Display(GdkDisplay* pDisplay)
{
    auto get_type = (void (*) (void))dlsym(nullptr, "gdk_wayland_display_get_type");
    if (!get_type)
        return false;
    return (G_TYPE_CHECK_INSTANCE_TYPE(object, get_type())); 
}

would work without putting a link time requirement on gdk_wayland_display_get_type ?
Comment 5 abspack 2019-02-07 19:57:34 UTC
I also have this issue at Xubuntu 18.10 64 bit.
Comment 6 K.M. 2019-02-11 12:37:43 UTC
Using openSUSE Leap 42.3 with window manager WindowMaker-0.95.8-1.14.x86_64 I also get:

/LibreOffice-6.2.0/program/soffice.bin: symbol lookup error: /LibreOffice-6.2.0/program/libvclplug_gtk3lo.so: undefined symbol: gdk_wayland_display_get_type

From what I found out is, that WindowMaker does not support the Wayland protocol.
Comment 7 Caolán McNamara 2019-02-11 14:27:57 UTC
my suggestion seems to work locally
Comment 8 Commit Notification 2019-02-11 17:38:28 UTC
Caolán McNamara committed a patch related to this issue.
It has been pushed to "master":

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

Resolves: tdf#123080 don't require wayland at runtime

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 Caolán McNamara 2019-02-11 21:06:56 UTC
I built a local gtk 3.22 without wayland support and was able to launch the gtk3 vclplug with this. So I'll call it fixed. backport to 6.2 in gerrit.

Its quite possible that there are similar additional problem lying around.
Comment 10 kivi 2019-02-12 09:29:51 UTC
And yes, I do not use Wayland and do not have it installed.
It may be connected with the bug you pointed me to see.
Comment 11 Commit Notification 2019-02-12 09:48:49 UTC
Caolán McNamara committed a patch related to this issue.
It has been pushed to "libreoffice-6-2":

https://git.libreoffice.org/core/+/8249b1df075184798418ba778a9b2d71a7115eae%5E%21

Resolves: tdf#123080 don't require wayland at runtime

It will be available in 6.2.1.

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 12 K.M. 2019-02-14 10:57:02 UTC
Version: 6.2.2.0.0+
Build-ID: ba5e640cc4880ef023b5ea501b1b99e0a3ba25bd
CPU-Threads: 4; BS: Linux 4.4; UI-Render: Standard; VCL: gtk3; 
TinderBox: Linux-rpm_deb-x86_64@86-TDF, Branch:libreoffice-6-2, Time: 2019-02-13_04:26:01
Gebietsschema: de-DE (de_DE.UTF-8); UI-Sprache: de-DE
Calc: CL

The daily LODev 6.2 build from 13.02.2019 (see above) works for me under openSUSE Leap 42.3 with window manager WindowMaker-0.95.8-1.14.x86_64

I successfully opened a few .odt, .odp and .ods docs.