fix: harden recovery flow and clean diagnostics
This commit is contained in:
parent
0158b0215f
commit
ff78710303
64 changed files with 1163 additions and 418 deletions
|
|
@ -394,7 +394,10 @@ func _set_mode(mode: Mode, clear_connection_error: bool = true) -> void:
|
|||
_discovery_refresh_timer.stop()
|
||||
if not is_visible_in_tree():
|
||||
return
|
||||
_defer_focus_control(_address if mode == Mode.DIRECT else _server_list)
|
||||
var initial_focus: Control = _server_list
|
||||
if mode == Mode.DIRECT:
|
||||
initial_focus = _address
|
||||
_defer_focus_control(initial_focus)
|
||||
|
||||
|
||||
func _default_mode_status(mode: Mode) -> String:
|
||||
|
|
@ -688,9 +691,10 @@ func _restore_entry_selection_and_focus(
|
|||
_selected_entry = null
|
||||
_server_list.deselect_all()
|
||||
_refresh()
|
||||
_defer_focus_control(
|
||||
_server_list if selected else _current_mode_button()
|
||||
)
|
||||
var restored_focus: Control = _current_mode_button()
|
||||
if selected:
|
||||
restored_focus = _server_list
|
||||
_defer_focus_control(restored_focus)
|
||||
|
||||
|
||||
func _current_mode_button() -> Button:
|
||||
|
|
@ -1203,10 +1207,10 @@ func _recover_controller_focus(
|
|||
) -> void:
|
||||
if not is_visible_in_tree():
|
||||
return
|
||||
var owner: Control = get_viewport().gui_get_focus_owner()
|
||||
if owner != null and owner in controls:
|
||||
var focus_owner: Control = get_viewport().gui_get_focus_owner()
|
||||
if focus_owner != null and focus_owner in controls:
|
||||
return
|
||||
if owner != null and _delete_confirmation.is_ancestor_of(owner):
|
||||
if focus_owner != null and _delete_confirmation.is_ancestor_of(focus_owner):
|
||||
return
|
||||
if fallback != null:
|
||||
_defer_focus_control(fallback)
|
||||
|
|
@ -1539,7 +1543,9 @@ func _on_back_pressed() -> void:
|
|||
if _name_entry_active:
|
||||
_clear_edit_state()
|
||||
_refresh()
|
||||
var content: Control = _address if _mode == Mode.DIRECT else _server_list
|
||||
var content: Control = _server_list
|
||||
if _mode == Mode.DIRECT:
|
||||
content = _address
|
||||
_defer_focus_control(content)
|
||||
return
|
||||
if (
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue