Skip to content

Commit

Permalink
Workaround a native crash on Linux.
Browse files Browse the repository at this point in the history
  • Loading branch information
Mailaender committed Oct 26, 2023
1 parent fa9f4b1 commit 9de78e7
Showing 1 changed file with 11 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2016, 2022 Lablicate GmbH.
* Copyright (c) 2016, 2023 Lablicate GmbH.
*
* All rights reserved.
* This program and the accompanying materials are made available under the
Expand All @@ -17,6 +17,7 @@
import javax.inject.Inject;

import org.eclipse.chemclipse.processing.converter.ISupplierFileIdentifier;
import org.eclipse.chemclipse.support.ui.workbench.DisplayUtils;
import org.eclipse.chemclipse.ux.extension.xxd.ui.Activator;
import org.eclipse.chemclipse.ux.extension.xxd.ui.swt.DataExplorerUI;
import org.eclipse.e4.core.contexts.IEclipseContext;
Expand All @@ -36,7 +37,12 @@ public class DataExplorerPart {
@PostConstruct
public void init(Composite parent, MPart part, IEclipseContext context) {

dataExplorerUI = new DataExplorerUI(parent, preferenceStore, context, supplierFileIdentifier);
// Workaround for https://bugs.eclipse.org/bugs/show_bug.cgi?id=573090
DisplayUtils.getDisplay().asyncExec(() -> {
dataExplorerUI = new DataExplorerUI(parent, preferenceStore, context, supplierFileIdentifier);
dataExplorerUI.getControl().redraw();
dataExplorerUI.getControl().requestLayout();
});
}

public DataExplorerUI getDataExplorerUI() {
Expand All @@ -47,6 +53,8 @@ public DataExplorerUI getDataExplorerUI() {
@Focus
public void focus() {

dataExplorerUI.setFocus();
if(dataExplorerUI != null) {
dataExplorerUI.setFocus();
}
}
}

0 comments on commit 9de78e7

Please sign in to comment.