Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8118048

Mac: Glass robot on Mac doesn't produce drag event

    XMLWordPrintable

    Details

      Description

      Run attached code snippet on Windows and Mac. It tries to imitate drag event using glass robot by calling

                      robot.mouseMove(x + 10, y + 10);
                      robot.mousePress(1);
                      robot.mouseMove(x + 10 + N, y + 10 + N); // in loop

      on Windows this works perfectly showing next events:

      # MouseEvent [source = Rectangle@13f7175, target = Rectangle@13f7175, eventType = MOUSE_MOVED, consumed = false, x = 10.0, y = 10.0, button = NONE]
      # MouseEvent [source = Rectangle@13f7175, target = Rectangle@13f7175, eventType = MOUSE_PRESSED, consumed = false, x = 10.0, y = 10.0, button = PRIMARY, primaryButtonDown]
      # MouseEvent [source = Rectangle@13f7175, target = Rectangle@13f7175, eventType = MOUSE_DRAGGED, consumed = false, x = 20.0, y = 20.0, button = PRIMARY, primaryButtonDown]
      # MouseEvent [source = Rectangle@13f7175, target = Rectangle@13f7175, eventType = DRAG_DETECTED, consumed = false, x = 20.0, y = 20.0, button = PRIMARY, primaryButtonDown]
      # MouseEvent [source = Rectangle@13f7175, target = Rectangle@13f7175, eventType = MOUSE_DRAGGED, consumed = false, x = 25.0, y = 25.0, button = PRIMARY, primaryButtonDown]

      on Mac mouse_moved events being produced instead of mouse_dragged:

      # MouseEvent [source = Rectangle@299320cf, target = Rectangle@299320cf, eventType = MOUSE_ENTERED, consumed = false, x = 10.0, y = 10.0, button = NONE, primaryButtonDown]
      # MouseEvent [source = Rectangle@299320cf, target = Rectangle@299320cf, eventType = MOUSE_MOVED, consumed = false, x = 10.0, y = 10.0, button = NONE, primaryButtonDown]
      # MouseEvent [source = Rectangle@299320cf, target = Rectangle@299320cf, eventType = MOUSE_PRESSED, consumed = false, x = 10.0, y = 10.0, button = PRIMARY, primaryButtonDown]
      # MouseEvent [source = Rectangle@299320cf, target = Rectangle@299320cf, eventType = MOUSE_MOVED, consumed = false, x = 30.0, y = 30.0, button = NONE, primaryButtonDown]
      # MouseEvent [source = Rectangle@299320cf, target = Rectangle@299320cf, eventType = MOUSE_MOVED, consumed = false, x = 35.0, y = 35.0, button = NONE, primaryButtonDown]
      # MouseEvent [source = Rectangle@299320cf, target = Rectangle@299320cf, eventType = MOUSE_MOVED, consumed = false, x = 40.0, y = 40.0, button = NONE, primaryButtonDown]

      although dragging "by hands" without robot works correctly.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              pchelko Petr Pchelko (Inactive)
              Reporter:
              sgrinev Sergey Grinev (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Imported: