diff options
author | Rémi Verschelde <remi@verschelde.fr> | 2022-02-25 23:02:56 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-02-25 23:02:56 +0100 |
commit | 0393057e36e486b2944e6166e6572327944b2fa7 (patch) | |
tree | a8c47351e66bcde9b77f72e9b14fe8757891ae9d /scene/main/window.cpp | |
parent | 90d16a32109351dea7684f437436c63cc414f51d (diff) | |
parent | 74ff5921d68ca09942d8988d5a78849b46d8583b (diff) |
Merge pull request #58490 from bruvzg/imporve_popup_menu_handling
Diffstat (limited to 'scene/main/window.cpp')
-rw-r--r-- | scene/main/window.cpp | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/scene/main/window.cpp b/scene/main/window.cpp index 0ce556d36c..6eccb4da9a 100644 --- a/scene/main/window.cpp +++ b/scene/main/window.cpp @@ -951,7 +951,7 @@ bool Window::_can_consume_input_events() const { void Window::_window_input(const Ref<InputEvent> &p_ev) { if (EngineDebugger::is_active()) { - //quit from game window using F8 + // Quit from game window using F8. Ref<InputEventKey> k = p_ev; if (k.is_valid() && k->is_pressed() && !k->is_echo() && k->get_keycode() == Key::F8) { EngineDebugger::get_singleton()->send_message("request_quit", Array()); @@ -959,15 +959,7 @@ void Window::_window_input(const Ref<InputEvent> &p_ev) { } if (exclusive_child != nullptr) { - /* - Window *focus_target = exclusive_child; - focus_target->grab_focus(); - while (focus_target->exclusive_child != nullptr) { - focus_target = focus_target->exclusive_child; - focus_target->grab_focus(); - }*/ - - if (!is_embedding_subwindows()) { //not embedding, no need for event + if (!is_embedding_subwindows()) { // Not embedding, no need for event. return; } } @@ -1587,6 +1579,7 @@ void Window::_bind_methods() { ADD_PROPERTYI(PropertyInfo(Variant::BOOL, "always_on_top"), "set_flag", "get_flag", FLAG_ALWAYS_ON_TOP); ADD_PROPERTYI(PropertyInfo(Variant::BOOL, "transparent"), "set_flag", "get_flag", FLAG_TRANSPARENT); ADD_PROPERTYI(PropertyInfo(Variant::BOOL, "unfocusable"), "set_flag", "get_flag", FLAG_NO_FOCUS); + ADD_PROPERTYI(PropertyInfo(Variant::BOOL, "popup_window"), "set_flag", "get_flag", FLAG_POPUP); ADD_GROUP("Limits", ""); ADD_PROPERTY(PropertyInfo(Variant::VECTOR2I, "min_size"), "set_min_size", "get_min_size"); @@ -1630,6 +1623,7 @@ void Window::_bind_methods() { BIND_ENUM_CONSTANT(FLAG_ALWAYS_ON_TOP); BIND_ENUM_CONSTANT(FLAG_TRANSPARENT); BIND_ENUM_CONSTANT(FLAG_NO_FOCUS); + BIND_ENUM_CONSTANT(FLAG_POPUP); BIND_ENUM_CONSTANT(FLAG_MAX); BIND_ENUM_CONSTANT(CONTENT_SCALE_MODE_DISABLED); |