changeset 9455:71a5499bcda4 jdk-9+97

8144688: JFX WebView DRT implementation doesn't pass mouse button for mousemove simulation Reviewed-by: azvegint, ghb, kcr Contributed-by: arunprasad.rajkumar@oracle.com
author azvegint
date Mon, 14 Dec 2015 10:38:53 +0300
parents cb8a24f5db2a
children d4b3b404de01 4612daff0009
files modules/web/src/main/java/com/sun/javafx/webkit/drt/EventSender.java
diffstat 1 files changed, 9 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/modules/web/src/main/java/com/sun/javafx/webkit/drt/EventSender.java	Fri Dec 11 12:28:01 2015 +0300
+++ b/modules/web/src/main/java/com/sun/javafx/webkit/drt/EventSender.java	Mon Dec 14 10:38:53 2015 +0300
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -94,6 +94,11 @@
     private boolean mousePressed;
 
     /**
+     * The type of mouse button.
+     */
+    private int mouseButton = WCMouseEvent.NOBUTTON;
+
+    /**
      * The time offset for events.
      */
     private long timeOffset;
@@ -145,6 +150,7 @@
      * methods of the DRT event sender object.
      */
     private void mouseUpDown(int button, int modifiers) {
+        mouseButton = button;
         mousePressed = isSet(modifiers, PRESSED);
         dispatchMouseEvent(mousePressed
                 ? WCMouseEvent.MOUSE_PRESSED
@@ -160,7 +166,8 @@
         mousePositionY = y;
         dispatchMouseEvent(mousePressed
                 ? WCMouseEvent.MOUSE_DRAGGED
-                : WCMouseEvent.MOUSE_MOVED, 0, 0, 0);
+                : WCMouseEvent.MOUSE_MOVED, 
+                (mousePressed ? mouseButton : WCMouseEvent.NOBUTTON), 0, 0);
     }
 
     /**