* fix for resetting window size on builtin b.blend startup.
authorMatt Ebb <matt@mke3.net>
Sat, 30 May 2009 07:26:45 +0000 (07:26 +0000)
committerMatt Ebb <matt@mke3.net>
Sat, 30 May 2009 07:26:45 +0000 (07:26 +0000)
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
source/blender/windowmanager/intern/wm_files.c

index c7c2363216123b12f77358fa16ce318664262467..37fdc9fa2c5ff63a87713a238e99aee84df73b80 100644 (file)
@@ -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;
+       }
 
 }
 
index 0e6681b134de85cf04d525232ff82b58f81525b1..d13d8ec6ccc66a8eb7e91424cb85e34b0cb6c727 100644 (file)
@@ -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 */