popup deferred hide suppressed if reopened
popup no longer tries to close itself a second time popup no longer closes after having been reopened fixed bug in RenameDialog not calling base (by inspection) fixes #59181 fixes #60921 reverts #59287
This commit is contained in:
parent
677b63d765
commit
47d0dc8a41
@ -356,6 +356,8 @@ void RenameDialog::_update_substitute() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void RenameDialog::_post_popup() {
|
void RenameDialog::_post_popup() {
|
||||||
|
ConfirmationDialog::_post_popup();
|
||||||
|
|
||||||
EditorSelection *editor_selection = EditorNode::get_singleton()->get_editor_selection();
|
EditorSelection *editor_selection = EditorNode::get_singleton()->get_editor_selection();
|
||||||
preview_node = nullptr;
|
preview_node = nullptr;
|
||||||
|
|
||||||
|
@ -2158,7 +2158,10 @@ void DisplayServerWindows::popup_close(WindowID p_window) {
|
|||||||
WindowID win_id = E->get();
|
WindowID win_id = E->get();
|
||||||
popup_list.erase(E);
|
popup_list.erase(E);
|
||||||
|
|
||||||
|
if (win_id != p_window) {
|
||||||
|
// Only request close on related windows, not this window. We are already processing it.
|
||||||
_send_window_event(windows[win_id], DisplayServerWindows::WINDOW_EVENT_CLOSE_REQUEST);
|
_send_window_event(windows[win_id], DisplayServerWindows::WINDOW_EVENT_CLOSE_REQUEST);
|
||||||
|
}
|
||||||
E = F;
|
E = F;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -2173,6 +2176,7 @@ LRESULT DisplayServerWindows::MouseProc(int code, WPARAM wParam, LPARAM lParam)
|
|||||||
case WM_NCRBUTTONDOWN:
|
case WM_NCRBUTTONDOWN:
|
||||||
case WM_NCMBUTTONDOWN:
|
case WM_NCMBUTTONDOWN:
|
||||||
case WM_LBUTTONDOWN:
|
case WM_LBUTTONDOWN:
|
||||||
|
case WM_RBUTTONDOWN:
|
||||||
case WM_MBUTTONDOWN: {
|
case WM_MBUTTONDOWN: {
|
||||||
MOUSEHOOKSTRUCT *ms = (MOUSEHOOKSTRUCT *)lParam;
|
MOUSEHOOKSTRUCT *ms = (MOUSEHOOKSTRUCT *)lParam;
|
||||||
Point2i pos = Point2i(ms->pt.x, ms->pt.y);
|
Point2i pos = Point2i(ms->pt.x, ms->pt.y);
|
||||||
|
@ -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 {
|
||||||
|
@ -57,6 +57,10 @@ protected:
|
|||||||
void _notification(int p_what);
|
void _notification(int p_what);
|
||||||
static void _bind_methods();
|
static void _bind_methods();
|
||||||
|
|
||||||
|
void _popup_conditional_hide();
|
||||||
|
|
||||||
|
virtual void _post_popup() override;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
Popup();
|
Popup();
|
||||||
~Popup();
|
~Popup();
|
||||||
|
Loading…
Reference in New Issue
Block a user