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

QXcbConnection::getTimestamp() returns old timestamp

    XMLWordPrintable

Details

    • 02248eea5562c1df39ee23f195011afacc6759b0 (qt/qtbase/dev) 73fc1f93e8bea1c493ed16655ad6fd68ae270e38 (qt/qtbase/5.12) bc60541d9f9fb477172ab08b41f45b7f95033c48 (qt/qtbase/6.1) 865a713d6bded5d19a64077a17b9295bbeb3b699 (qt/qtbase/6.2), 03ac8c739 (dev)

    Description

      QXcbConnection::getTimestamp() returns a timestamp from an earlier PropertyNotify event which was already in the event queue. I found this issue when I was trying to figure out why gvim (with GTK+) exits with a BadWindow error when selecting or copying a large text to the clipboard in a KDE environment. It turns out that GTK+ uses the INCR protocol to send the data and QT uses getTimestamp (in QXcbClipboard::clipboardReadProperty) to set the start time of the transfer. Since that start time is incorrect QT expects data which hasn't been sent yet and closes the window. GTK+ still tries to add the data to the window which causes a BadWindow error.

      Steps to reproduce:

      1. Create or use a large text file (e.g. cat /dev/urandom|base64 -w 200|head -n 5000>large_text_file).
      2. Open the text file in gvim (or another GTK+ based editor, as long as it uses the same clipboard mechanism).
      3. Start a Qt based text editor.
      4. In gvim, select and copy all text.
      5. Paste the text in the Qt based text editor.

      Note that when a clipboard manager like klipper is used, which automatically copies text to the clipboard, the problem occurs immediately after selecting the text.

      Attachments

        Issue Links

          For Gerrit Dashboard: QTBUG-56595
          # Subject Branch Project Status CR V

          Activity

            People

              liaqi Liang Qi
              ps0 Patrick Smits
              Votes:
              12 Vote for this issue
              Watchers:
              20 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: