Windows: Fix title bar artifact for frameless windows after restoring
If windows is frameless we don't let windows os handle WM_NCACTIVATE event. Fixes: QTBUG-127116 Change-Id: I90f6a394018d0b275c77d319f0dc6fe93707694e Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
This commit is contained in:
parent
72cde6f7dd
commit
ee942d7ab4
@ -116,6 +116,7 @@ enum WindowsEventType // Simplify event types
|
||||
NonClientMouseEvent = NonClientEventFlag + MouseEventFlag + 1,
|
||||
NonClientHitTest = NonClientEventFlag + 2,
|
||||
NonClientCreate = NonClientEventFlag + 3,
|
||||
NonClientActivate = NonClientEventFlag + 4,
|
||||
NonClientPointerEvent = NonClientEventFlag + PointerEventFlag + 4,
|
||||
KeyEvent = KeyEventFlag + 1,
|
||||
KeyDownEvent = KeyEventFlag + KeyDownEventFlag + 1,
|
||||
@ -215,6 +216,8 @@ inline QtWindows::WindowsEventType windowsEventType(UINT message, WPARAM wParamI
|
||||
return QtWindows::CalculateSize;
|
||||
case WM_NCHITTEST:
|
||||
return QtWindows::NonClientHitTest;
|
||||
case WM_NCACTIVATE:
|
||||
return QtWindows::NonClientActivate;
|
||||
case WM_GETMINMAXINFO:
|
||||
return QtWindows::QuerySizeHints;
|
||||
case WM_KEYDOWN: // keyboard event
|
||||
|
@ -1172,6 +1172,8 @@ bool QWindowsContext::windowsProc(HWND hwnd, UINT message,
|
||||
platformWindow->updateCustomTitlebar();
|
||||
return platformWindow->handleNonClientHitTest(QPoint(msg.pt.x, msg.pt.y), result);
|
||||
}
|
||||
case QtWindows::NonClientActivate:
|
||||
return platformWindow->handleNonClientActivate(result);
|
||||
case QtWindows::GeometryChangingEvent:
|
||||
return platformWindow->handleGeometryChanging(&msg);
|
||||
case QtWindows::ExposeEvent:
|
||||
|
@ -3454,6 +3454,18 @@ bool QWindowsWindow::handleNonClientHitTest(const QPoint &globalPos, LRESULT *re
|
||||
return false;
|
||||
}
|
||||
|
||||
bool QWindowsWindow::handleNonClientActivate(LRESULT *result) const
|
||||
{
|
||||
// If this window is frameless we choose to consume the event,
|
||||
// since the default logic causes the window title to appear.
|
||||
// QTBUG-127116
|
||||
if (m_data.flags & Qt::FramelessWindowHint) {
|
||||
*result = true;
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
static void _q_drawCustomTitleBarButton(QPainter& p, const QRectF& r)
|
||||
{
|
||||
QPainterPath path(QPointF(r.x(), r.y()));
|
||||
|
@ -314,6 +314,7 @@ public:
|
||||
void releaseDC();
|
||||
void getSizeHints(MINMAXINFO *mmi) const;
|
||||
bool handleNonClientHitTest(const QPoint &globalPos, LRESULT *result) const;
|
||||
bool handleNonClientActivate(LRESULT *result) const;
|
||||
void updateCustomTitlebar();
|
||||
|
||||
#ifndef QT_NO_CURSOR
|
||||
|
Loading…
x
Reference in New Issue
Block a user