Skip to content
Snippets Groups Projects
Commit 4a97f65e authored by Ulrich Schöpp's avatar Ulrich Schöpp Committed by Ulrich Schöpp
Browse files

Work around a FX/SWT bug for scrolling on Linux


Signed-off-by: default avatarUlrich Schöpp <schoepp@fortiss.org>
Issue-Ref: 4183
parent 31433bed
No related branches found
No related tags found
1 merge request!165Work around a FX/SWT bug for scrolling on Linux
Pipeline #32212 failed
......@@ -9,7 +9,8 @@ Require-Bundle: org.fortiss.tooling.common.ui;visibility:=reexport,
org.eclipse.core.resources;visibility:=reexport,
org.eclipse.emf.databinding;visibility:=reexport,
org.eclipse.core.databinding.property;visibility:=reexport,
com.google.guava;visibility:=reexport
com.google.guava;visibility:=reexport,
org.fortiss.tooling.base;bundle-version="2.20.0"
Bundle-ActivationPolicy: lazy
Bundle-RequiredExecutionEnvironment: JavaSE-11
Bundle-Vendor: fortiss GmbH
......
......@@ -4,7 +4,7 @@ EObjectActionBase.java dba517c7527d71637239483dbe15b447fd1e6b19 GREEN
EReferenceListPropertySectionBase.java 7390dd7bfdc979e8ff0c5c30c67ab7b6c9d70c92 GREEN
EReferencePropertySectionBase.java 0548da6778516003257f59d0b4c2b60d458be3b6 GREEN
EditorBase.java 9c09fff92945256bb8680992ae7bb2c78f47b150 GREEN
FXEditorBase.java 40caf638c7b4c02da5aece0d9d58883bce630e76 GREEN
FXEditorBase.java 659e123d09f500a1df5aac41a4d4a52bc9cd9b10 YELLOW
IListPropertySection.java 8bb00fe7959583e794ff9437b7a77404c9a9e70f GREEN
LWFXEFEditorBase.java 467367f3e9dcf90eff57e268a7e12d8c9f33a836 GREEN
ModelEditorBindingBase.java b9b1a1c5a48a6e677d1f57ad55a6126d9703c4b5 GREEN
......
......@@ -15,6 +15,8 @@
+--------------------------------------------------------------------------*/
package org.fortiss.tooling.kernel.ui.extension.base;
import static org.fortiss.tooling.base.utils.SystemUtils.isLinuxPlatform;
import java.util.ArrayList;
import java.util.List;
......@@ -48,6 +50,20 @@ public abstract class FXEditorBase<T extends EObject> extends EditorBase<T>
Scene scene = new Scene(createSceneRoot());
canvas.setScene(scene);
getSite().setSelectionProvider(this);
// Work around a bug in FXCanvas or SWT on Linux, where
// scrolling does not work.
// On Linux, FXCanvas receives a start gesture event when
// the mouse is clicked. It disables scrolling while the
// gesture is ongoing. However, the gesture end event never
// arrives. As a result, scrolling is disabled after the first
// mouse click. This work-around simply filters out all gesture
// events, which should not be used in the FX part currently.
if(isLinuxPlatform()) {
canvas.getDisplay().addFilter(SWT.Gesture, e -> {
e.type = SWT.NONE;
});
}
}
/** Creates the root node of the scene. */
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment