From 5741f7b8a95ce63b3d5cd00c9818d47e93bb23cb Mon Sep 17 00:00:00 2001 From: Harley Acheson Date: Wed, 20 Dec 2023 01:14:10 +0100 Subject: [PATCH] Fix #114461: Check Interactivity in button comparisons Implementation of Julian Eisel's idea of including interactivity in button comparisons to avoid bad label matches. Pull Request: https://projects.blender.org/blender/blender/pulls/116228 --- source/blender/editors/interface/interface.cc | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/source/blender/editors/interface/interface.cc b/source/blender/editors/interface/interface.cc index 749cd6e08e0..7c654956ce0 100644 --- a/source/blender/editors/interface/interface.cc +++ b/source/blender/editors/interface/interface.cc @@ -774,6 +774,13 @@ static bool ui_but_equals_old(const uiBut *but, const uiBut *oldbut) return false; } + /* If the old button is active for interaction, but the new one isn't interactive, + * do not consider them matching. Avoids incorrect matches with label buttons, which + * usually do not have data that can be used for comparison. See #114461. */ + if (oldbut->active && !ui_but_is_interactive(but, false)) { + return false; + } + if ((but->type == UI_BTYPE_VIEW_ITEM) && (oldbut->type == UI_BTYPE_VIEW_ITEM)) { uiButViewItem *but_item = (uiButViewItem *)but; uiButViewItem *oldbut_item = (uiButViewItem *)oldbut;