From 4cf0e7acfb42bcbd244c3ef467354dca79eb8eee Mon Sep 17 00:00:00 2001 From: Philipp Oeser Date: Wed, 30 Aug 2023 16:19:38 +0200 Subject: [PATCH] Fix: Enter on the filebrowser filename label skips operator Regression from c3dfe1e20440cdf98ad84d781d5d1ba91d549cf0. Above commit put a dummy dragable button over the filename (well, to allow dragging). Enabling drag ripples down to the button ending up in the `BUTTON_STATE_HIGHLIGHT` state [which is still good of course]. However, `ui_do_but_EXIT` will then return `WM_UI_HANDLER_BREAK` which then results in the filebrowser operator being skipped. `ui_do_but_EXIT` already had a special case for file-browser drag button [which would return `WM_UI_HANDLER_CONTINUE` instead]. Formerly this was just the icon, now it is the icon and filename label. So in order to fix this, remove the explicit check for the `but->imb` which will then include the dragable label button in the exception for returning `WM_UI_HANDLER_CONTINUE`. Fixes #111645. Pull Request: https://projects.blender.org/blender/blender/pulls/111693 --- source/blender/editors/interface/interface_handlers.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/source/blender/editors/interface/interface_handlers.cc b/source/blender/editors/interface/interface_handlers.cc index ee2479db81e..68a93309f08 100644 --- a/source/blender/editors/interface/interface_handlers.cc +++ b/source/blender/editors/interface/interface_handlers.cc @@ -4900,9 +4900,9 @@ static int ui_do_but_EXIT(bContext *C, uiBut *but, uiHandleButtonData *data, con if (ELEM(event->type, LEFTMOUSE, EVT_PADENTER, EVT_RETKEY) && event->val == KM_PRESS) { int ret = WM_UI_HANDLER_BREAK; - /* XXX: (a bit ugly) Special case handling for file-browser drag button. */ - if (ui_but_drag_is_draggable(but) && but->imb && - ui_but_contains_point_px_icon(but, data->region, event)) + /* XXX: (a bit ugly) Special case handling for file-browser drag buttons (icon and filename + * label). */ + if (ui_but_drag_is_draggable(but) && ui_but_contains_point_px_icon(but, data->region, event)) { ret = WM_UI_HANDLER_CONTINUE; }