diff options
author | Friedemann Kleint <Friedemann.Kleint@theqtcompany.com> | 2015-03-11 17:11:18 +0100 |
---|---|---|
committer | Friedemann Kleint <Friedemann.Kleint@theqtcompany.com> | 2015-03-20 12:27:30 +0000 |
commit | d425563bac3d44eb360027f49622c29b8b4e84f5 (patch) | |
tree | b78e181811cd6a2b5678b634a7095411ad365c7f /src/plugins | |
parent | 3e503b197d8391ef5ccd5d5cce7773e7ed63eba1 (diff) |
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>
Diffstat (limited to 'src/plugins')
-rw-r--r-- | src/plugins/platforms/windows/qwindowswindow.cpp | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/src/plugins/platforms/windows/qwindowswindow.cpp b/src/plugins/platforms/windows/qwindowswindow.cpp index 29da3328b0..fc389ecf15 100644 --- a/src/plugins/platforms/windows/qwindowswindow.cpp +++ b/src/plugins/platforms/windows/qwindowswindow.cpp @@ -1074,7 +1074,8 @@ QWindowsWindowData 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 (visible) { 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 // over the rendering of the window // There is nobody waiting for this, so we don't need to flush afterwards. - if (isLayered()) { - QWindow *w = window(); - fireExpose(QRect(0, 0, w->width(), w->height())); - } + if (isLayered()) + fireExpose(QRect(0, 0, win->width(), win->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 { if (hasMouseCapture()) setMouseGrabEnabled(false); |