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).
This commit is contained in:
Julian Eisel
2016-09-21 00:29:28 +02:00
parent 2382d1c401
commit c5326958a5

View File

@@ -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;
}