[Bf-blender-cvs] [09b728ff3e3] master: Fix empty file options region in regular editor
Julian Eisel
noreply at git.blender.org
Fri Sep 20 12:28:42 CEST 2019
Commit: 09b728ff3e3702ab7718f8604a8712ce34783803
Author: Julian Eisel
Date: Fri Sep 20 12:03:32 2019 +0200
Branches: master
https://developer.blender.org/rB09b728ff3e3702ab7718f8604a8712ce34783803
Fix empty file options region in regular editor
This would happen when opening a file browser as regular editor, opening
a temporary file browser from there (e.g. Ctrl+O) and cancelling the
operation.
In some cases this would cause most of the editor to be filled with an
empty operator options region:
* Go to Shading workspace
* File -> Append
* Cancel
===================================================================
M source/blender/editors/space_file/space_file.c
===================================================================
diff --git a/source/blender/editors/space_file/space_file.c b/source/blender/editors/space_file/space_file.c
index d6a4eafc658..34429570671 100644
--- a/source/blender/editors/space_file/space_file.c
+++ b/source/blender/editors/space_file/space_file.c
@@ -225,6 +225,7 @@ static void file_refresh(const bContext *C, ScrArea *sa)
SpaceFile *sfile = CTX_wm_space_file(C);
FileSelectParams *params = ED_fileselect_get_params(sfile);
struct FSMenu *fsmenu = ED_fsmenu_get();
+ ARegion *region_tool_props = BKE_area_find_region_type(sa, RGN_TYPE_TOOL_PROPS);
if (!sfile->folders_prev) {
sfile->folders_prev = folderlist_new();
@@ -293,8 +294,9 @@ static void file_refresh(const bContext *C, ScrArea *sa)
ED_area_initialize(wm, win, sa);
}
- if (sa && sfile->op && BKE_area_find_region_type(sa, RGN_TYPE_TOOL_PROPS) == NULL) {
- /* Create TOOL_PROPS region. */
+
+ /* If there's an file-operation, ensure we have the option region */
+ if (sa && sfile->op && (region_tool_props == NULL)) {
ARegion *region_props = file_tool_props_region(sa);
if (params->flag & FILE_HIDE_TOOL_PROPS) {
@@ -303,6 +305,14 @@ static void file_refresh(const bContext *C, ScrArea *sa)
ED_area_initialize(wm, win, sa);
}
+ /* If there's _no_ file-operation, ensure we _don't_ have the option region */
+ else if (sa && (sfile->op == NULL) && (region_tool_props != NULL)) {
+ /* Remove TOOL_PROPS region. */
+ ED_region_exit((bContext *)C, region_tool_props);
+ BKE_area_region_free(sa->type, region_tool_props);
+ BLI_remlink(&sa->regionbase, region_tool_props);
+ MEM_freeN(region_tool_props);
+ }
ED_area_tag_redraw(sa);
}
More information about the Bf-blender-cvs
mailing list