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

Mouse release events missing when closing popup window

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P3: Somewhat important
    • None
    • 5.4.1, 5.6
    • None
    • Windows 7 x64, Visual Studio 2010 x64

    Description

      The following steps reproduce the issue:

      • Open a popup widget (setWindowFlags(Qt::Popup)). (Right click, in the attached test application.)
      • Click outside the popup widget, inside the main window.
      • The main window now correctly receives a QEvent::MouseButtonPress event, but it does not always receive a QEvent::MouseButtonRelease event.
      • Even QApplication::mouseButtons() keeps thinking the mouse button is down.

      This only seems to happen if the click is very short, or more accurately, it seems to relate to the rate at which the event queue is processed. If I deliberately slow the event processing down by sleeping in an idle timer (as in the attached example), the bug occurs more often and can be easily reproduced. I feel that it happens only if the press and release events happen to be handled in the same iteration of event queue processing, but that is just a guess.

      I first noticed the issue with 5.4.1 and reproduced it in 5.6 (built from git, f8ae5ee3b624e65c7bc1fe7c76d0004b5ff9f894).

      I attempted to reproduce it on Scientific Linux 6 too. There neither the pressed or released event occur, but I think that is by design.

      Attachments

        Issue Links

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

          Activity

            People

              qt.team.quick.subscriptions Qt Quick and Widgets Team
              pvandertak Peter van der Tak
              Votes:
              1 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:

                Gerrit Reviews

                  There are no open Gerrit changes