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

Input doesn't work after animation when QSG_NO_VSYNC is set

    XMLWordPrintable

Details

    • macOS

    Description

      When setting

      qputenv("QSG_NO_VSYNC", "1"); 
      

      or either using QSurfaceFormat, and animating the window, input text stops working, as well as mouse hover and press events (click events seems to work).

      I attached a video showing the problem.

      Here's a very simple way to reproduce the issue on macOS:

      main.cpp

      #include <QGuiApplication>
      #include <QQmlApplicationEngine>
      
      int main(int argc, char *argv[])
      {
          qputenv("QSG_NO_VSYNC", "1");    QGuiApplication app(argc, argv);    QQmlApplicationEngine engine;
          QObject::connect(
              &engine,
              &QQmlApplicationEngine::objectCreationFailed,
              &app,
              []() { QCoreApplication::exit(-1); },
              Qt::QueuedConnection);
          engine.loadFromModule("testInputAfterAnimationQML", "Main");    return app.exec();
      } 

      Main.qml

      import QtQuick
      import QtQuick.Controls 2.15
      
      Window {
          id: window
          width: 400
          height: 400
          visible: true
          title: qsTr("Hello World")    
      
          Behavior on width {
              SpringAnimation {
                  spring: 6
                  damping: 0.2
              }
          }    
      
          Behavior on x {
              SpringAnimation {
                  spring: 6
                  damping: 0.2
              }
          }    
      
         Column {
              anchors.centerIn: parent        
               Button {
                  id: testButton
                  text: "Click me"
                  onClicked: {
                      window.width += 200;
                      window.x -= 100;
                  }
              }        
              TextArea {
                  placeholderText: "Try to type here"
              }
          }
      } 

       

      The issue is not present on Windows 11 in my tests.

      Attachments

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

        Activity

          People

            vestbo Tor Arne Vestbø
            rubymamis Ruby Mamistvalove
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes