Windows QPA: Fix QDockWindow Drag & Drop
Pointer messages should not be handled when we are inside a move/resize modal loop. DefWindowProc() should handle this case instead. Fixes: QTBUG-72078 Change-Id: I5ad7283bcf0cfe0ff7d21cf5640270c361b8ad8d Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
This commit is contained in:
parent
b91e6befeb
commit
f184f1a481
@ -187,6 +187,12 @@ static bool draggingActive()
|
||||
bool QWindowsPointerHandler::translatePointerEvent(QWindow *window, HWND hwnd, QtWindows::WindowsEventType et, MSG msg, LRESULT *result)
|
||||
{
|
||||
*result = 0;
|
||||
|
||||
// If we are inside the move/resize modal loop, let DefWindowProc() handle it (but process NC button release).
|
||||
QWindowsWindow *platformWindow = static_cast<QWindowsWindow *>(window->handle());
|
||||
if (msg.message != WM_NCPOINTERUP && platformWindow->testFlag(QWindowsWindow::ResizeMoveActive))
|
||||
return false;
|
||||
|
||||
const quint32 pointerId = GET_POINTERID_WPARAM(msg.wParam);
|
||||
|
||||
POINTER_INPUT_TYPE pointerType;
|
||||
@ -195,6 +201,18 @@ bool QWindowsPointerHandler::translatePointerEvent(QWindow *window, HWND hwnd, Q
|
||||
return false;
|
||||
}
|
||||
|
||||
// Handle non-client pen/touch as generic mouse events for compatibility with QDockWindow.
|
||||
if ((pointerType == QT_PT_TOUCH || pointerType == QT_PT_PEN) && (et & QtWindows::NonClientEventFlag)) {
|
||||
POINTER_INFO pointerInfo;
|
||||
if (!QWindowsContext::user32dll.getPointerInfo(pointerId, &pointerInfo)) {
|
||||
qWarning() << "GetPointerInfo() failed:" << qt_error_string();
|
||||
return false;
|
||||
}
|
||||
if (pointerInfo.pointerFlags & (POINTER_FLAG_UP | POINTER_FLAG_DOWN))
|
||||
return translateMouseTouchPadEvent(window, hwnd, et, msg, &pointerInfo);
|
||||
return false;
|
||||
}
|
||||
|
||||
switch (pointerType) {
|
||||
case QT_PT_POINTER:
|
||||
case QT_PT_MOUSE:
|
||||
|
Loading…
x
Reference in New Issue
Block a user