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

QWidget stops getting mouseMoveEvent when focus is restored on MacOS

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Not Evaluated
    • Resolution: Duplicate
    • Affects Version/s: 5.6.3, 5.12.0
    • Fix Version/s: None
    • Component/s: Widgets: Main Window
    • Labels:
      None
    • Platform/s:
      macOS

      Description

      Sometimes (maybe 1 in every 10 attempts), mouseMoveEvent stops being called when windows focus is restored on MacOS (I am using High Sierra, but it was also affecting older versions). When it happens, the only way to restore mouseMoveEvent calls is to move the mouse out of the window and back again. Everything else works fine, but mouseMoveEvent functionality is not restored unless we to that.

      It is quite simple to reproduce this issue since it affects some of the Qt Examples like 40000 chips.

      I made a video to demonstrate the issue. Initially, the chips change the color when the mouse is over them, but after switching the focus to the Finder app and restoring the focus, the chips stop changing the color when the mouse moves (all other functionalities, like the buttons still work though). It starts to work again once the cursor move outside the window.

      In my application it is a big deal since I have a QGraphisView with zoom functionality using the mouse wheel. Since mouseMoveEvent is not called to set the current mouse position, when the user try to zoom in/out it will use as centre of the transformation not the current mouse location (assuming AnchorUnderMouse), but the previous one, before the window lost its focus.

      Update: Even QApplication::notify() doesn't get the mouse move events. Is it a QT or MacOS bug?

        Attachments

        1. QtRestoreFocusBug.mp4
          3.89 MB
          Adriel Jr.

          Issue Links

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

            Activity

              People

              • Assignee:
                qt.team.quick.subscriptions Qt Quick and Widgets Team
                Reporter:
                ahi Adriel Jr.
              • Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Gerrit Reviews

                  There are no open Gerrit changes