From c1c11df3b867969ee763829dd61820d951f21d9f Mon Sep 17 00:00:00 2001 From: networkException Date: Tue, 23 Aug 2022 12:38:07 +0200 Subject: [PATCH] LibGUI: Don't call on_segment_change handler if the index did not change This patch makes the handler's behavior closer to what can be expected from it's name by not handling set_selected_segment if the segment is already selected. --- Userland/Libraries/LibGUI/Breadcrumbbar.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Userland/Libraries/LibGUI/Breadcrumbbar.cpp b/Userland/Libraries/LibGUI/Breadcrumbbar.cpp index 5e63b7a2df..d0c0eb0a4f 100644 --- a/Userland/Libraries/LibGUI/Breadcrumbbar.cpp +++ b/Userland/Libraries/LibGUI/Breadcrumbbar.cpp @@ -136,6 +136,8 @@ Optional Breadcrumbbar::find_segment_with_data(String const& data) void Breadcrumbbar::set_selected_segment(Optional index) { + if (m_selected_segment == index) + return; m_selected_segment = index; if (!index.has_value()) {