diff options
author | Marco Martin <mart@kde.org> | 2017-02-17 11:34:40 +0100 |
---|---|---|
committer | Marco Martin <notmart@gmail.com> | 2017-04-18 08:18:57 +0000 |
commit | 7fffc04335fa63e754655bd15ff4286837d1737b (patch) | |
tree | c8787b63d24de40533abdbf9355e80473cd41842 /src/widgets/widgets/qmenu.cpp | |
parent | 306406715458c2d41915ddb54690233bb2e8616a (diff) |
Reset d->mouseDown only if it's the menu being hidden
If the mouse cursor is over a menu entry with a submenu, and the
submenu is open, quickly moving the mouse to a near menu entry and
clicking it sometimes results in the click being eaten: this happens
when the mouse is pressed before the submenu disappears and released
after it disappeared: the submenu resets d->mouseDown that is a static,
causing the mouse release event on the action we want to have no effect.
Set d->mouseDown to 0 only when the window is hiding is the actual
window that contains the mouseDown, otherwise is still valid.
Change-Id: I2c981b9432728e9e7518c30a146c9595199f8afe
Reviewed-by: Błażej Szczygieł <spaz16@wp.pl>
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
Diffstat (limited to 'src/widgets/widgets/qmenu.cpp')
-rw-r--r-- | src/widgets/widgets/qmenu.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/widgets/widgets/qmenu.cpp b/src/widgets/widgets/qmenu.cpp index bdeb46e88a..a06b9b404f 100644 --- a/src/widgets/widgets/qmenu.cpp +++ b/src/widgets/widgets/qmenu.cpp @@ -2584,7 +2584,8 @@ void QMenu::hideEvent(QHideEvent *) if (QMenuBar *mb = qobject_cast<QMenuBar*>(d->causedPopup.widget)) mb->d_func()->setCurrentAction(0); #endif - d->mouseDown = 0; + if (d->mouseDown == this) + d->mouseDown = 0; d->hasHadMouse = false; if (d->activeMenu) d->hideMenu(d->activeMenu); |