summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJens Bache-Wiig <jbache@trolltech.com>2010-02-04 13:24:30 (GMT)
committerJens Bache-Wiig <jbache@trolltech.com>2010-02-04 13:24:30 (GMT)
commitaf7d2b2127dadbdf828c60c75255bb1b4f591651 (patch)
treee11b7b9f44743a982ec3e07d8480396487b696d1
parent5f23d1635db832014b9d9acbf61e78ba52a9cc2f (diff)
downloadQt-af7d2b2127dadbdf828c60c75255bb1b4f591651.zip
Qt-af7d2b2127dadbdf828c60c75255bb1b4f591651.tar.gz
Qt-af7d2b2127dadbdf828c60c75255bb1b4f591651.tar.bz2
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
-rw-r--r--src/gui/kernel/qwidget_win.cpp2
-rw-r--r--src/gui/util/qsystemtrayicon_win.cpp2
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;