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

QCursor::setPos leads to self-notification on Mac

    XMLWordPrintable

Details

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

    Description

      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.

      Attachments

        Issue Links

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

              frederik Frederik Gladhorn
              danny77uk Daniel
              Votes:
              5 Vote for this issue
              Watchers:
              10 Start watching this issue

              Dates

                Created:
                Updated:

                Gerrit Reviews

                  There are no open Gerrit changes