Fix for deleting screen w/ temp screens in list

If the next screen to use was temporary, deleting the screen would fail.
This commit is contained in:
Campbell Barton 2015-08-26 12:41:23 +10:00
parent e066a33314
commit 3ee74feb2b
Notes: blender-bot 2023-02-14 08:42:53 +01:00
Referenced by issue #45943, Shading mismatch between CPU and CUDA
1 changed files with 15 additions and 6 deletions

View File

@ -1568,15 +1568,24 @@ void ED_screen_set(bContext *C, bScreen *sc)
}
}
static int ed_screen_used(wmWindowManager *wm, bScreen *sc)
static bool ed_screen_used(wmWindowManager *wm, bScreen *sc)
{
wmWindow *win;
for (win = wm->windows.first; win; win = win->next)
if (win->screen == sc)
return 1;
return 0;
for (win = wm->windows.first; win; win = win->next) {
if (win->screen == sc) {
return true;
}
if (ELEM(win->screen->state, SCREENMAXIMIZED, SCREENFULL)) {
ScrArea *sa = win->screen->areabase.first;
if (sa->full == sc) {
return true;
}
}
}
return false;
}
/* only call outside of area/region loops */