diff options
author | Julian Eisel <julian@blender.org> | 2020-12-23 15:56:57 +0300 |
---|---|---|
committer | Julian Eisel <julian@blender.org> | 2020-12-23 16:34:24 +0300 |
commit | 78d2ce19c4fbb5678995efae74a6128a3dcc4e73 (patch) | |
tree | e1dfd265c69e30b8dc2527278d6b5fb15ead4228 /source/blender/editors/screen/screen_ops.c | |
parent | 9460051c1aa6aed8bcc027d61e314c13bc250564 (diff) |
Fix T84013: Crash closing maximized File Browser opened from Preferences
After 1e799dd26ec1, the logic to recognize a temporary File Browser window
didn't work correctly anymore. It would recognize a maximized File Browser
inside a temporary window as a temporary File Browser window, and attempt to
close this (rather than returning to the previous layout).
The logic there was pretty weak, and still is I think. A more stable solution
would need bigger refactoring.
With this, it's also not possible to maximize or fullscreen an area within a
temporary window (Preferences, File Browser, render window) anymore. Think that
won't make a noticable difference, since you couldn't open multiple areas there
anyway, and the area seems to be maximized already.
Cleaned up the code a bit to not become more confusing with the changes.
Diffstat (limited to 'source/blender/editors/screen/screen_ops.c')
-rw-r--r-- | source/blender/editors/screen/screen_ops.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/source/blender/editors/screen/screen_ops.c b/source/blender/editors/screen/screen_ops.c index 8768404d74f..87255bf8b5c 100644 --- a/source/blender/editors/screen/screen_ops.c +++ b/source/blender/editors/screen/screen_ops.c @@ -3138,6 +3138,8 @@ static int screen_maximize_area_exec(bContext *C, wmOperator *op) ScrArea *area = NULL; const bool hide_panels = RNA_boolean_get(op->ptr, "use_hide_panels"); + BLI_assert(!screen->temp); + /* search current screen for 'fullscreen' areas */ /* prevents restoring info header, when mouse is over it */ LISTBASE_FOREACH (ScrArea *, area_iter, &screen->areabase) { @@ -3169,11 +3171,14 @@ static int screen_maximize_area_exec(bContext *C, wmOperator *op) static bool screen_maximize_area_poll(bContext *C) { + const wmWindow *win = CTX_wm_window(C); const bScreen *screen = CTX_wm_screen(C); const ScrArea *area = CTX_wm_area(C); return ED_operator_areaactive(C) && /* Don't allow maximizing global areas but allow minimizing from them. */ - ((screen->state != SCREENNORMAL) || !ED_area_is_global(area)); + ((screen->state != SCREENNORMAL) || !ED_area_is_global(area)) && + /* Don't change temporary screens. */ + !WM_window_is_temp_screen(win); } static void SCREEN_OT_screen_full_area(wmOperatorType *ot) |