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

Possible flaw in macOS qnsview_mouse.mm implementation

    XMLWordPrintable

Details

    • macOS

    Description

      The code in question is about:
      https://github.com/qt/qtbase/blob/6.8.3/src/plugins/platforms/cocoa/qnsview_mouse.mm#L500

      Consider 1 QWidget overlaps the other. And the one on top is transparent to mouse event. Moving mouse around the overlapping area, then the consequence is:
      1. Top widget first becomes QCocoaWindow::s_windowUnderMouse. But mouse event passes through.
      2. Bottom widget then also becomes QCocoaWindow::s_windowUnderMouse, and top widget becomes windowToLeave
      3. In that case,

      QWindowSystemInterface::handleEnterLeaveEvent(QCocoaWindow::s_windowUnderMouse->window(), windowToLeave->window(), windowPoint, screenPoint);
      

      will be triggered. Then we are leaving top widget and entering bottom widget.
      4. As long as mouse is moving around, steps 1~3 are going to be triggered indefinitely.

      So is "indefinitely spamming enter/leavrEvent"a problem? Or is such design (overlapping widget while the top one let mouse events through) actually someone should never do?

      Attachments

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

        Activity

          People

            axelspoerl Axel Spoerl
            luqiaochen Luqiao Chen
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes