diff options
author | Poommetee Ketson <poommetee@protonmail.com> | 2017-08-02 00:43:25 +0700 |
---|---|---|
committer | Poommetee Ketson <poommetee@protonmail.com> | 2017-08-02 00:43:25 +0700 |
commit | 49ec6c4380644da460af65e210d555d4b739517f (patch) | |
tree | 232dfa4ed4e26fb43587e7d3ea4a653345b9eea7 | |
parent | 85088275c5e6db63755e8dfd23d5f53d2d5c96ef (diff) |
MenuButton: defer grab_click_focus until button_up
-rw-r--r-- | scene/gui/menu_button.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/scene/gui/menu_button.cpp b/scene/gui/menu_button.cpp index fe76b16460..57aa72b7d0 100644 --- a/scene/gui/menu_button.cpp +++ b/scene/gui/menu_button.cpp @@ -55,7 +55,6 @@ void MenuButton::pressed() { popup->set_size(Size2(size.width, 0)); popup->set_parent_rect(Rect2(Point2(gp - popup->get_global_position()), get_size())); popup->popup(); - popup->call_deferred("grab_click_focus"); popup->set_invalidate_click_until_motion(); } @@ -112,6 +111,7 @@ MenuButton::MenuButton() { popup->hide(); add_child(popup); popup->set_as_toplevel(true); + connect("button_up", popup, "call_deferred", make_binds("grab_click_focus")); set_process_unhandled_key_input(true); set_action_mode(ACTION_MODE_BUTTON_PRESS); } |