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

Qt Quick Application that is set as the Windows 10 shell intermittently starts with lack of touch input handling

    XMLWordPrintable

Details

    • Windows

    Description

      We have a Qt Quick based application that replaces explorer.exe as the Shell (i.e. HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\WinLogon\Shell) in a Windows 10-based embedded system.

      Intermittently (as high as 30% of the time on some systems, <1% of the time on other systems) we experience the following symptoms:

      • On boot up and application launch, the application does not respond to touch input.
      • Anywhere between 1 and 5 minutes later, the application begins properly responding to touch input events
      • When in this lack-of-touch state, we can launch another application and see that touch input is properly handled by that application. We've tested this with both another (much simpler) Qt based application of our own and with a third party non-Qt-based application.
      • When setting the shell to another application we never see the intermittent lack-of-touch bug. We've tested this with the same two applications as above.

      Enabling qt.qpa.*=true log messages and adding logging to our application like this during startup (after the main window has been shown) and then periodically every 5 seconds:

      LOGDBG() << QTouchDevice::devices().count() << "touch device(s) detected";
      

      Shows the following when the problem occurs:

      20220114-13:00:11:050 | 4156 | debug | general.TouchDeviceDiagnostic: 0 touch device(s) detected
      ...
      20220114-13:00:12:155 | 4156 | debug | qt.qpa.events: Digitizers: 0x41 Ready: 0x80 Tablet PC: 1 Max touch points: 10
      ...
      20220114-13:00:16:072 | 4156 | debug | general.TouchDeviceDiagnostic: 1 touch device(s) detected 

      By looking at Qt's touch device registration in QWindowsContext::windowsProc and QWindowsContext::initTouch we've come up with the following workaround that runs at startup after the main window has been shown:

      LOGDBG() << QTouchDevice::devices().count() << "touch device(s) detected";
      
      #ifdef Q_OS_WIN
      auto hwnd = getNativeWindow();
      LOGDBG() << "Sending fake WM_DEVICECHANGE message";
      SendMessage(hwnd, WM_DEVICECHANGE, DBT_DEVNODES_CHANGED, 0);
      #endif
      

      Attachments

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

        Activity

          People

            owolff Oliver Wolff
            tbraunjones_gentuity Taylor Braun-Jones
            Votes:
            1 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes