From 136099a4d57e6308167722abe7d946d324a5b57a Mon Sep 17 00:00:00 2001 From: Rob Loach Date: Sun, 7 Jun 2026 14:07:42 -0400 Subject: [PATCH] Revert "fix: scroll to active widget on set_active_parent (#241)" This reverts commit 500ddc6114b5014916536ef83242c33b71e51347. --- nuklear_console.h | 21 ++++----------------- 1 file changed, 4 insertions(+), 17 deletions(-) diff --git a/nuklear_console.h b/nuklear_console.h index 5e9b71d..32a61fe 100644 --- a/nuklear_console.h +++ b/nuklear_console.h @@ -707,25 +707,12 @@ NK_API void nk_console_set_active_parent(nk_console* new_parent) { return; } + // When switching parents, bring the window scroll to the top to that the window doesn't appear empty. + // TODO: Fix the scroll on the new window, since it may not be centered on the active widget. + nk_window_set_scroll(top->ctx, 0, 0); + nk_console_top_data* data = (nk_console_top_data*)top->data; data->active_parent = new_parent; - - // Scroll to the active widget; fall back to first selectable child, then top. - nk_console* target = new_parent->activeWidget; - if (target == NULL && new_parent->children != NULL) { - int count = (int)cvector_size(new_parent->children); - for (int i = 0; i < count; i++) { - if (nk_console_selectable(new_parent->children[i])) { - target = new_parent->children[i]; - break; - } - } - } - if (target != NULL) { - data->scroll_to_widget = target; - } else { - nk_window_set_scroll(top->ctx, 0, 0); - } } /**