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

Setting Qt::WindowStaysOnTopHint/Qt::WindowStaysOnBottomHint breaks winId

    XMLWordPrintable

Details

    • Linux/X11

    Description

      I attached an example program which works correctly under Qt 5 and fails under Qt 6. On Qt 5, two windows, one entirely native X11, and one rendering inside a QWindow, display a red and a blue moving square. On Qt 6 the QWindow one does not display anything.

      When

      win.setFlags(win.flags() | Qt::WindowStaysOnTopHint);

      is called, it seems that in Qt 6 the winId is invalidated - in this example it's not really problematic but it is much more when one has to pass the winId to an external API which does not support reloading it after the fact. For instance in my case the software allows to set whether the windows always stay on top as a user preference which can be changed mid-flight.

      Attachments

        1. qtbug106033.zip
          2 kB
        2. QTBUG-106033.tar.gz
          1 kB
        3. main.cpp
          2 kB

        Issue Links

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

          Activity

            People

              liaqi Liang Qi
              jcelerier Jean-Michaël Celerier
              Votes:
              0 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

                Created:
                Updated:

                Gerrit Reviews

                  There are no open Gerrit changes