[Bf-blender-cvs] [19ec1bf] master: Fix T47691: Missing redraw w/ pop-up dialogs

Campbell Barton noreply at git.blender.org
Mon Mar 7 06:49:47 CET 2016


Commit: 19ec1bfa89f74dbda02ce62fcf9c88032840c624
Author: Campbell Barton
Date:   Mon Mar 7 16:38:22 2016 +1100
Branches: master
https://developer.blender.org/rB19ec1bfa89f74dbda02ce62fcf9c88032840c624

Fix T47691: Missing redraw w/ pop-up dialogs

Search buttons would overwrite existing callbacks, even when they weren't needed.
Causing missing updates for search buttons in pop-ups.

===================================================================

M	source/blender/editors/interface/interface.c

===================================================================

diff --git a/source/blender/editors/interface/interface.c b/source/blender/editors/interface/interface.c
index c220557..e18066f 100644
--- a/source/blender/editors/interface/interface.c
+++ b/source/blender/editors/interface/interface.c
@@ -4335,7 +4335,15 @@ void UI_but_func_search_set(
 	but->search_func = search_func;
 	but->search_arg = arg;
 	
-	UI_but_func_set(but, bfunc, arg, active);
+	if (bfunc) {
+#ifdef DEBUG
+		if (but->func) {
+			/* watch this, can be cause of much confusion, see: T47691 */
+			printf("%s: warning, overwriting button callback with search function callback!\n", __func__);
+		}
+#endif
+		UI_but_func_set(but, bfunc, arg, active);
+	}
 	
 	/* search buttons show red-alert if item doesn't exist, not for menus */
 	if (0 == (but->block->flag & UI_BLOCK_LOOP)) {




More information about the Bf-blender-cvs mailing list