From af7d2b2127dadbdf828c60c75255bb1b4f591651 Mon Sep 17 00:00:00 2001 From: Jens Bache-Wiig Date: Thu, 4 Feb 2010 14:24:30 +0100 Subject: Always activate popup windows on show The problem was that popups that were opened from a system tray icon did not get activated and clicking outside would not close the popup as intended. Ensuring that all popups get activated on show should solve this problem in the general sense. Task-number: QTBUG-7386 Reviewed-by: denis --- src/gui/kernel/qwidget_win.cpp | 2 ++ src/gui/util/qsystemtrayicon_win.cpp | 2 -- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gui/kernel/qwidget_win.cpp b/src/gui/kernel/qwidget_win.cpp index a57aacc..6a36293 100644 --- a/src/gui/kernel/qwidget_win.cpp +++ b/src/gui/kernel/qwidget_win.cpp @@ -1156,6 +1156,8 @@ void QWidgetPrivate::show_sys() data.window_state |= Qt::WindowMinimized; if (IsZoomed(q->internalWinId())) data.window_state |= Qt::WindowMaximized; + if (q->windowType() == Qt::Popup) + q->activateWindow(); } winSetupGestures(); diff --git a/src/gui/util/qsystemtrayicon_win.cpp b/src/gui/util/qsystemtrayicon_win.cpp index 092909f..8e482e0 100644 --- a/src/gui/util/qsystemtrayicon_win.cpp +++ b/src/gui/util/qsystemtrayicon_win.cpp @@ -325,8 +325,6 @@ bool QSystemTrayIconSys::winEvent( MSG *m, long *result ) q->contextMenu()->move(gpos); } #endif - q->contextMenu()->activateWindow(); - //Must be activated for proper keyboardfocus and menu closing on windows: } emit q->activated(QSystemTrayIcon::Context); break; -- cgit v0.12