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

windowState still is minimized after restoring a programmatically minimized window

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Reported
    • Priority: P2: Important
    • Resolution: Unresolved
    • Affects Version/s: 5.15.2, 6.1.2
    • Fix Version/s: None
    • Component/s: Widgets: Main Window
    • Labels:
      None
    • Environment:
      KDE 5.22.4 on Arch Linux, using X11.
    • Platform/s:
      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.pro
          0.7 kB
        2. qtbug.cpp
          0.9 kB
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

            Assignee:
            qt.team.quick.subscriptions Qt Quick and Widgets Team
            Reporter:
            jade Jade Lovelace
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:

                Gerrit Reviews

                There are no open Gerrit changes