Fix stashed full-screens returning to wrong layout
authorJulian Eisel <eiseljulian@gmail.com>
Sat, 9 Mar 2019 15:58:13 +0000 (16:58 +0100)
committerJulian Eisel <eiseljulian@gmail.com>
Sat, 9 Mar 2019 15:58:13 +0000 (16:58 +0100)
Steps to reproduce were:
* Maximize area (Shift+Spacebar in 2.7, Ctrl+Spacebar in 2.8)
* Open temp file browser (Ctrl+O)
* Cancel file browser (Esc) - should return to previous full-screen
* Press "Return to Previous" button
The previously maximized area would turn into a file-browser.

Note that the issue will still happen when opening old files saved while
in maximized area full-screen.

source/blender/editors/screen/area.c
source/blender/editors/screen/screen_edit.c

index 152cb28..9e341c9 100644 (file)
@@ -1729,7 +1729,7 @@ void ED_area_prevspace(bContext *C, ScrArea *sa)
                /* no change */
                return;
        }
-       sa->flag &= ~AREA_FLAG_STACKED_FULLSCREEN;
+       sa->flag &= ~(AREA_FLAG_STACKED_FULLSCREEN | AREA_FLAG_TEMP_TYPE);
 
        ED_area_tag_redraw(sa);
 
index 2754b78..f777b42 100644 (file)
@@ -1527,7 +1527,8 @@ void ED_screen_restore_temp_type(bContext *C, ScrArea *sa)
 
        if (sa->flag & AREA_FLAG_TEMP_TYPE) {
                ED_area_prevspace(C, sa);
-               sa->flag &= ~AREA_FLAG_TEMP_TYPE;
+               /* Flag should be cleared now. */
+               BLI_assert((sa->flag & AREA_FLAG_TEMP_TYPE) == 0);
        }
 
        if (sa->full) {