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

Missing touchPointReleased makes touch ids never expire

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P1: Critical
    • 5.5.0
    • 5.0.1, 5.1.0 Beta 1, 5.5.0 Alpha
    • None
    • 53d289ec4c0f512a3475da4bbf1f940cd6838ace

    Description

      Using the fingerpaint example:

      1. Drag your finger in the paint area (you should see a strip of paint).
      2. Open any of the drop down menus at the top left of the screen (the one pressed should open)
      3. Try to drag your finger in the paint area (I only see a dot where it started then I see the menu, that was open, close.)

      Using the lineedits example:

      1. Open any lineedit (it should open)
      2. Press somewhere else in the window (the lineedit should close)
      3. Open another line edit
      4. Repeat steps 1 through 3, at some point a line edit will start opening or closing even though you had not pressed it.

      Using the fridgemagnets example:

      1. Drag any item anywhere.
      2. Lift your finger
      3. Put your finger down somewhere else from where you lifted, and you will see the magnet "fly" to where your finger is. You can never grab any other magnet, you can only move the first one you grabbed.

      What seems to be happening (as far as I can figure), is that code in qwidget.cpp and qwidget_qpa.cpp is calling setMouseGrabEnabled and setKeyboardGrabEnabled to try and steal focus from the popup that should go away and give it to the popup that is to open.
      That is not what happens though. X is getting the message to give up the keyboard/mouse and is thus setting that clients xi2mask to 0x0 (since a window that does not have focus shouldn't be listening to events), and then X gets the message to give focus to another "window" (in reality they are the same window). The problem lies in the fact that during that period of nebulous focus an XI_TouchEnd (or XI_TouchUpdate or XI_TouchBegin) can happen and Qt will miss it. When Qt misses the XI_TouchEnd, then the code in qtbase/src/plugins/platforms/xcb/qxcbconnection_xi2.cpp (xi2HandleEvent) doesn't know to remove that id from the m_touchPoints QList, and as a result every subsequent update in that function (basically anytime an XI2 event happens) will see the for loop send that (now stale) touch along as if it is still active.

      I don't fully understand this, but it seems that Qt shouldn't be giving up focus to give it right back when they are both (according to xcb anyway) the same window.

      Small side note, the plugin EvdevTouch (which would seem the natural way to do this) does not support rotation, and I need rotation.

      If you need even more detail just let me know. (e.g. configure options passed to the X applications, other X components I am using).

      Attachments

        Issue Links

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

          Activity

            People

              srutledg Shawn Rutledge
              jaylester Jay Lester
              Votes:
              2 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes