* Updated blender 2.5 default setup
Simplified and started from a clean slate, without much of the hidden existing space data that was hanging around in the old one. One issue I found is that saving the startup file from Blender 2.5 also saves the window size and location. This means the version I just saved would open up strangely on other screen sizes/setups. I added code to reset this to default when loading it up from the version compiled into the Blender binary, but perhaps Ton/ Brecht might want to check the diff.
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -30,6 +30,8 @@
|
|||||||
|
|
||||||
#include "MEM_guardedalloc.h"
|
#include "MEM_guardedalloc.h"
|
||||||
|
|
||||||
|
#include "GHOST_C-api.h"
|
||||||
|
|
||||||
#include "BLI_blenlib.h"
|
#include "BLI_blenlib.h"
|
||||||
|
|
||||||
#include "BKE_blender.h"
|
#include "BKE_blender.h"
|
||||||
@@ -121,6 +123,28 @@ void wm_check(bContext *C)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void wm_clear_default_size(bContext *C)
|
||||||
|
{
|
||||||
|
wmWindowManager *wm= CTX_wm_manager(C);
|
||||||
|
wmWindow *win;
|
||||||
|
|
||||||
|
/* wm context */
|
||||||
|
if(wm==NULL) {
|
||||||
|
wm= CTX_data_main(C)->wm.first;
|
||||||
|
CTX_wm_manager_set(C, wm);
|
||||||
|
}
|
||||||
|
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;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
/* on startup, it adds all data, for matching */
|
/* on startup, it adds all data, for matching */
|
||||||
void wm_add_default(bContext *C)
|
void wm_add_default(bContext *C)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -309,6 +309,7 @@ int WM_read_homefile(bContext *C, wmOperator *op)
|
|||||||
success = BKE_read_file(C, tstr, NULL, NULL);
|
success = BKE_read_file(C, tstr, NULL, NULL);
|
||||||
} else {
|
} else {
|
||||||
success = BKE_read_file_from_memory(C, datatoc_B_blend, datatoc_B_blend_size, NULL, NULL);
|
success = BKE_read_file_from_memory(C, datatoc_B_blend, datatoc_B_blend_size, NULL, NULL);
|
||||||
|
wm_clear_default_size(C);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* match the read WM with current WM */
|
/* match the read WM with current WM */
|
||||||
|
|||||||
@@ -44,6 +44,7 @@ extern void wm_close_and_free_all(bContext *C, ListBase *);
|
|||||||
|
|
||||||
extern void wm_add_default(bContext *C);
|
extern void wm_add_default(bContext *C);
|
||||||
extern void wm_check(bContext *C);
|
extern void wm_check(bContext *C);
|
||||||
|
extern void wm_clear_default_size(bContext *C);
|
||||||
|
|
||||||
/* register to windowmanager for redo or macro */
|
/* register to windowmanager for redo or macro */
|
||||||
void wm_operator_register(wmWindowManager *wm, wmOperator *op);
|
void wm_operator_register(wmWindowManager *wm, wmOperator *op);
|
||||||
|
|||||||
Reference in New Issue
Block a user