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

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

XMLWordPrintable

    • Linux/X11

      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.

        1. main.cpp
          2 kB
        2. QTBUG-106033.tar.gz
          1 kB
        3. qtbug106033.zip
          2 kB
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            axelspoerl Axel Spoerl
            jcelerier Jean-Michaël Celerier
            Votes:
            0 Vote for this issue
            Watchers:
            8 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes