From bf5f5bd3bd1bcd0678518e84ef778af30e940264 Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Fri, 23 Jul 2010 16:50:25 +0000 Subject: [PATCH] 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. --- .../blender/windowmanager/intern/wm_files.c | 30 ++++++++++--------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/source/blender/windowmanager/intern/wm_files.c b/source/blender/windowmanager/intern/wm_files.c index 6457e184066..04f5175b1bf 100644 --- a/source/blender/windowmanager/intern/wm_files.c +++ b/source/blender/windowmanager/intern/wm_files.c @@ -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; + } } }