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

QWidget: resize() after showMaximized() causes strange behaviour

    XMLWordPrintable

Details

    • Linux/X11, Windows
    • 99c8ffb9f2 (qt/qtbase/dev) 99c8ffb9f2 (qt/tqtc-qtbase/dev) ba2584126b (qt/qtbase/6.4) ba2584126b (qt/tqtc-qtbase/6.4)

    Description

      See the attached project. It prints the values of geometry() and isMaximized() between various calls to showMaximized() and resize().

       

      Outcome on Windows 10 21H2

      0. Starting...
           QRect(640,280 640x480)
          Maximized? false
      1. showMaximized()
           QRect(0,23 1920x1017)
          Maximized? true
      2. resize(800, 600)
           QRect(0,23 800x600)
          Maximized? false
      3. resize(1000, 1000)
           QRect(0,23 1000x1000)
          Maximized? false
      4. showMaximized()
           QRect(0,23 1000x1000)
          Maximized? true
      5. Stopping...
      
      • The window maximizes correctly in Step #1
      • The window changes size in Steps #2 and #3
      • The window does not maximize in Step #4
      • The Window shrinks in Step #2, but the "Restore" button remains visible while the "Maximize" button does not appear
      • geometry() is always consistent with the display
      • isMaximized() is not always consistent with the display (see Step #4)

       

       

      Outcome on Ubuntu 22.04 (XCB)

      0. Starting...
           QRect(0,0 640x480)
          Maximized? false
      1. showMaximized()
           QRect(74,64 1846x1016)
          Maximized? true
      2. resize(800, 600)
           QRect(74,64 800x600)
          Maximized? false
      3. resize(1000, 1000)
           QRect(74,64 1000x1000)
          Maximized? false
      4. showMaximized()
           QRect(74,64 1000x1000)
          Maximized? true
      5. Stopping...
      
      • The window maximizes correctly in Step #1
      • The window stays visibly maximized throughout Steps #2 – #5
      • geometry() and isMaximized() are not always consistent with the display

       

      Outcome on Ubuntu 22.04 (Wayland)

      0. Starting...
           QRect(6,60 640x480)
          Maximized? false
      1. showMaximized()
           QRect(9,90 1840x1020)
          Maximized? true
      2. resize(800, 600)
           QRect(12,120 1840x1020)
          Maximized? true
      3. resize(1000, 1000)
           QRect(15,150 1840x1020)
          Maximized? true
      4. showMaximized()
           QRect(15,150 1840x1020)
          Maximized? true
      5. Stopping...
      
      • Same visible outcomes as the XCB case
      • geometry() and isMaximized() are always consistent with the display.
      • The (x, y) values of geometry() seem to creep though...?

       

      Workaround

      Call showNormal() after resize()

      Attachments

        1. maximized_resize.zip
          1 kB
        2. qtbug104201_log.txt
          2 kB
        3. qtbug104201.zip
          2 kB
        4. QTBUG-104201.zip
          2 kB
        5. win-restore-button-unmaximized.png
          win-restore-button-unmaximized.png
          1.0 kB
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            axelspoerl Axel Spoerl
            skoh-qt Sze Howe Koh
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes