From 6c8c30d865ee8aafc3a088ce97b1caa4c4cc9ed7 Mon Sep 17 00:00:00 2001 From: Severin Date: Wed, 5 May 2021 20:36:12 +0200 Subject: Fix T82002: ENTER does nothing when mouse cursor is over save dialog text field The `file.execute` operator would early-exit because the mouse wasn't hovering the file list. Caused by 4ba9d7d71e8f. Although simpler solutions would have been possible, I decided it's better to split add a new operator for executing based on the mouse (for double-clicking files), to separate that from the window level execute operator (`file.execute`). This allows more control and we can get rid of the implicit assumption that the keymap would call `file.select` on mouse-press, and `file.execute` on double-click, for the double-click behavior to work. The cost is that we execute the file selection & activation logic twice on the double-click, but that shouldn't be an issue at all. Also removes the `need_active` property from the `file.execute` operator. That's ancient and wasn't implemented well anyway. To be clear, reason this fixes the bug is that `file.execute` works entirely with the `execute()` callback now and doesn't early-exit based on the mouse position anymore. Might trigger warnings about the `need_active` property not being found for custom keymaps. These can be ignored and the property can safely be removed from the keymap. I don't expect other keymap breakages. --- source/blender/editors/space_file/space_file.c | 1 + 1 file changed, 1 insertion(+) (limited to 'source/blender/editors/space_file/space_file.c') diff --git a/source/blender/editors/space_file/space_file.c b/source/blender/editors/space_file/space_file.c index 4422a685af1..12bc0a68ca6 100644 --- a/source/blender/editors/space_file/space_file.c +++ b/source/blender/editors/space_file/space_file.c @@ -663,6 +663,7 @@ static void file_operatortypes(void) WM_operatortype_append(FILE_OT_highlight); WM_operatortype_append(FILE_OT_sort_column_ui_context); WM_operatortype_append(FILE_OT_execute); + WM_operatortype_append(FILE_OT_mouse_execute); WM_operatortype_append(FILE_OT_cancel); WM_operatortype_append(FILE_OT_parent); WM_operatortype_append(FILE_OT_previous); -- cgit v1.2.3