Skip to content

Commit

Permalink
Disable error condition for accessing safe rect
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
Sauermann committed Jul 26, 2023
1 parent 8367152 commit 7fead97
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion scene/main/viewport.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 7fead97

Please sign in to comment.