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

Input lag could be reduced for QML

    XMLWordPrintable

Details

    • Android, Windows

    Description

      QML applications in both Windows and Android have a big input latency on 60 Hz screens, creating a worse UX for users than what is offered by Qt Widgets on Windows or native apps on Android. You can reproduce the problem easily by compiling the qml file below, then moving the mouse around the screen and seeing that the rectangle lags behind the mouse. I wasn't able to reproduce the same issue on macOS though, where the rectangle keeps up fairly close with the mouse movement (why isn't it a problem on macOS?). If you disable VSync, the problem goes way, so the issue might be caused by the VSync blocking the render thread, which will in turn block the UI thread and stall event processing; but disabling VSync is not an option since animations will stop running smoothly and we could introduce tearing.

      What we could do instead is to introduce the APIs for VSync synchronization native to each platform - IDXGIOutput::WaitForVBlank on Windows and Choreographer on Android - to solve the animation issues and disable vsync if the system compositor already solves the tearing issue.

       

      import QtQml.Models
      import QtQuick
      import QtQuick.Window
      import QtQuick.Controls
      import QtQuick.Layouts
      
      Window {
          id: window
          visible: true
          width: 640
          height: 480
          title: "QtQuickApplication1"
          
          Rectangle {
              color: "gray"
              width: 40
              height: 40
              x: ma.point.position.x - width / 2
              y: ma.point.position.y - height / 2
          }
          HoverHandler {
              id: ma
          }
      } 

      Attachments

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

        Activity

          People

            qt.team.quick.subscriptions Qt Quick and Widgets Team
            felipef Felipe Goron Farinon
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes