flathub / io.github.nroduit.Weasis

https://flathub.org/apps/details/io.github.nroduit.Weasis
0 stars 0 forks source link

"No X11 DISPLAY variable was set" when running under Wayland #16

Open robertvazan opened 4 months ago

robertvazan commented 4 months ago

Manifest claims Wayland support, but when I try to start this app under Wayland, I get error "No X11 DISPLAY variable was set". Stack trace:

ERROR: Bundle weasis-core [20] Error starting file:/app/lib/app/bundle/weasis-core-4.3.0.jar (org.osgi.framework.BundleException: Activator start error in bundle weasis-core [20].)
java.lang.ExceptionInInitializerError
    at org.weasis.core.api.gui.util.GuiUtils.getUICore(GuiUtils.java:124)
    at org.weasis.core.internal.Activator.start(Activator.java:56)
    at org.apache.felix.framework.util.SecureAction.startActivator(SecureAction.java:849)
    at org.apache.felix.framework.Felix.activateBundle(Felix.java:2429)
    at org.apache.felix.framework.Felix.startBundle(Felix.java:2335)
    at org.apache.felix.framework.Felix.setActiveStartLevel(Felix.java:1566)
    at org.apache.felix.framework.FrameworkStartLevelImpl.run(FrameworkStartLevelImpl.java:297)
    at java.base/java.lang.Thread.run(Unknown Source)
Caused by: java.awt.HeadlessException: 
No X11 DISPLAY variable was set,
or no headful library support was found,
but this program performed an operation which requires it,

    at java.desktop/sun.awt.HeadlessToolkit.getScreenSize(Unknown Source)
    at bibliothek.gui.dock.FlapDockStation.selfSetDirection(FlapDockStation.java:712)
    at bibliothek.gui.dock.FlapDockStation.setAutoDirection(FlapDockStation.java:701)
    at bibliothek.gui.dock.common.CMinimizeArea.setDirection(CMinimizeArea.java:191)
    at bibliothek.gui.dock.common.CMinimizeArea.init(CMinimizeArea.java:123)
    at bibliothek.gui.dock.common.CContentArea$MinimizeStation.<init>(CContentArea.java:550)
    at bibliothek.gui.dock.common.CContentArea.<init>(CContentArea.java:114)
    at bibliothek.gui.dock.common.CControl.createContentArea(CControl.java:1154)
    at bibliothek.gui.dock.common.CControl.getContentArea(CControl.java:1398)
    at org.weasis.core.api.service.UICore.<init>(UICore.java:89)
    at org.weasis.core.api.service.UICore.<clinit>(UICore.java:68)
    ... 8 more

I trimmed the permissions via overrides, but Wayland was left enabled:

$ flatpak info --show-permissions io.github.nroduit.Weasis
[Context]
sockets=wayland;
filesystems=~/Pictures/Personal/Health:ro;

[Environment]
PATH=/app/bin:/usr/bin
nroduit commented 4 months ago

The error message is the same as when running Weasis on a server without a GUI. There are still quite a few problems with Wayland and certain Linux distributions. See this issue.

robertvazan commented 4 months ago

I think you should configure it with --socket=x11 until the underlying issue is fixed.

nroduit commented 4 months ago

It works with some distributions. I'd prefer to have the issue fixed, as activating this parameter may cause it not to work in some other cases.