mirror of
https://github.com/Redot-Engine/redot-engine.git
synced 2025-12-06 07:17:42 -05:00
Popup: Reset state on visibility change
The original logic was never called for certain platforms, leaving the hide reason unset and causing weird semi-random issues with the few users of that internal API, such as when renaming nodes in the scene tree editor.
This commit is contained in:
@@ -78,6 +78,8 @@ void Popup::_notification(int p_what) {
|
|||||||
if (!is_in_edited_scene_root()) {
|
if (!is_in_edited_scene_root()) {
|
||||||
if (is_visible()) {
|
if (is_visible()) {
|
||||||
_initialize_visible_parents();
|
_initialize_visible_parents();
|
||||||
|
popped_up = true;
|
||||||
|
hide_reason = HIDE_REASON_NONE;
|
||||||
} else {
|
} else {
|
||||||
_deinitialize_visible_parents();
|
_deinitialize_visible_parents();
|
||||||
if (hide_reason == HIDE_REASON_NONE) {
|
if (hide_reason == HIDE_REASON_NONE) {
|
||||||
@@ -89,15 +91,6 @@ void Popup::_notification(int p_what) {
|
|||||||
}
|
}
|
||||||
} break;
|
} break;
|
||||||
|
|
||||||
case NOTIFICATION_WM_WINDOW_FOCUS_IN: {
|
|
||||||
if (!is_in_edited_scene_root()) {
|
|
||||||
if (has_focus()) {
|
|
||||||
popped_up = true;
|
|
||||||
hide_reason = HIDE_REASON_NONE;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} break;
|
|
||||||
|
|
||||||
case NOTIFICATION_UNPARENTED:
|
case NOTIFICATION_UNPARENTED:
|
||||||
case NOTIFICATION_EXIT_TREE: {
|
case NOTIFICATION_EXIT_TREE: {
|
||||||
if (!is_in_edited_scene_root()) {
|
if (!is_in_edited_scene_root()) {
|
||||||
|
|||||||
Reference in New Issue
Block a user