|
@@ -108,11 +108,25 @@ void Popup::_close_pressed() {
|
|
|
|
|
|
_deinitialize_visible_parents();
|
|
_deinitialize_visible_parents();
|
|
|
|
|
|
- call_deferred(SNAME("hide"));
|
|
|
|
|
|
+ // Hide after returning to process events, but only if we don't
|
|
|
|
+ // get popped up in the interim.
|
|
|
|
+ call_deferred(SNAME("_popup_conditional_hide"));
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+void Popup::_post_popup() {
|
|
|
|
+ Window::_post_popup();
|
|
|
|
+ popped_up = true;
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+void Popup::_popup_conditional_hide() {
|
|
|
|
+ if (!popped_up) {
|
|
|
|
+ hide();
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
void Popup::_bind_methods() {
|
|
void Popup::_bind_methods() {
|
|
ADD_SIGNAL(MethodInfo("popup_hide"));
|
|
ADD_SIGNAL(MethodInfo("popup_hide"));
|
|
|
|
+ ClassDB::bind_method(D_METHOD("_popup_conditional_hide"), &Popup::_popup_conditional_hide);
|
|
}
|
|
}
|
|
|
|
|
|
Rect2i Popup::_popup_adjust_rect() const {
|
|
Rect2i Popup::_popup_adjust_rect() const {
|