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

showMaximized() does showFullScreen() on secondary screen on Windows 10 even if the taskbar is shown (frameless window)

    XMLWordPrintable

Details

    • Windows

    Description

      On Windows 10 is is possible to show the taskbar on secondary screens. When using showMaximized() on a secondary screen, it seems as if showFullScreen() is invoked, regardless whether or not the taskbar is shown on that screen.

      The following QML code shows the issue (maximizes correctly on primary screen, goes full screen on secondary screen even if the taskbar is showing - it covers the taskbar and the icon doesn't change to "restore" as the status is Window.Fullscreen rather than Window.Maximized).

      import QtQuick 2.12
      import QtQuick.Controls 2.3
      import QtQuick.Layouts 1.3
      import QtQuick.Window 2.3
      
      Window {
          id: window
          visible: true
          flags: Qt.FramelessWindowHint
          width: 640
          height: 480
      
          function toggleMaximized() {
              if (window.visibility === Window.Maximized) {
                  window.showNormal();
              } else {
                  window.showMaximized();
              }
          }
      
          Page {
              anchors.fill: parent
              header: ToolBar {
                  Item {
                      anchors.fill: parent
                      TapHandler {
                          onTapped: if (tapCount === 2) toggleMaximized()
                          gesturePolicy: TapHandler.DragThreshold
                      }
                      DragHandler {
                          grabPermissions: TapHandler.CanTakeOverFromAnything
                          onActiveChanged: if (active) { window.startSystemMove(); }
                      }
                      RowLayout {
                          anchors.left: parent.left
                          anchors.right: parent.right
                          spacing: 3
                          Layout.fillWidth: true
      					Item { Layout.fillWidth: true }
      					ToolButton {
      						text: "�"
      						onClicked: window.showMinimized();
      					}
      					ToolButton {
      						text: window.visibility === Window.Maximized ? "�" : "�" 
      						onClicked: window.toggleMaximized()
      					}
      					ToolButton {
      						text: "�"
      						onClicked: window.close()
      					}
                      }
                  }
              }
          }
      }
      

      Attachments

        1. qtbug86899_2.zip
          3 kB
        2. qtbug86899_qwindow.zip
          3 kB
        3. qtbug86899.zip
          4 kB

        Issue Links

          Activity

            People

              ulherman Ulf Hermann
              aamann aamann
              Votes:
              3 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: