Browse Source

Merge pull request #109927 from deralmas/no-reason-to-hide

Popup: Reset state on visibility change
Thaddeus Crews 2 tuần trước cách đây
mục cha
commit
9c5cb0d38f
1 tập tin đã thay đổi với 2 bổ sung9 xóa
  1. 2 9
      scene/gui/popup.cpp

+ 2 - 9
scene/gui/popup.cpp

@@ -78,6 +78,8 @@ void Popup::_notification(int p_what) {
 			if (!is_in_edited_scene_root()) {
 				if (is_visible()) {
 					_initialize_visible_parents();
+					popped_up = true;
+					hide_reason = HIDE_REASON_NONE;
 				} else {
 					_deinitialize_visible_parents();
 					if (hide_reason == HIDE_REASON_NONE) {
@@ -89,15 +91,6 @@ void Popup::_notification(int p_what) {
 			}
 		} 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_EXIT_TREE: {
 			if (!is_in_edited_scene_root()) {