summaryrefslogtreecommitdiffstats
path: root/src/plugins
diff options
context:
space:
mode:
authorVolker Hilsheimer <volker.hilsheimer@qt.io>2019-07-30 11:27:49 +0200
committerVolker Hilsheimer <volker.hilsheimer@qt.io>2019-07-31 20:13:49 +0200
commit3d7bd7ad19254bb1c4794349e71501e58c91891e (patch)
tree9e68d7e056b2f194e8b18e414b97e504e112624b /src/plugins
parent23e605cc5b71f68d6c9e6168053226d027ea46d4 (diff)
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 <Friedemann.Kleint@qt.io>
Diffstat (limited to 'src/plugins')
-rw-r--r--src/plugins/platforms/windows/qwindowswindow.cpp11
1 files changed, 5 insertions, 6 deletions
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())) {