Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <campbell@blender.org>2022-03-11 14:49:47 +0300
committerFabian Schempp <fabianschempp@googlemail.com>2022-04-11 01:30:38 +0300
commit924cf3b9665e346f1fa64f7eb18000afef8d2184 (patch)
tree6694fac0d1681b6a34c0e9869780ec1f8a3332ea /source/blender/editors/space_text
parentcbbc718b6f71b5799218123798c0dbdb80443b68 (diff)
Fix out of order event handling when calling operators from gizmos
Activating a gizmo used the windows eventstate which may have values newer than the event used to activate the gizmo. This meant transforms check for the key that activated transform could be incorrect. Support passing an event when calling operators to avoid this problem.
Diffstat (limited to 'source/blender/editors/space_text')
-rw-r--r--source/blender/editors/space_text/text_ops.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/source/blender/editors/space_text/text_ops.c b/source/blender/editors/space_text/text_ops.c
index 3c29b32c2fa..15fea301b1c 100644
--- a/source/blender/editors/space_text/text_ops.c
+++ b/source/blender/editors/space_text/text_ops.c
@@ -649,13 +649,13 @@ static int text_save_exec(bContext *C, wmOperator *op)
return OPERATOR_FINISHED;
}
-static int text_save_invoke(bContext *C, wmOperator *op, const wmEvent *UNUSED(event))
+static int text_save_invoke(bContext *C, wmOperator *op, const wmEvent *event)
{
Text *text = CTX_data_edit_text(C);
/* Internal and texts without a filepath will go to "Save As". */
if (text->filepath == NULL || (text->flags & TXT_ISMEM)) {
- WM_operator_name_call(C, "TEXT_OT_save_as", WM_OP_INVOKE_DEFAULT, NULL);
+ WM_operator_name_call(C, "TEXT_OT_save_as", WM_OP_INVOKE_DEFAULT, NULL, event);
return OPERATOR_CANCELLED;
}
return text_save_exec(C, op);
@@ -1098,10 +1098,10 @@ static int text_indent_or_autocomplete_exec(bContext *C, wmOperator *UNUSED(op))
TextLine *line = text->curl;
bool text_before_cursor = text->curc != 0 && !ELEM(line->line[text->curc - 1], ' ', '\t');
if (text_before_cursor && (txt_has_sel(text) == false)) {
- WM_operator_name_call(C, "TEXT_OT_autocomplete", WM_OP_INVOKE_DEFAULT, NULL);
+ WM_operator_name_call(C, "TEXT_OT_autocomplete", WM_OP_INVOKE_DEFAULT, NULL, NULL);
}
else {
- WM_operator_name_call(C, "TEXT_OT_indent", WM_OP_EXEC_DEFAULT, NULL);
+ WM_operator_name_call(C, "TEXT_OT_indent", WM_OP_EXEC_DEFAULT, NULL, NULL);
}
return OPERATOR_FINISHED;
}