From 1fc9c8d8f31b3c6587691608550ff41bed765fb9 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Mon, 21 Aug 2017 11:18:14 +0200 Subject: Windows QPA: Call raise unconditionally for popups A case of nested Qt::WindowStaysOnTopHint may occur when context menus are created on windows with Qt::WindowStaysOnTopHint set. Raise the popup in that case. Amends 329a029c361bcbaf70f3aa919693f0bef48a152f. Task-number: QTBUG-62004 Change-Id: Ifb761edbd42b1447bec30735810c006d02e1aa97 Reviewed-by: Joerg Bornemann --- src/plugins/platforms/windows/qwindowswindow.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/plugins/platforms/windows/qwindowswindow.cpp') diff --git a/src/plugins/platforms/windows/qwindowswindow.cpp b/src/plugins/platforms/windows/qwindowswindow.cpp index 3c79c8aefe..5e0fd77776 100644 --- a/src/plugins/platforms/windows/qwindowswindow.cpp +++ b/src/plugins/platforms/windows/qwindowswindow.cpp @@ -872,8 +872,10 @@ void QWindowsBaseWindow::hide_sys() // Normal hide, do not activate other window void QWindowsBaseWindow::raise_sys() { qCDebug(lcQpaWindows) << __FUNCTION__ << this << window(); - if ((window()->flags() & (Qt::WindowStaysOnTopHint | Qt::WindowStaysOnBottomHint)) == 0) + if (window()->type() == Qt::Popup + || (window()->flags() & (Qt::WindowStaysOnTopHint | Qt::WindowStaysOnBottomHint)) == 0) { SetWindowPos(handle(), HWND_TOP, 0, 0, 0, 0, SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOSIZE); + } } void QWindowsBaseWindow::lower_sys() -- cgit v1.2.3