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

windowState still is minimized after restoring a programmatically minimized window

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • P2: Important
    • None
    • 5.15.2, 6.1.2
    • QPA: X11/XCB
    • None
    • KDE 5.22.4 on Arch Linux, using X11.
    • Linux/X11

    Description

      When I set my window to be minimized with
      win->setWindowState(Qt::WindowState::WindowMinimized), then restore it by clicking on its icon in my KDE (5.22.4) panel, the windowState is still Qt::WindowState::WindowMinimized after restoring it. This is not right, Qt should unset the minimized state when its window is no longer minimized.

      To reproduce: Build and run the sample under either Qt 5 or 6 on KDE/KWin/X11 and click the "Minimize me" button, wait a couple of seconds, and restore it. The windowState shown will still be 1 (minimized) even after you restore the window. Also, the "Minimize me" button will no longer have any effect, since Qt thinks the window is still minimized.

      It is possible to work around this problem by asking Qt to setWindowState(windowState() & ~Qt::WindowState::WindowMinimized) before minimizing again, but this is a hack.

      Downstream bug: https://github.com/kraxarn/spotify-qt/issues/103

      I am unsure if this is the same bug as QTBUG-69711. If it is, here's a different sample showing the same underlying bug I guess.

      Attachments

        1. qtbug.cpp
          0.9 kB
        2. qtbug.pro
          0.7 kB
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            liaqi Liang Qi
            jade Jade Lovelace
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes