From c41f8ea2ad9d2ec951cc978e44839460cd8f1f3a Mon Sep 17 00:00:00 2001 From: Matt Ebb Date: Sat, 30 May 2009 07:26:45 +0000 Subject: [PATCH] * fix for resetting window size on builtin b.blend startup. I think this should work ok for now, but would really appreciate someone who knows the windowmanager code well to take a look at it :) --- source/blender/windowmanager/intern/wm.c | 12 ++++++------ source/blender/windowmanager/intern/wm_files.c | 4 +--- 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/source/blender/windowmanager/intern/wm.c b/source/blender/windowmanager/intern/wm.c index c7c23632161..37fdc9fa2c5 100644 --- a/source/blender/windowmanager/intern/wm.c +++ b/source/blender/windowmanager/intern/wm.c @@ -136,12 +136,12 @@ void wm_clear_default_size(bContext *C) if(wm==NULL) return; if(wm->windows.first==NULL) return; - win = wm->windows.first; - win->sizex = 0; - win->sizey = 0; - win->posx = 0; - win->posy = 0; - win->windowstate= GHOST_kWindowStateMaximized; + for(win= wm->windows.first; win; win= win->next) { + win->sizex = 0; + win->sizey = 0; + win->posx = 0; + win->posy = 0; + } } diff --git a/source/blender/windowmanager/intern/wm_files.c b/source/blender/windowmanager/intern/wm_files.c index 0e6681b134d..d13d8ec6ccc 100644 --- a/source/blender/windowmanager/intern/wm_files.c +++ b/source/blender/windowmanager/intern/wm_files.c @@ -302,9 +302,6 @@ int WM_read_homefile(bContext *C, wmOperator *op) /* prevent loading no UI */ G.fileflags &= ~G_FILE_NO_UI; - if (from_memory) - wm_clear_default_size(C); - /* put aside screens to match with persistant windows later */ wm_window_match_init(C, &wmbase); @@ -312,6 +309,7 @@ int WM_read_homefile(bContext *C, wmOperator *op) success = BKE_read_file(C, tstr, NULL, NULL); } else { success = BKE_read_file_from_memory(C, datatoc_B_blend, datatoc_B_blend_size, NULL, NULL); + if (wmbase.first == NULL) wm_clear_default_size(C); } /* match the read WM with current WM */