diff options
author | Nathan Letwory <nathan@letworyinteractive.com> | 2010-10-15 11:31:26 +0400 |
---|---|---|
committer | Nathan Letwory <nathan@letworyinteractive.com> | 2010-10-15 11:31:26 +0400 |
commit | bb11d6337e334b9ceb6fc9b27c8f0aba13897d9a (patch) | |
tree | 0effb69bb4e7508f93ac692c7bc32f61e9db512b /source/blender | |
parent | 271bbf4a0d7390f68ac973aa83bbb89fd0e4f583 (diff) |
Fix [#24260] Window geometry command-line option doesn't work
Override the first window size with --window-geometry if given. startup.blend would otherwise open as lastly saved.
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/windowmanager/intern/wm_window.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/source/blender/windowmanager/intern/wm_window.c b/source/blender/windowmanager/intern/wm_window.c index d9d7abd3a68..3600267dabc 100644 --- a/source/blender/windowmanager/intern/wm_window.c +++ b/source/blender/windowmanager/intern/wm_window.c @@ -68,6 +68,7 @@ GHOST_SystemHandle g_system= NULL; /* set by commandline */ static int prefsizx= 0, prefsizy= 0, prefstax= 0, prefstay= 0, initialstate= GHOST_kWindowStateNormal; +static int prefsizeused = 0; /* ******** win open & close ************ */ @@ -372,18 +373,19 @@ void wm_window_add_ghostwindows(bContext* C, wmWindowManager *wm) for(win= wm->windows.first; win; win= win->next) { if(win->ghostwin==NULL) { - if(win->sizex==0) { + if(win->sizex==0 || prefsizeused==0) { win->posx= prefstax; win->posy= prefstay; win->sizex= prefsizx; win->sizey= prefsizy; win->windowstate= initialstate; + prefsizeused= 1; } wm_window_add_ghostwindow(C, wm, "Blender", win); } /* happens after fileread */ if(win->eventstate==NULL) - win->eventstate= MEM_callocN(sizeof(wmEvent), "window event state"); + win->eventstate= MEM_callocN(sizeof(wmEvent), "window event state"); /* add keymap handlers (1 handler for all keys in map!) */ keymap= WM_keymap_find(wm->defaultconf, "Window", 0, 0); |