| Summary: | Call to java.awt.MouseInfo.getPointerInfo() needs to be removed from FXHoverBehavior | ||
|---|---|---|---|
| Product: | [Tools] GEF | Reporter: | Alexander Nyßen <nyssen> |
| Component: | GEF MVC | Assignee: | gef-inbox <gef-inbox> |
| Status: | RESOLVED FIXED | QA Contact: | |
| Severity: | critical | ||
| Priority: | P3 | CC: | matthias.wienand |
| Version: | unspecified | ||
| Target Milestone: | 3.10.0 (Mars) M3 | ||
| Hardware: | PC | ||
| OS: | Mac OS X | ||
| Whiteboard: | |||
|
Description
Alexander Nyßen
Glass detected outstanding Java exception at -[GlassViewDelegate sendJavaMouseEvent:]:src/com/sun/mat/ui/GlassViewDelegate.m:543 Exception in thread "JavaFX Application Thread" java.awt.HeadlessException at java.awt.MouseInfo.getPointerInfo(MouseInfo.java:74) at org.eclipse.gef4.mvc.fx.behaviors.FXHoverBehavior.onHoverChange(FXHoverBehavior.java:159) at org.eclipse.gef4.mvc.behaviors.HoverBehavior.propertyChange(HoverBehavior.java:82) at java.beans.PropertyChangeSupport.fire(PropertyChangeSupport.java:335) at java.beans.PropertyChangeSupport.firePropertyChange(PropertyChangeSupport.java:327) at java.beans.PropertyChangeSupport.firePropertyChange(PropertyChangeSupport.java:263) at org.eclipse.gef4.mvc.models.HoverModel.setHover(HoverModel.java:84) at org.eclipse.gef4.mvc.policies.HoverPolicy.hover(HoverPolicy.java:20) at org.eclipse.gef4.mvc.fx.policies.FXHoverOnHoverPolicy.hover(FXHoverOnHoverPolicy.java:30) at org.eclipse.gef4.mvc.fx.tools.FXHoverTool$1.handle(FXHoverTool.java:86) at org.eclipse.gef4.mvc.fx.tools.FXHoverTool$1.handle(FXHoverTool.java:1) at com.sun.javafx.event.CompositeEventHandler.dispatchCapturingEvent(CompositeEventHandler.java:78) at com.sun.javafx.event.EventHandlerManager.dispatchCapturingEvent(EventHandlerManager.java:202) at com.sun.javafx.event.EventHandlerManager.dispatchCapturingEvent(EventHandlerManager.java:159) at com.sun.javafx.event.CompositeEventDispatcher.dispatchCapturingEvent(CompositeEventDispatcher.java:22) at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:31) at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:92) at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:35) at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:92) at com.sun.javafx.event.EventUtil.fireEventImpl(EventUtil.java:53) at com.sun.javafx.event.EventUtil.fireEvent(EventUtil.java:33) at javafx.event.Event.fireEvent(Event.java:171) at javafx.scene.Scene$MouseHandler.process(Scene.java:3311) at javafx.scene.Scene$MouseHandler.process(Scene.java:3151) at javafx.scene.Scene$MouseHandler.access$1900(Scene.java:3106) at javafx.scene.Scene.impl_processMouseEvent(Scene.java:1563) at javafx.scene.Scene$ScenePeerListener.mouseEvent(Scene.java:2248) at com.sun.javafx.tk.quantum.GlassViewEventHandler$MouseEventNotification.run(GlassViewEventHandler.java:250) at com.sun.javafx.tk.quantum.GlassViewEventHandler$MouseEventNotification.run(GlassViewEventHandler.java:173) at java.security.AccessController.doPrivileged(Native Method) at com.sun.javafx.tk.quantum.GlassViewEventHandler.handleMouseEvent(GlassViewEventHandler.java:292) at com.sun.glass.ui.View.handleMouseEvent(View.java:530) at com.sun.glass.ui.View.notifyMouse(View.java:924) Up to now, added a platform specific workaround for Mac:
// FIXME: platform specific workaround for Mac
String osName = System.getProperty("os.name").toLowerCase();
if (osName.startsWith("mac os x")) {
com.sun.glass.ui.Robot robot = com.sun.glass.ui.Application.GetApplication().createRobot();
initialPointerLocation = new Point(robot.getMouseX(), robot.getMouseY());
} else {
initialPointerLocation = java.awt.MouseInfo.getPointerInfo() .getLocation();
}
I further ensured the workaround is only used if the bundle is not activated (i.e. we run in standalone mode), because otherwise it does not work properly within eclipse. I replaced the code to get the initial (current) mouse pointer location using AWT by using the first location reported by JavaFX when the mouse moves as the initial pointer location. The code is published on the master branch, therefore I resolve this ticket as fixed for target milestone 3.10.0M3, sorry for the inconvenience. |