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

QWidget stops getting mouseMoveEvent when focus is restored on MacOS



    • 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:
    • Platform/s:


      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 briefly to the Finder app (during the mission control animation) 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?


          Issue Links

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



              qt.team.quick.subscriptions Qt Quick and Widgets Team
              ahi Adriel Jr.
              0 Vote for this issue
              0 Start watching this issue



                  Gerrit Reviews

                  There are no open Gerrit changes