diff --git a/QtScrcpy/MainWindow.qml b/QtScrcpy/MainWindow.qml index b7f8dac..83c0ed6 100644 --- a/QtScrcpy/MainWindow.qml +++ b/QtScrcpy/MainWindow.qml @@ -4,7 +4,7 @@ import QtQuick.Window 2.12 Window { id: root visible: true - flags: Qt.Window | Qt.FramelessWindowHint | Qt.WindowMaximizeButtonHint + flags: Qt.Window | Qt.WindowMaximizeButtonHint | (Qt.platform.os == "windows" ? Qt.FramelessWindowHint : 0) width: 800 height: 600 color: "transparent" @@ -36,8 +36,28 @@ Window { color: "transparent" DragHandler { + // startSystemMove only windows enabled + enabled: Qt.platform.os == "windows" ? true : false grabPermissions: TapHandler.CanTakeOverFromAnything - onActiveChanged: if (active) { root.startSystemMove(); } + onActiveChanged: if (active) {root.startSystemMove(); } + } + + // drag move for other system + MouseArea{ + property real pressMouseX; + property real pressMouseY; + anchors.fill: parent + enabled: Qt.platform.os != "windows" ? true : false + + onPressed: { + pressMouseX = mouse.x; + pressMouseY = mouse.y; + } + + onPositionChanged: { + root.x = root.x + (mouse.x - pressMouseX); + root.y = root.y + (mouse.y - pressMouseY); + } } } }