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

In PopupMode on TouchEvent two MouseButtonPress events only one Release

    XMLWordPrintable

Details

    • Windows

    Description

      Condition to reproduce error:
      QApplicationPrivate::inPopupMode() == true ** e.g. a contextmenu is open

      If a popup is displayed and a touch event occurs outside the menu e.g. on the background widget this event is ignored. On Microsoft Windows the touchdevice generates after the touch event a mousebuttonpress event. This event is forwarded to the menu, which hides the popup, also the mousebuttonrelease event is send to the popup. In QWidgetWindow::handleMouseEvent a comment can be find "// the popup disappeared, replay the mouse press event". The following code will generate a new MousePressEvent which is posted in the eventloop. Because the popup window is already closed the mousepressevent is forwarded to the background widget where the user touched  the screen. Problem, no mousereleaseevent is send to this widget.

      In the simple example attached the background widget changes its color depending on the incomming event. On MouseButtonPress color is set to green, on MouseButtonRelease to red. As you can see, only a MousePressEvent reaches the widget, color is set to green.
      If the user touched the button "pushMe", the button stays in state "pressed"

      Attachments

        1. qtDemo.cpp
          4 kB
        2. qtbug129311.zip
          2 kB
        3. CMakeLists.txt
          1 kB
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            fredericl Frederic Lefebvre
            sc_marku Markus Schmidt
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes