modules/graphics/src/main/java/com/sun/javafx/tk/quantum/GlassViewEventHandler.java
Print this page
*** 32,41 ****
--- 32,42 ----
import com.sun.glass.events.TouchEvent;
import com.sun.glass.events.SwipeGesture;
import com.sun.glass.ui.Accessible;
import com.sun.glass.ui.Clipboard;
import com.sun.glass.ui.ClipboardAssistance;
+ import com.sun.glass.ui.Screen;
import com.sun.glass.ui.View;
import com.sun.glass.ui.Window;
import com.sun.javafx.PlatformUtil;
import com.sun.javafx.collections.TrackableObservableList;
import com.sun.javafx.logging.PulseLogger;
*** 430,443 ****
stage.setInAllowedEventHandler(true);
}
QuantumToolkit.runWithoutRenderLock(() -> {
return AccessController.doPrivileged((PrivilegedAction<Void>) () -> {
if (scene.sceneListener != null) {
Window w = view.getWindow();
! double pScale = (w == null) ? 1.0 : w.getPlatformScale();
scene.sceneListener.menuEvent(x / pScale, y / pScale,
! xAbs / pScale, yAbs / pScale,
isKeyboardTrigger);
}
return null;
}, scene.getAccessControlContext());
});
--- 431,458 ----
stage.setInAllowedEventHandler(true);
}
QuantumToolkit.runWithoutRenderLock(() -> {
return AccessController.doPrivileged((PrivilegedAction<Void>) () -> {
if (scene.sceneListener != null) {
+ double pScale, sx, sy;
Window w = view.getWindow();
! if (w != null) {
! pScale = w.getPlatformScale();
! Screen scr = w.getScreen();
! if (scr != null) {
! sx = scr.getX();
! sy = scr.getY();
! } else {
! sx = sy = 0.0;
! }
! } else {
! pScale = 1.0;
! sx = sy = 0.0;
! }
scene.sceneListener.menuEvent(x / pScale, y / pScale,
! sx + (xAbs - sx) / pScale,
! sy + (yAbs - sy) / pScale,
isKeyboardTrigger);
}
return null;
}, scene.getAccessControlContext());
});