summaryrefslogtreecommitdiff
path: root/scene/main
diff options
context:
space:
mode:
authorMichael Alexsander Silva Dias <michaelalexsander@protonmail.com>2018-07-29 19:26:43 -0300
committerMichael Alexsander Silva Dias <michaelalexsander@protonmail.com>2018-11-20 20:37:45 -0200
commitda7d3c5a585b944ac1223021eab2b2a23b25eee3 (patch)
treee8444d1d01047b25135ea179fc7cda8bc9bf2261 /scene/main
parentf2cc9698433a32a05c76987acd20a07441313037 (diff)
Make opening menus with the same parent on mouse focus explicit
Diffstat (limited to 'scene/main')
-rw-r--r--scene/main/viewport.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/scene/main/viewport.cpp b/scene/main/viewport.cpp
index 8545efb966..176650fbc3 100644
--- a/scene/main/viewport.cpp
+++ b/scene/main/viewport.cpp
@@ -1961,10 +1961,9 @@ void Viewport::_gui_input_event(Ref<InputEvent> p_event) {
// If the mouse is over a menu button, this menu will open automatically
// if there is already a pop-up menu open at the same hierarchical level.
- if (popup_menu_parent && menu_button &&
- popup_menu_parent->get_icon().is_null() &&
- menu_button->get_icon().is_null() &&
- (popup_menu->get_parent()->get_parent()->is_a_parent_of(menu_button) ||
+ if (popup_menu_parent && menu_button && popup_menu_parent->is_switch_on_hover() &&
+ !menu_button->is_disabled() && menu_button->is_switch_on_hover() &&
+ (popup_menu_parent->get_parent()->is_a_parent_of(menu_button) ||
menu_button->get_parent()->is_a_parent_of(popup_menu))) {
popup_menu->notification(Control::NOTIFICATION_MODAL_CLOSE);