summaryrefslogtreecommitdiffstats
path: root/src/controls/qtmenu.cpp
diff options
context:
space:
mode:
authorGabriel de Dietrich <gabriel.dedietrich@digia.com>2013-04-04 14:07:25 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-04-04 16:50:30 +0200
commit0608949d4c2762db58fba65adfaa2b7be23cdba5 (patch)
tree444c60e2e9e53c738978557593d2a8e592eeba63 /src/controls/qtmenu.cpp
parent85c602db435b23ff8dd4e237110cbe4508d16ac5 (diff)
Menu: Normalize click-popup-click behavior
See comment in code. Change-Id: I5ab6c639079dd57aaf8b661e4307cf5587361495 Reviewed-by: Jens Bache-Wiig <jens.bache-wiig@digia.com>
Diffstat (limited to 'src/controls/qtmenu.cpp')
-rw-r--r--src/controls/qtmenu.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/controls/qtmenu.cpp b/src/controls/qtmenu.cpp
index dfed4e321..cbedf732f 100644
--- a/src/controls/qtmenu.cpp
+++ b/src/controls/qtmenu.cpp
@@ -297,8 +297,13 @@ void QtMenu::popup()
void QtMenu::__popup(qreal x, qreal y, int atItemIndex)
{
- if (popupVisible())
+ if (popupVisible()) {
__closeMenu();
+ // Mac and Windows would normally move the menu under the cursor, so we should not
+ // return here. However, very often we want to re-contextualize the menu, and this
+ // has to be done at the application level.
+ return;
+ }
setPopupVisible(true);