From 9ffdfa58b3ad2ed4100a7d223a85399b72c6deb7 Mon Sep 17 00:00:00 2001 From: Jens Bache-Wiig Date: Fri, 5 Feb 2010 17:19:48 +0100 Subject: Revised fix for system tray popup activation Change af7d2b2127dadbdf828c60c75255bb1b4f591651 does have some negative side-effects. This should limit the fix to void unnecessary activation when the parent window already has focus. Reviewed-by: denis --- src/gui/kernel/qwidget_win.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/gui/kernel/qwidget_win.cpp b/src/gui/kernel/qwidget_win.cpp index 6a36293..8cab387 100644 --- a/src/gui/kernel/qwidget_win.cpp +++ b/src/gui/kernel/qwidget_win.cpp @@ -1156,7 +1156,10 @@ void QWidgetPrivate::show_sys() data.window_state |= Qt::WindowMinimized; if (IsZoomed(q->internalWinId())) data.window_state |= Qt::WindowMaximized; - if (q->windowType() == Qt::Popup) + // This is to resolve the problem where popups are opened from the + // system tray and not being implicitly activated + if (q->windowType() == Qt::Popup && + (!q->parentWidget() || !q->parentWidget()->isActiveWindow())) q->activateWindow(); } -- cgit v0.12