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

[eglfs] Race condition between window system events and input events

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P1: Critical
    • 5.6.3
    • 5.7.0
    • QPA: EGLFS
    • Boot2Qt 5.7 on imx6 with touchscreen
    • cff48c7845ccf51ac53a550a43dec78428124f70

    Description

      Input events could potentially be sent to the wrong window when a modal dialog is triggered on eglfs, but not on XCB or Windows.

      The problem can be QWindowSystemInterface::flushWindowSystemEvents() calls in the QPlatformWindow::setVisible() implementation of eglfs. If the flushWindowSystemEvents() is changed to flushWindowSystemEvents(QEventLoop::ExcludeUserInputEvents), then the behaviour is correct.

      It can be, that without the QEventLoop::ExcludeUserInputEvents flag, it's effectively a race between showing the window and reacting to input events. This is especially obvious when we rapidly click/tap some UI component to cause a modal dialog to be created, some of those input events could be processed even before the modal dialog is shown. This could cause the modal dialog to show behind the window/widget that was clicked/tapped on with eglfs for example.

      The attached demo shows a push button that creates a modal dialog when pushed, the dialog would show the number of nested exec()s being executed due to failure to block events going to the push button in time. If you click/tap the push button in rapid fashion, the "depth" value can get pretty big quickly.

      It seems to be a bug to omit QEventLoop::ExcludeUserInputEvents from flushWindowSystemEvents().

      Attachments

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

        Activity

          People

            lagocs Laszlo Agocs
            karimpinter Karim Pinter (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes