From 7fead979d633e5472a485eca0441b5d3633e13fc Mon Sep 17 00:00:00 2001 From: Markus Sauermann <6299227+Sauermann@users.noreply.github.com> Date: Wed, 26 Jul 2023 20:15:18 +0200 Subject: [PATCH] Disable error condition for accessing safe rect This PR removes the error-message, which is currently expected to happen. The task of correctly fixing the underlying problem of window popup closing is more complex, so this PR solves the immediate error-notification-problem. --- scene/main/viewport.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/scene/main/viewport.cpp b/scene/main/viewport.cpp index d26bb49d09a7..d9a1cfe96561 100644 --- a/scene/main/viewport.cpp +++ b/scene/main/viewport.cpp @@ -3510,7 +3510,12 @@ void Viewport::subwindow_set_popup_safe_rect(Window *p_window, const Rect2i &p_r Rect2i Viewport::subwindow_get_popup_safe_rect(Window *p_window) const { int index = _sub_window_find(p_window); - ERR_FAIL_COND_V(index == -1, Rect2i()); + // FIXME: Re-enable ERR_FAIL_COND after rewriting embedded window popup closing. + // Currently it is expected, that index == -1 can happen. + if (index == -1) { + return Rect2i(); + } + // ERR_FAIL_COND_V(index == -1, Rect2i()); return gui.sub_windows[index].parent_safe_rect; }