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

startSystemMove() fails intermittently with macOS touchpad

XMLWordPrintable

    • macOS

      I'm trying to implement a transparent title bar and use startSystemMove() to allow moving the window by dragging that area.

      On macOS, this works fine when using a physical mouse, but startSystemMove() fails intermittently when using the built-in touchpad.

      The onPressed event is always triggered, but startSystemMove() often returns false, and the window does not move. Similar issue was reported and fixed in QTBUG-85105, but for Qt 5.15.0

      Window { 
          id: mainWindow 
          width: 800 
          height: 600 
          visible: true 
          flags: Qt.Window | Qt.ExpandedClientAreaHint | Qt.NoTitleBarBackgroundHint 
          Rectangle { 
              height: 60 
              width: parent.width 
              color: "transparent" 
              MouseArea { 
                  anchors.fill: parent 
                  onPressed: { 
                      console.log("Press event detected"); 
                      var success = mainWindow.startSystemMove(); 
                      console.log("startSystemMove() result:", success); 
                  } 
              } 
          } 
          Rectangle { 
              anchors.fill: parent
              color: "#4488ff"
          }
      }
       

      I checked the event type received from the touchpad — it is 34 (NSEventTypePressure) — and this event is not handled by QCocoaWindow::startSystemMove().

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            srutledg Shawn Rutledge
            kateryna_kostiuk Kateryna Kostiuk
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:

                There are no open Gerrit changes