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

MacOS: mouse button state can be wrong

    XMLWordPrintable

Details

    • macOS
    • 39be577cc2dee415129d34afffc0b3509371db68 e3cbf0f1962958457f6e09fcfdc92d8cac4b6511

    Description

      Run the attached sample. Then do this:
      1) click shortly inside the window, without moving the mouse before releasing the mouse button.
      2) under 1 second after releasing the mouse button, move the mouse.
      ...Q_ASSERT is triggered. This means the mouse button state is not synced with the move event.

      In my sample application, the qSleep(1000) is to simulate any application procedure that would take time. After that procedure, the application receive a mouse move event with a wrong button state, and that can cause trouble.

      This only happens on the Mac, however I think the problem lies in:

      qtbase\src\gui\kernel\qguiapplication.cpp
      in method QGuiApplicationPrivate::processMouseEvent

      The line:

      mouse_buttons = buttons = e->buttons;

      is not executed for a pure move event. I think this is wrong.

      By moving this line so that it is always executed, the problem is solved.

      Attachments

        Issue Links

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

          Activity

            People

              sorvig Morten Sørvig
              jirauser26727 user-04d21 (Inactive)
              Votes:
              7 Vote for this issue
              Watchers:
              14 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes