Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-33959

QCursor::setPos leads to self-notification on Mac

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: P2: Important P2: Important
    • None
    • 5.1.1
    • QPA
    • None
    • OSX 10.8
    • macOS

      QCursor::setPos uses CGEventCreateMouseEvent (qcocoacursor.mm) which causes mouseMove events to be delivered to Qt.

      In our application, we use an arcball to navigate a 3D scene and use the 'mouse look' technique to hide and reset the mouse cursor to the center of the screen to prevent it hitting the screen boundary during mouse moves.

      On Windows, this works as expected because Win32's SetCursorPos sets the cursor position immediately.

      On Mac, the performance is terrible. Movements are laggy and the scene continues to rotate long after releasing the mouse. This is because of the mouseMove events being delivered to our code by QCursor::setPos.

      CGWarpMouseCursorPosition does the same thing as SetCursorPos and fixed the issue.

      Qt should not be using CGEventCreateMouseEvent.

        For Gerrit Dashboard: QTBUG-33959
        # Subject Branch Project Status CR V

            vestbo Tor Arne Vestbø
            danny77uk Daniel
            Votes:
            5 Vote for this issue
            Watchers:
            11 Start watching this issue

              Created:
              Updated:

                There is 1 open Gerrit change