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:
authorBrecht Van Lommel <brecht@blender.org>2021-11-25 16:15:01 +0300
committerBrecht Van Lommel <brecht@blender.org>2021-11-25 16:45:19 +0300
commit3bf10e5d0ac297a70a9bc294fff0448e6b11fc20 (patch)
tree30e6d1571832fa3ed2e2e2aff7ec5ed58677b83e /source/blender/editors/interface/interface_handlers.c
parentffddf9e5c9175d25078ca441b21e5eb478ecd106 (diff)
Fix T89996, T90063: bugs with multi-button reset and entering values in popups
This reverts the changes to fix T87448, where entering the same value in number buttons causes an unnecessary update. This is not stable enough for 3.0 and so is being reverted, better to have an unnecessary update than no update in other cases. This effectively reverts the changes from rBeb06ccc32462 and follow up fixes rBe1a9ba94c599, rBbbb52a462ef9, rBec30cf0b742f, and rB071799d4fc44. The code is disabled with a comment on how it could be implemented better.
Diffstat (limited to 'source/blender/editors/interface/interface_handlers.c')
-rw-r--r--source/blender/editors/interface/interface_handlers.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/source/blender/editors/interface/interface_handlers.c b/source/blender/editors/interface/interface_handlers.c
index 6d69724efef..87a60f45257 100644
--- a/source/blender/editors/interface/interface_handlers.c
+++ b/source/blender/editors/interface/interface_handlers.c
@@ -1266,12 +1266,22 @@ static void ui_apply_but_TAB(bContext *C, uiBut *but, uiHandleButtonData *data)
static void ui_apply_but_NUM(bContext *C, uiBut *but, uiHandleButtonData *data)
{
if (data->str) {
+ /* This is intended to avoid unnecessary updates when the value stays the same, however there
+ * are issues with the current implementation. It does not work with multi-button editing
+ * (T89996) or operator popups where a number button requires an update even if the value is
+ * unchanged (T89996).
+ *
+ * Trying to detect changes at this level is not reliable. Instead it could be done at the
+ * level of RNA update/set, skipping RNA update if RNA set did not change anything, instead
+ * of skipping all button updates. */
+#if 0
double value;
/* Check if the string value is a number and cancel if it's equal to the startvalue. */
if (ui_but_string_eval_number(C, but, data->str, &value) && (value == data->startvalue)) {
data->cancel = true;
return;
}
+#endif
if (ui_but_string_set(C, but, data->str)) {
data->value = ui_but_value_get(but);