Windows: Activate popup when there is no active window.
Port af7d2b2127dadbdf828c60c75255bb1b4f591651 and 9ffdfa58b3ad2ed4100a7d223a85399b72c6deb7 for QTBUG-7386 from Qt 4. Task-number: QTBUG-44928 Task-number: QTBUG-7386 Change-Id: I119b75349ff30b19f56ecad7fdecf898ac0797d6 Reviewed-by: Oliver Wolff <oliver.wolff@theqtcompany.com> Reviewed-by: Andy Shaw <andy.shaw@digia.com>
This commit is contained in:
parent
3e503b197d
commit
d425563bac
@ -1074,7 +1074,8 @@ QWindowsWindowData
|
|||||||
|
|
||||||
void QWindowsWindow::setVisible(bool visible)
|
void QWindowsWindow::setVisible(bool visible)
|
||||||
{
|
{
|
||||||
qCDebug(lcQpaWindows) << __FUNCTION__ << this << window() << m_data.hwnd << visible;
|
const QWindow *win = window();
|
||||||
|
qCDebug(lcQpaWindows) << __FUNCTION__ << this << win << m_data.hwnd << visible;
|
||||||
if (m_data.hwnd) {
|
if (m_data.hwnd) {
|
||||||
if (visible) {
|
if (visible) {
|
||||||
show_sys();
|
show_sys();
|
||||||
@ -1082,11 +1083,13 @@ void QWindowsWindow::setVisible(bool visible)
|
|||||||
// When the window is layered, we won't get WM_PAINT, and "we" are in control
|
// When the window is layered, we won't get WM_PAINT, and "we" are in control
|
||||||
// over the rendering of the window
|
// over the rendering of the window
|
||||||
// There is nobody waiting for this, so we don't need to flush afterwards.
|
// There is nobody waiting for this, so we don't need to flush afterwards.
|
||||||
if (isLayered()) {
|
if (isLayered())
|
||||||
QWindow *w = window();
|
fireExpose(QRect(0, 0, win->width(), win->height()));
|
||||||
fireExpose(QRect(0, 0, w->width(), w->height()));
|
// QTBUG-44928, QTBUG-7386: This is to resolve the problem where popups are
|
||||||
}
|
// opened from the system tray and not being implicitly activated
|
||||||
|
|
||||||
|
if (win->type() == Qt::Popup && !win->parent() && !QGuiApplication::focusWindow())
|
||||||
|
SetForegroundWindow(m_data.hwnd);
|
||||||
} else {
|
} else {
|
||||||
if (hasMouseCapture())
|
if (hasMouseCapture())
|
||||||
setMouseGrabEnabled(false);
|
setMouseGrabEnabled(false);
|
||||||
|
Loading…
Reference in New Issue
Block a user