eclipse-sirius / sirius-desktop

Sirius Desktop: desktop-based graphical modelers for dedicated DSLs
https://eclipse.dev/sirius/
Eclipse Public License 2.0
15 stars 11 forks source link

Error while creating a diagram under Linux/Wayland #465

Closed pcdavid closed 1 month ago

pcdavid commented 1 month ago

Environment

Steps to reproduce

  1. Download Obeo Designer 11.9.0 (or any package which includes Sirius Desktop 7.4.x).
  2. Unzip the archive.
  3. Double-click on the obeodesigner binary.
  4. OD launches.
  5. File > New > Ecore Modeling Project.
  6. Give it a name (e.g. test) and Finish

Capture d’écran du 2024-09-23 17-02-47

The stack:

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.getSystemClipboard(HeadlessToolkit.java:216)
    at org.eclipse.sirius.diagram.ui.tools.internal.actions.layout.PasteImageAction.init(PasteImageAction.java:88)
    at org.eclipse.sirius.diagram.ui.tools.internal.editor.tabbar.actions.TabbarPasteFormatMenuManager.add(TabbarPasteFormatMenuManager.java:53)
    at org.eclipse.sirius.diagram.ui.tools.internal.editor.tabbar.actions.TabbarPasteFormatMenuManager.safeAdd(TabbarPasteFormatMenuManager.java:141)
    at org.eclipse.sirius.diagram.ui.tools.internal.editor.tabbar.actions.TabbarPasteFormatMenuManager.updateActions(TabbarPasteFormatMenuManager.java:154)
    at org.eclipse.sirius.diagram.ui.tools.internal.editor.tabbar.actions.TabbarPasteFormatMenuManager.setVisible(TabbarPasteFormatMenuManager.java:205)
    at org.eclipse.sirius.diagram.ui.tools.internal.editor.tabbar.contributions.TabbarContributionFactory.createPasteFormatContribution(TabbarContributionFactory.java:595)
    at org.eclipse.sirius.diagram.ui.tools.internal.editor.tabbar.TabbarFillerWithContributions.addDiagramContributionItems(TabbarFillerWithContributions.java:185)
    at org.eclipse.sirius.diagram.ui.tools.internal.editor.tabbar.TabbarFillerWithContributions.doFill(TabbarFillerWithContributions.java:87)
    at org.eclipse.sirius.diagram.ui.tools.internal.editor.tabbar.AbstractTabbarFiller.fill(AbstractTabbarFiller.java:72)
    at org.eclipse.sirius.diagram.ui.tools.internal.editor.tabbar.Tabbar.fillForDiagram(Tabbar.java:148)
    at org.eclipse.sirius.diagram.ui.tools.internal.editor.tabbar.Tabbar.<init>(Tabbar.java:93)
    at org.eclipse.sirius.diagram.ui.tools.internal.editor.DDiagramEditorImpl.createTabbar(DDiagramEditorImpl.java:1505)
    at org.eclipse.sirius.diagram.ui.tools.internal.editor.DDiagramEditorImpl.createGraphicalViewer(DDiagramEditorImpl.java:1476)
    at org.eclipse.gef.ui.parts.GraphicalEditor.createPartControl(GraphicalEditor.java:169)
    at org.eclipse.gmf.runtime.diagram.ui.parts.DiagramEditor.createPartControl(DiagramEditor.java:1591)
    at org.eclipse.gmf.runtime.diagram.ui.parts.DiagramEditorWithFlyOutPalette.createPartControl(DiagramEditorWithFlyOutPalette.java:330)
    at org.eclipse.gmf.runtime.diagram.ui.resources.editor.parts.DiagramDocumentEditor.createPartControl(DiagramDocumentEditor.java:1540)
    at org.eclipse.sirius.diagram.ui.tools.internal.editor.DDiagramEditorImpl.createPartControl(DDiagramEditorImpl.java:645)
    at org.eclipse.ui.internal.e4.compatibility.CompatibilityPart.createPartControl(CompatibilityPart.java:158)
    at org.eclipse.ui.internal.e4.compatibility.CompatibilityEditor.createPartControl(CompatibilityEditor.java:96)
    at org.eclipse.ui.internal.e4.compatibility.CompatibilityPart.create(CompatibilityPart.java:365)
    at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
    at java.base/java.lang.reflect.Method.invoke(Method.java:580)

Workaround

Launch with GDK_BACKEND environment variable set to x11:

% GDK_BACKEND=x11 ./obeodesigner
pcdavid commented 1 month ago

False alarm, the issue does not seem related to Wayland, but to the JVM used (or the way it is invoked) under Fedora when launching obeodesigner by double-clicking on the binary (/usr/lib/jvm/java-21-openjdk-21.0.4.0.7-2.fc40.x86_64 in my case).

When invoking obeodesigner from a terminal, without GDK_BACKEND set, but using e.g. "OpenJDK Runtime Environment Temurin-22.0.1+8 (build 22.0.1+8)"), I don't reproduce the issue.