[Bf-blender-cvs] [c532695] master: UI: Fix crash using drag-toggle over window bounds with button callback

Julian Eisel noreply at git.blender.org
Wed Sep 21 00:45:00 CEST 2016


Commit: c5326958a5f3d5ed07b0a69822bb049ca21f5aac
Author: Julian Eisel
Date:   Wed Sep 21 00:29:28 2016 +0200
Branches: master
https://developer.blender.org/rBc5326958a5f3d5ed07b0a69822bb049ca21f5aac

UI: Fix crash using drag-toggle over window bounds with button callback

Steps to reproduce:
* Go to modifier context in properties editor
* Add modifier, collapse it
* Press down LMB over collapse button of modifier, hold it
* Drag over pin-icon in properties editor (to keep fixed data-block displayed)
* Drag outside of window bounds (should crash)

Also could've solved by getting space data from callback arguments instead of context, but this fix is much nicer (though not totally un-risky).

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

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

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

diff --git a/source/blender/editors/interface/interface_handlers.c b/source/blender/editors/interface/interface_handlers.c
index 933beaf..3d3e9f9 100644
--- a/source/blender/editors/interface/interface_handlers.c
+++ b/source/blender/editors/interface/interface_handlers.c
@@ -1266,6 +1266,10 @@ static bool ui_drag_toggle_set_xy_xy(
 			}
 		}
 	}
+	if (changed) {
+		/* apply now, not on release (or if handlers are cancelled for whatever reason) */
+		ui_apply_but_funcs_after(C);
+	}
 
 	return changed;
 }




More information about the Bf-blender-cvs mailing list