Fix #20863: when loading a file without UI, with multiple windows open,
the other windows would not preserve the screens correctly, code for reading 2.4x files was running when it didn't need to.
This commit is contained in:
@@ -179,21 +179,23 @@ static void wm_window_match_do(bContext *C, ListBase *oldwmlist)
|
||||
|
||||
/* we've read file without wm..., keep current one entirely alive */
|
||||
if(G.main->wm.first==NULL) {
|
||||
bScreen *screen= CTX_wm_screen(C);
|
||||
|
||||
/* match oldwm to new dbase, only old files */
|
||||
|
||||
for(wm= oldwmlist->first; wm; wm= wm->id.next) {
|
||||
|
||||
for(win= wm->windows.first; win; win= win->next) {
|
||||
/* all windows get active screen from file */
|
||||
if(screen->winid==0)
|
||||
win->screen= screen;
|
||||
else
|
||||
win->screen= ED_screen_duplicate(win, screen);
|
||||
/* when loading without UI, no matching needed */
|
||||
if(!(G.fileflags & G_FILE_NO_UI)) {
|
||||
bScreen *screen= CTX_wm_screen(C);
|
||||
|
||||
/* match oldwm to new dbase, only old files */
|
||||
for(wm= oldwmlist->first; wm; wm= wm->id.next) {
|
||||
|
||||
BLI_strncpy(win->screenname, win->screen->id.name+2, 21);
|
||||
win->screen->winid= win->winid;
|
||||
for(win= wm->windows.first; win; win= win->next) {
|
||||
/* all windows get active screen from file */
|
||||
if(screen->winid==0)
|
||||
win->screen= screen;
|
||||
else
|
||||
win->screen= ED_screen_duplicate(win, screen);
|
||||
|
||||
BLI_strncpy(win->screenname, win->screen->id.name+2, 21);
|
||||
win->screen->winid= win->winid;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user