From 0eb279de54ffbfe574b9b61c767b17ebbc53b911 Mon Sep 17 00:00:00 2001 From: Philipp Oeser Date: Tue, 7 Nov 2023 10:11:30 +0100 Subject: [PATCH] Fix #66286: DblClick to rename UIList items within a popover not working Looks like most of `ui_apply_but_XXX` or `ui_do_but_XXX` functions rely on `uiHandleButtonData` (and not necessarily context). Now the problem from a popover in `ui_but_list_row_text_activate` was that the label button to be set in BUTTON_ACTIVATE_TEXT_EDITING for renaming could not be found because it was using the "wrong" region from context (`CTX_wm_region` - which still seem to point to the region the popover was spawned from). The correct region is available in `uiHandleButtonData` though, so now use this instead. Not totally sure if `CTX_wm_region` should actually be correct in all cases - which would hint at an underlying problem of not setting it right - but since other functions rely on `uiHandleButtonData` as well, this fix seems to make sense. Fix should go into LTS I think. Pull Request: https://projects.blender.org/blender/blender/pulls/114363 --- source/blender/editors/interface/interface_handlers.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/blender/editors/interface/interface_handlers.cc b/source/blender/editors/interface/interface_handlers.cc index 9d35506430c..597f9b15160 100644 --- a/source/blender/editors/interface/interface_handlers.cc +++ b/source/blender/editors/interface/interface_handlers.cc @@ -4412,7 +4412,7 @@ static uiBut *ui_but_list_row_text_activate(bContext *C, const wmEvent *event, uiButtonActivateType activate_type) { - ARegion *region = CTX_wm_region(C); + ARegion *region = data->region; uiBut *labelbut = ui_but_find_mouse_over_ex(region, event->xy, true, false, nullptr, nullptr); if (labelbut && labelbut->type == UI_BTYPE_TEXT && !(labelbut->flag & UI_BUT_DISABLED)) {