swaywm / sway

i3-compatible Wayland compositor
https://swaywm.org
MIT License
14.09k stars 1.08k forks source link

Libreoffice windows stop working #5262

Open scossu opened 4 years ago

scossu commented 4 years ago

After a first launch and little interaction, LibreOffice is unable to open windows and leaves open processes.

I have replicated this with both native Wayland and XWayland. Examples below are for native Wayland.

Sway version: 1.4

LibreOffice version: 6.3.5-4

Sway run script (from tty):


#!/bin/sh
export _JAVA_AWT_WM_NONREPARENTING=1

export MOZ_ENABLE_WAYLAND=1

export QT_QPA_PLATFORM=wayland-egl
export QT_QPA_PLATFORMTHEME=qt5ct
export QT_WAYLAND_FORCE_DPI=96
export QT_WAYLAND_DISABLE_WINDOWDECORATION=1

export SDL_VIDEODRIVER=wayland

export SAL_USE_VCLPLUGIN=gtk3

export TERMINAL=kitty
export XKB_DEFAULT_LAYOUT=us

exec sway -d 2>~/.sway.log

Actions:

The only way to recover the application is to delete ~/.config/libreoffice/4 every time.

apiraino commented 3 years ago

Hi @scossu I'm on debian bullseye and can't start libreoffice 7rc on Sway 1.5 with xwayland disabled in my config (actually I don't have X11 nor gnome installed at all). I have set your env vars, too.

Do you still experience this issue? In your issue you wrote "native Wayland" - are you 100% you were not under xwayland? I'm asking because with my 100% wayland+sway I only get an error that soffice.bin can't open the X11 display (pasting here for search engines)

$ soffice --version
LibreOffice 7.0.4.2 00(Build:2)

$ soffice 
/usr/lib/libreoffice/program/soffice.bin X11 error: Can't open display: 
   Set DISPLAY environment variable, use -display option
   or check permissions of your X-Server
   (See "man X" resp. "man xhost" for details)

I'm inverstigating, likely missing some other undocumented env var or trick ...

thanks for any info you may have

apiraino commented 3 years ago

confirmed that without xwayland libreoffice doesn't work on Sway

ngortheone commented 3 years ago

I am on gentoo, and libreoffice is compiled with Qt and without gtk support. LibreOffice indeed does not start without xwayland. Going to rebuild it with gtk support and see if changes anything...

UPDATE: .. a few kilowatt/hours later - LibreOffice 7.0.4.2 with GTK3 seems to be working fine, out of the box.

https://gitweb.gentoo.org/repo/gentoo.git/tree/app-office/libreoffice/libreoffice-7.0.4.2.ebuild

➜  ~ equery uses libreoffice
[ Legend : U - final flag setting for installation]
[        : I - package is installed with flag     ]
[ Colors : set, unset                             ]
 * Found these USE flags for app-office/libreoffice-7.0.4.2:
 U I
 - - accessibility                               : Add support for accessibility (eg 'at-spi' library)
 - - base                                        : Enable full support for LibreOffice Base databases (involves additional
                                                   bundled libs)
 - - bluetooth                                   : Enable Bluetooth Support
 + + branding                                    : Enable Gentoo specific branding
 + + clang                                       : Use Clang compiler instead of GCC
 - - coinmp                                      : Use sci-libs/coinor-mp as alternative solver
 + + cups                                        : Add support for CUPS (Common Unix Printing System)
 - - custom-cflags                               : Build with user-specified CFLAGS (unsupported)
 + + dbus                                        : Enable dbus support for anything that needs it (gpsd, gnomemeeting,
                                                   etc)
 - - debug                                       : Enable extra debug codepaths, like asserts and extra output. If you
                                                   want to get meaningful backtraces see
                                                   https://wiki.gentoo.org/wiki/Project:Quality_Assurance/Backtraces
 - - eds                                         : Enable support for Evolution-Data-Server (EDS)
 - - firebird                                    : Add support for the Firebird relational database
 - - googledrive                                 : Enable support for remote files on Google Drive
 - - gstreamer                                   : Add support for media-libs/gstreamer (Streaming media)
 + + gtk                                         : Add support for x11-libs/gtk+ (The GIMP Toolkit)
 - - java                                        : Add support for Java
 - - kde                                         : Add support for software made by KDE, a free software community
 - - ldap                                        : Add LDAP support (Lightweight Directory Access Protocol)
 - - libreoffice_extensions_nlpsolver            : LIBREOFFICE_EXTENSIONS option to build non-linear solver for calc
 - - libreoffice_extensions_scripting-beanshell  : LIBREOFFICE_EXTENSIONS option to build beanshell scripts parser
 - - libreoffice_extensions_scripting-javascript : LIBREOFFICE_EXTENSIONS option to build javascript scripts parser
 - - libreoffice_extensions_wiki-publisher       : LIBREOFFICE_EXTENSIONS option to build mediawiki integration
 + + mariadb                                     : Prefer mariadb connector over mysql connector
 - - odk                                         : Build the Office Development Kit
 - - pdfimport                                   : Enable PDF import via the Poppler library
 - - postgres                                    : Add support for the postgresql database
 - - python_single_target_python3_6              : Build for Python 3.6 only
 - - python_single_target_python3_7              : Build for Python 3.7 only
 + + python_single_target_python3_8              : Build for Python 3.8 only
 - - python_single_target_python3_9              : Build for Python 3.9 only
 - - test                                        : Enable dependencies and/or preparations necessary to run tests (usually
                                                   controlled by FEATURES=test but can be toggled independently)
 + + vulkan                                      : Enable Vulkan usage via the skia library (clang recommended)
apiraino commented 3 years ago

LibreOffice 7.0.4.2 with GTK3 seems to be working fine, out of the box.

yes, my understanding is that GTK3 fixed native Wayland compatibility (as in: "xwayland should not be needed anymore") I've tested this with Gimp 2.99.

FWIW I've installed the vanilla Libreoffice (not sure what the issue reporter was using) and it works fine on my installation :man_shrugging:

savchenko commented 3 years ago

Debian Bullseye, running fine:

Version: 7.0.4.2
Build ID: 00(Build:2)
CPU threads: 12; OS: Linux 5.10; UI render: default; VCL: gtk3
Locale: en-AU (en_AU.UTF-8); UI: en-US
Debian package version: 1:7.0.4-3
Calc: threaded

Recipe:

  1. apt install libreoffice-gtk3. Installing meta-package libreoffice isn't necessary unless you need JRE.
  2. Add xwayland disable to Sway config
  3. Cherry-pick relevant environment variables from https://github.com/savchenko/debian/blob/bullseye/roles/dotfiles/files/profile
savchenko commented 3 years ago

@emersion, shall this be closed?..