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

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

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P2 P2
    • 7u6
    • fx2.1
    • javafx
    • win7, MacOS 10.6.8 / 10.7
      jdk7

      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.

            gziemski Gerard Ziemski
            gziemski Gerard Ziemski
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported: