Details
-
Bug
-
Resolution: Done
-
P3: Somewhat important
-
5.15.0
-
-
cfe421cee2 (qt/qtbase/dev) 58fdd0f01b (qt/qtbase/6.3) e336e062ef (qt/qtbase/6.2) e336e062ef (qt/tqtc-qtbase/6.2) 58fdd0f01b (qt/tqtc-qtbase/6.3) 58fdd0f01b (qt/tqtc-qtbase/6.3.0)
Description
On Windows startSystemMove and startSystemResize DOES NOT trigger aero snap on frameless windows as suggested by the following blog post:
https://www.qt.io/blog/custom-window-decorations
Note that it's also suggested in https://doc.qt.io/qt-5/qwindow.html#startSystemMove
You could try with the following example:
import QtQuick 2.15 import QtQuick.Controls 2.15 import QtQuick.Window 2.15 ApplicationWindow { width: 640 height: 480 flags: Qt.FramelessWindowHint | Qt.Window visible: true background: Rectangle { border.color: handler.active ? "green" : "red" border.width: 1 } Item { anchors.fill: parent DragHandler { id: handler onActiveChanged: if (active) startSystemMove() } } }
This is an interresting feature, but since it does not work properly, it feel useless, at least on Windows.
Note that I achived to implements the aero snap feature, and also the drop shadow, but this needs a bit of Windows specific C++ code to works:
- Needs to react to the WM_NCCALCSIZE event.
- Needs to use the QtWin::extendFrameIntoClientArea.
- Needs to set back some window native flags after settings Qt ones: WS_POPUP | WS_CAPTION | WS_THICKFRAME
So this is not currently possible with pure QML.
It would be nice in fact to have a bit more control over the windows via some flags, something like:
- Qt.SnapWindowHint add the native flags to force snapping support on the windows (in addition with Qt.FramelessWindowHint)
- Qt.DropShadowWindowHint add the native flags to force window shadow (in addition with Qt.FramelessWindowHint) or to allow Qt to emulate it.
Attachments
Issue Links
- relates to
-
QTBUG-73011 Add public cross-platform API for starting native interactive move/resize of windows
- Closed
-
QTBUG-102063 Window tiling is not working using startSystemMove()
- Open
-
PYSIDE-2248 QWebEngineView breaks native window functionality
- Closed