Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Try to fix a native crash in SWT TreeViewer icon setting on Linux #1617

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2019, 2023 Lablicate GmbH.
* Copyright (c) 2019, 2024 Lablicate GmbH.
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
Expand Down Expand Up @@ -167,29 +167,22 @@ private void createTreeViewer(Composite parent, Function<File, Map<ISupplierFile
treeViewer.setUseHashlookup(true);
treeViewer.setExpandPreCheckFilters(true);
treeViewer.setContentProvider(new DataExplorerContentProvider(identifier));
treeViewer.setLabelProvider(new DataExplorerLabelProvider(identifier));
DisplayUtils.getDisplay().asyncExec(() -> {
// Workaround for https://bugs.eclipse.org/bugs/show_bug.cgi?id=573090
treeViewer.setLabelProvider(new DataExplorerLabelProvider(identifier));
});
setInput(treeViewer);
//
treeViewerControl.set(treeViewer);
}

private void setInput(TreeViewer treeViewer) {

/*
* Workaround for https://bugs.eclipse.org/bugs/show_bug.cgi?id=573090
*/
DisplayUtils.getDisplay().asyncExec(new Runnable() {

@Override
public void run() {

treeViewer.setInput(dataExplorerTreeRoot.getRootContent());
updateDirectory();
if(preferenceStore != null && preferenceKey != null) {
expandLastDirectoryPath(preferenceStore, preferenceKey);
}
}
});
treeViewer.setInput(dataExplorerTreeRoot.getRootContent());
updateDirectory();
if(preferenceStore != null && preferenceKey != null) {
expandLastDirectoryPath(preferenceStore, preferenceKey);
}
}

private void updateDirectory() {
Expand Down
Loading