Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prevent some internal nodes being duplicated #88114

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions scene/gui/color_picker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1535,6 +1535,7 @@ void ColorPicker::_pick_button_pressed() {
picker_window->set_size(Vector2i(1, 1));
picker_window->connect(SceneStringName(visibility_changed), callable_mp(this, &ColorPicker::_pick_finished));
add_child(picker_window, false, INTERNAL_MODE_FRONT);
picker_window->force_parent_owned();
}
picker_window->popup();
}
Expand Down Expand Up @@ -1564,6 +1565,7 @@ void ColorPicker::_pick_button_pressed_legacy() {
picker_window->hide();
picker_window->set_transient(true);
add_child(picker_window, false, INTERNAL_MODE_FRONT);
picker_window->force_parent_owned();

picker_texture_rect = memnew(TextureRect);
picker_texture_rect->set_anchors_preset(Control::PRESET_FULL_RECT);
Expand Down Expand Up @@ -2181,6 +2183,7 @@ void ColorPickerButton::_update_picker() {
picker->set_anchors_and_offsets_preset(PRESET_FULL_RECT);
popup->add_child(picker);
add_child(popup, false, INTERNAL_MODE_FRONT);
popup->force_parent_owned();
picker->connect("color_changed", callable_mp(this, &ColorPickerButton::_color_changed));
popup->connect("about_to_popup", callable_mp(this, &ColorPickerButton::_about_to_popup));
popup->connect("popup_hide", callable_mp(this, &ColorPickerButton::_modal_closed));
Expand Down
1 change: 1 addition & 0 deletions scene/gui/line_edit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2651,6 +2651,7 @@ Key LineEdit::_get_menu_action_accelerator(const String &p_action) {
void LineEdit::_generate_context_menu() {
menu = memnew(PopupMenu);
add_child(menu, false, INTERNAL_MODE_FRONT);
menu->force_parent_owned();

menu_dir = memnew(PopupMenu);
menu_dir->add_radio_check_item(ETR("Same as Layout Direction"), MENU_DIR_INHERITED);
Expand Down
1 change: 1 addition & 0 deletions scene/gui/rich_text_label.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6528,6 +6528,7 @@ Size2 RichTextLabel::get_minimum_size() const {
void RichTextLabel::_generate_context_menu() {
menu = memnew(PopupMenu);
add_child(menu, false, INTERNAL_MODE_FRONT);
menu->force_parent_owned();
menu->connect(SceneStringName(id_pressed), callable_mp(this, &RichTextLabel::menu_option));

menu->add_item(ETR("Copy"), MENU_COPY);
Expand Down
1 change: 1 addition & 0 deletions scene/gui/tab_container.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -761,6 +761,7 @@ void TabContainer::set_all_tabs_in_front(bool p_in_front) {

remove_child(tab_bar);
add_child(tab_bar, false, all_tabs_in_front ? INTERNAL_MODE_FRONT : INTERNAL_MODE_BACK);
tab_bar->force_parent_owned();
}

bool TabContainer::is_all_tabs_in_front() const {
Expand Down
1 change: 1 addition & 0 deletions scene/gui/text_edit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7387,6 +7387,7 @@ Key TextEdit::_get_menu_action_accelerator(const String &p_action) {
void TextEdit::_generate_context_menu() {
menu = memnew(PopupMenu);
add_child(menu, false, INTERNAL_MODE_FRONT);
menu->force_parent_owned();

menu_dir = memnew(PopupMenu);
menu_dir->add_radio_check_item(ETR("Same as Layout Direction"), MENU_DIR_INHERITED);
Expand Down
Loading