summaryrefslogtreecommitdiff
path: root/scene
diff options
context:
space:
mode:
Diffstat (limited to 'scene')
-rw-r--r--scene/2d/visibility_notifier_2d.cpp17
-rw-r--r--scene/gui/line_edit.cpp4
2 files changed, 17 insertions, 4 deletions
diff --git a/scene/2d/visibility_notifier_2d.cpp b/scene/2d/visibility_notifier_2d.cpp
index c374dd5faa..780d08693d 100644
--- a/scene/2d/visibility_notifier_2d.cpp
+++ b/scene/2d/visibility_notifier_2d.cpp
@@ -248,10 +248,19 @@ void VisibilityEnabler2D::_notification(int p_what) {
_find_nodes(from);
- if (enabler[ENABLER_PARENT_PHYSICS_PROCESS] && get_parent())
- get_parent()->set_physics_process(false);
- if (enabler[ENABLER_PARENT_PROCESS] && get_parent())
- get_parent()->set_process(false);
+ // We need to defer the call of set_process and set_physics_process,
+ // otherwise they are overwritten inside NOTIFICATION_READY.
+ // We can't use call_deferred, because it happens after a physics frame.
+ // The ready signal works as it's emitted immediately after NOTIFICATION_READY.
+
+ if (enabler[ENABLER_PARENT_PHYSICS_PROCESS] && get_parent()) {
+ get_parent()->connect(SceneStringNames::get_singleton()->ready,
+ callable_mp(get_parent(), &Node::set_physics_process), varray(false), CONNECT_ONESHOT);
+ }
+ if (enabler[ENABLER_PARENT_PROCESS] && get_parent()) {
+ get_parent()->connect(SceneStringNames::get_singleton()->ready,
+ callable_mp(get_parent(), &Node::set_process), varray(false), CONNECT_ONESHOT);
+ }
}
if (p_what == NOTIFICATION_EXIT_TREE) {
diff --git a/scene/gui/line_edit.cpp b/scene/gui/line_edit.cpp
index 8574b05016..bb177ae0e7 100644
--- a/scene/gui/line_edit.cpp
+++ b/scene/gui/line_edit.cpp
@@ -277,10 +277,14 @@ void LineEdit::_gui_input(Ref<InputEvent> p_event) {
} break;
#ifdef APPLE_STYLE_KEYS
case (KEY_LEFT): { // Go to start of text - like HOME key.
+ shift_selection_check_pre(k->get_shift());
set_cursor_position(0);
+ shift_selection_check_post(k->get_shift());
} break;
case (KEY_RIGHT): { // Go to end of text - like END key.
+ shift_selection_check_pre(k->get_shift());
set_cursor_position(text.length());
+ shift_selection_check_post(k->get_shift());
} break;
#endif
default: {