eclipse-gef / gef

Eclipse GEF™
https://www.eclipse.org/gef/
Eclipse Public License 2.0
117 stars 55 forks source link

Java11/efxclipse/: PanOnStrokeHandler causes Canvas focuslost (DNDTabPane gains focus) #100

Closed ShawnKleese closed 4 years ago

ShawnKleese commented 4 years ago

Hello,

we use GEF MVC in a efxclipse App and since we upgraded to Java 11 from Java 8 we have Problems with the PanOnStrokeHandler.

After one KeyEvent roundtrip through PanOnStrokeHandler the Event will consumed by the DNDTabPane to change the selected Tab. When the Tab is selected it gets the focus and the events are all consumed by the DNDTabPane, so you cannot use the Arrow Keys to move the Viewport.

I'm just a little bit cunfused, while i don't understand how it has ever worked...? The Java8 DNDTabPane has also KeyBindings.

Should the TypeStrokeGesture consume all KeyEvents when the Viewer is focused?

I've tried to overwrite the PanOnStrokeHandler and consumed the KeyEvents and it is slighly better but now there are some Issues with the placement of the Viewport. (sometimes it goes to the right/left/top/Bottom-Corner)

Do anybody have the same Issue or a Idea to solve this Issue ?

ShawnKleese commented 4 years ago

I have solved my Problem by overriding the PanOnStrokeHandler and added on all KeyEvent methods (press, release) a "event.consume();" The Issue i had with the placement of my viewport was a bug on my site...