From d83a72ec104ce941b8f5a4c4cb63c805917b7efd Mon Sep 17 00:00:00 2001 From: Julian Eisel Date: Sat, 4 May 2019 15:12:55 +0200 Subject: [PATCH] Fix crash activating a fullscreened screen Steps to reproduce were: * Duplicate some area into new window (shift-click corner triangle) * Make it fullscreen * Close the window again * Activate the added screen from the menu (the one without the -nonnormal prefix) -> Crash (you may have to press "Back to Previous" first though) When activating a screen, code should check if there's a fullscreen variant of it and activate that instead. From what I can tell that's what the code tried to do, but incorrectly. Same issue as T64045, but things are a bit different for 2.7. --- source/blender/editors/screen/screen_edit.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/source/blender/editors/screen/screen_edit.c b/source/blender/editors/screen/screen_edit.c index f777b42c5bd..3d2a3e395b9 100644 --- a/source/blender/editors/screen/screen_edit.c +++ b/source/blender/editors/screen/screen_edit.c @@ -1195,10 +1195,9 @@ bool ED_screen_set(bContext *C, bScreen *sc) return true; } - if (ELEM(sc->state, SCREENMAXIMIZED, SCREENFULL)) { - /* find associated full */ - bScreen *sc1; - for (sc1 = bmain->screen.first; sc1; sc1 = sc1->id.next) { + /* find associated full */ + for (bScreen *sc1 = bmain->screen.first; sc1; sc1 = sc1->id.next) { + if ((sc1 != sc) && ELEM(sc1->state, SCREENMAXIMIZED, SCREENFULL)) { ScrArea *sa = sc1->areabase.first; if (sa->full == sc) { sc = sc1;