소스 검색

Fix Connection dock's popups always allowing disconnect

Micky 2 년 전
부모
커밋
4471e7fe92
1개의 변경된 파일5개의 추가작업 그리고 0개의 파일을 삭제
  1. 5 0
      editor/connections_dialog.cpp

+ 5 - 0
editor/connections_dialog.cpp

@@ -1213,6 +1213,11 @@ void ConnectionsDock::_rmb_pressed(const Ref<InputEvent> &p_event) {
 		return;
 	}
 
+	if (item->is_selectable(0)) {
+		// Update selection now, before `about_to_popup` signal. Needed for SIGNAL and CONNECTION context menus.
+		tree->set_selected(item);
+	}
+
 	Vector2 screen_position = tree->get_screen_position() + mb_event->get_position();
 
 	switch (_get_item_type(*item)) {