Merge pull request #106742 from bruvzg/about_to_popup

Call `PopupMenu`  min. size calculations after `about_to_popup` signal processing.
This commit is contained in:
Rémi Verschelde 2025-06-11 12:10:05 +02:00
commit 8aac4a157f
No known key found for this signature in database
GPG key ID: C3336907360768E1
4 changed files with 18 additions and 11 deletions

View file

@ -1994,6 +1994,8 @@ void Window::popup(const Rect2i &p_screen_rect) {
ERR_MAIN_THREAD_GUARD;
emit_signal(SNAME("about_to_popup"));
_pre_popup();
if (!get_embedder() && get_flag(FLAG_POPUP)) {
// Send a focus-out notification when opening a Window Manager Popup.
SceneTree *scene_tree = get_tree();

View file

@ -257,6 +257,7 @@ private:
static int root_layout_direction;
protected:
virtual void _pre_popup() {} // Called after "about_to_popup", but before window is shown.
virtual Rect2i _popup_adjust_rect() const { return Rect2i(); }
virtual void _post_popup() {}