Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Frameless window on Windows has a returning titlebar after restoring from minimized state.
Qt 6.12 LTS is out! See what's new in the release blog

Frameless window on Windows has a returning titlebar after restoring from minimized state.

Scheduled Pinned Locked Moved Unsolved General and Desktop
13 Posts 7 Posters 3.7k Views 3 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • F fear2137

    Whenever I minimize my app with Window.showMinimized() and restore it, the window title gets displayed in a weird rectangle at 0,0
    alt text
    small reproduction project: https://www.mediafire.com/file/ozkurikrufvme8m/Example.zip/file

    C Offline
    C Offline
    ChrisW67
    wrote on last edited by ChrisW67
    #4

    @fear2137 After correcting content/CMakeLists.txt in your example it configures, compiles, and runs without issue on Linux Qt 6.6.0 under KDE. The application main window stays frameless.
    This is almost certainly going to be a Windows-ism. I have to get Qt 6.6 into a Windows environment to check.

    Edit: Took a while to get everything in place (example is far from minimal): Qt 6.6.0, Windows 11, MingW tool chain. I see this on first launch:
    794a35ee-d08d-420a-8cdd-eef0d549d0a7-image.png
    and this after Minimize button, then restore:
    9c67d6f4-deb2-44ac-abac-024f2444853a-image.png
    Note the graphical artifact, top left. Not the symptom you claim, but not right either.

    F 1 Reply Last reply
    0
    • C ChrisW67

      @fear2137 After correcting content/CMakeLists.txt in your example it configures, compiles, and runs without issue on Linux Qt 6.6.0 under KDE. The application main window stays frameless.
      This is almost certainly going to be a Windows-ism. I have to get Qt 6.6 into a Windows environment to check.

      Edit: Took a while to get everything in place (example is far from minimal): Qt 6.6.0, Windows 11, MingW tool chain. I see this on first launch:
      794a35ee-d08d-420a-8cdd-eef0d549d0a7-image.png
      and this after Minimize button, then restore:
      9c67d6f4-deb2-44ac-abac-024f2444853a-image.png
      Note the graphical artifact, top left. Not the symptom you claim, but not right either.

      F Offline
      F Offline
      fear2137
      wrote on last edited by
      #5

      @ChrisW67 this artifact is actually the titlebar I meant. Move screen01 down in y and you will see.

      F 1 Reply Last reply
      1
      • F fear2137

        @ChrisW67 this artifact is actually the titlebar I meant. Move screen01 down in y and you will see.

        F Offline
        F Offline
        fear2137
        wrote on last edited by
        #6

        To me it looks like Qt sets wrong flags in Windows, creating such window in cpp manually doesnt give this titlebar.

        F 1 Reply Last reply
        1
        • F fear2137

          To me it looks like Qt sets wrong flags in Windows, creating such window in cpp manually doesnt give this titlebar.

          F Offline
          F Offline
          fear2137
          wrote on last edited by
          #7

          does anyone know a fix to this?

          1 Reply Last reply
          1
          • A Offline
            A Offline
            Anton Beresnev
            wrote on last edited by
            #8

            Do anyone can solve this problem?

            1 Reply Last reply
            0
            • A Offline
              A Offline
              Alxi11
              wrote on last edited by Alxi11
              #9

              Qt 6.7.0 has the same issue. I temporarily solved it with the following code.

              // Main Window
              Window{
                  id: rootWindow
                  property bool isMinimized: false
                  onVisibilityChanged: {
                      if(rootWindow.visibility === Window.Minimized){
                          rootWindow.isMinimized = true
                          rootWindow.flags = Qt.Window
                      } else if(rootWindow.isMinimized === true){
                          rootWindow.flags = Qt.Window | Qt.FramelessWindowHint | Qt.WindowSystemMenuHint | Qt.WindowMinMaxButtonsHint
                          rootWindow.isMinimized = false
                      }
                  }
              }
              
              1 Reply Last reply
              0
              • S Offline
                S Offline
                Stradlater
                wrote on last edited by
                #10

                I solved this behavior by disabling WM_NCCALCSIZE message handling:

                class WinEventFilter(QAbstractNativeEventFilter):
                    def nativeEventFilter(self, eventType, message):
                        if eventType == QByteArray(b"windows_generic_MSG"):
                            msg = MSG.from_address(message.__int__())
                            if msg.message == win32con.WM_NCCALCSIZE: 
                                return True, 0
                        return False, 0
                
                1 Reply Last reply
                0
                • F Offline
                  F Offline
                  fear2137
                  wrote on last edited by
                  #11

                  can we expect a official fix

                  1 Reply Last reply
                  0
                  • L Offline
                    L Offline
                    Lyubov Gencheva
                    wrote on last edited by
                    #12

                    Hi, we are experiencing this issue with Webex. Our customers are complaining. Is there a fix expected any time soon?

                    SGaistS 1 Reply Last reply
                    0
                    • L Lyubov Gencheva

                      Hi, we are experiencing this issue with Webex. Our customers are complaining. Is there a fix expected any time soon?

                      SGaistS Offline
                      SGaistS Offline
                      SGaist
                      Lifetime Qt Champion
                      wrote on last edited by
                      #13

                      @Lyubov-Gencheva hi and welcome to devnet,

                      If there's no issue raised about this on the bug tracker, then I would say highly unlikely.

                      Interested in AI ? www.idiap.ch
                      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                      1 Reply Last reply
                      0

                      • Login

                      • Login or register to search.
                      • First post
                        Last post
                      0
                      • Categories
                      • Recent
                      • Tags
                      • Popular
                      • Users
                      • Groups
                      • Search
                      • Get Qt
                      • Unsolved