From 3d7bd7ad19254bb1c4794349e71501e58c91891e Mon Sep 17 00:00:00 2001 From: Volker Hilsheimer Date: Tue, 30 Jul 2019 11:27:49 +0200 Subject: Fix hit testing in non-client area of fixed-size windows, don't show resize cursors The m_windowState member is never updated regarding active state; isActive is instead reimplemented to query the window manager, so use that. To extend the area where the user can move the window over the entire titlebar of fixed-height windows, just test whether the mouse position is within the titlebar. Change-Id: I6b87aacd0bdab511cfd4959df1114af5c6013852 Fixes: QTBUG-77220 Reviewed-by: Friedemann Kleint --- src/plugins/platforms/windows/qwindowswindow.cpp | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'src/plugins/platforms/windows') diff --git a/src/plugins/platforms/windows/qwindowswindow.cpp b/src/plugins/platforms/windows/qwindowswindow.cpp index eb521dac52..7d511bf0d7 100644 --- a/src/plugins/platforms/windows/qwindowswindow.cpp +++ b/src/plugins/platforms/windows/qwindowswindow.cpp @@ -2621,7 +2621,8 @@ bool QWindowsWindow::handleNonClientHitTest(const QPoint &globalPos, LRESULT *re // QTBUG-32663, suppress resize cursor for fixed size windows. const QWindow *w = window(); if (!w->isTopLevel() // Task 105852, minimized windows need to respond to user input. - || !(m_windowState & ~Qt::WindowActive) + || (m_windowState != Qt::WindowNoState) + || !isActive() || (m_data.flags & Qt::FramelessWindowHint)) { return false; } @@ -2641,12 +2642,10 @@ bool QWindowsWindow::handleNonClientHitTest(const QPoint &globalPos, LRESULT *re return true; } if (localPos.y() < 0) { - const QMargins margins = frameMargins(); - const int topResizeBarPos = margins.left() - margins.top(); - if (localPos.y() < topResizeBarPos) { + const int topResizeBarPos = -frameMargins().top(); + if (localPos.y() >= topResizeBarPos) *result = HTCAPTION; // Extend caption over top resize bar, let's user move the window. - return true; - } + return true; } } if (fixedWidth && (localPos.x() < 0 || localPos.x() >= size.width())) { -- cgit v1.2.3