MenuButton: Fix event propagation with dialogs
This commit is contained in:
parent
6a5e11c075
commit
c45837cf3f
@ -28,6 +28,7 @@
|
|||||||
/*************************************************************************/
|
/*************************************************************************/
|
||||||
#include "menu_button.h"
|
#include "menu_button.h"
|
||||||
#include "os/keyboard.h"
|
#include "os/keyboard.h"
|
||||||
|
#include "scene/main/viewport.h"
|
||||||
|
|
||||||
|
|
||||||
void MenuButton::_unhandled_key_input(InputEvent p_event) {
|
void MenuButton::_unhandled_key_input(InputEvent p_event) {
|
||||||
@ -38,6 +39,9 @@ void MenuButton::_unhandled_key_input(InputEvent p_event) {
|
|||||||
if (!get_parent() || !is_visible() || is_disabled())
|
if (!get_parent() || !is_visible() || is_disabled())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
if (get_viewport()->get_modal_stack_top() && !get_viewport()->get_modal_stack_top()->is_a_parent_of(this))
|
||||||
|
return; //ignore because of modal window
|
||||||
|
|
||||||
|
|
||||||
if (popup->activate_item_by_event(p_event))
|
if (popup->activate_item_by_event(p_event))
|
||||||
accept_event();
|
accept_event();
|
||||||
|
Loading…
Reference in New Issue
Block a user