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

QApplication::mouseButtons() not updated when window gets focus

    XMLWordPrintable

Details

    • Bug
    • Resolution: Invalid
    • P3: Somewhat important
    • None
    • 4.8.5, 5.1.0
    • None
    • Linux (OpenSuse). Qt 4.8.5 packages provided by the distribution, Qt5 compiled from source.

    Description

      The attached test case displays the current state of the left and right mouse buttons as reported by QApplication::mouseButtons() (updated every 100 ms).

      Incorrect behavior can be found in Qt 4.8.5 and a recent checkout of the Qt5 'dev' branch (be sure to add "QT += widgets" to the auto-generated .pro file):

      (a) Right-click the label, such that a context menu appears. Then close the menu by left-clicking another application's window. Note that the "pressed" state for the left button is enabled on mouse press, but does not change any more after that because the test app has lost focus before the button is released. The bad thing about this is that the test app may re-gain the focus via the keyboard and then still maintain the incorrect mouse button state.

      (b) Drag anything from another application and hover the test app's window. Note that the mouse button state is not updated.

      This might or might not be related to https://bugreports.qt-project.org/browse/QTBUG-16635

      These issues were reported for Dolphin:

      https://bugs.kde.org/show_bug.cgi?id=271325
      https://bugs.kde.org/show_bug.cgi?id=322644

      Attachments

        Issue Links

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

          Activity

            People

              paeglis Gatis Paeglis
              freininghaus Frank Reininghaus
              Votes:
              1 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes