WM: default to opening maximized

Blender is typically used maximized or fullscreen,
load maximized instead of attempting to fill the screen bounds.

To load un-maximized use '--window-border' argument.

See D4332
This commit is contained in:
Campbell Barton 2019-02-12 09:08:09 +11:00
parent 7cca0f9998
commit 2a6d03493c
Notes: blender-bot 2023-02-14 06:25:25 +01:00
Referenced by issue #60464, Full window (win32)
1 changed files with 21 additions and 7 deletions

View File

@ -95,23 +95,32 @@
/* the global to talk to ghost */
static GHOST_SystemHandle g_system = NULL;
typedef enum WinOverrideFlag {
typedef enum eWinOverrideFlag {
WIN_OVERRIDE_GEOM = (1 << 0),
WIN_OVERRIDE_WINSTATE = (1 << 1),
} WinOverrideFlag;
} eWinOverrideFlag;
/* set by commandline */
#define GHOST_WINDOW_STATE_DEFAULT GHOST_kWindowStateMaximized
/**
* Override defaults or startup file when #eWinOverrideFlag is set.
* These values are typically set by command line arguments.
*/
static struct WMInitStruct {
/* window geometry */
int size_x, size_y;
int start_x, start_y;
int windowstate;
WinOverrideFlag override_flag;
eWinOverrideFlag override_flag;
bool window_focus;
bool native_pixels;
} wm_init_state = {0, 0, 0, 0, GHOST_kWindowStateNormal, 0, true, true};
} wm_init_state = {
.windowstate = GHOST_WINDOW_STATE_DEFAULT,
.window_focus = true,
.native_pixels = true,
};
/* ******** win open & close ************ */
@ -748,8 +757,13 @@ void wm_window_ghostwindows_ensure(wmWindowManager *wm)
win->sizex = wm_init_state.size_x;
win->sizey = wm_init_state.size_y;
win->windowstate = GHOST_kWindowStateNormal;
wm_init_state.override_flag &= ~WIN_OVERRIDE_GEOM;
if (wm_init_state.override_flag & WIN_OVERRIDE_GEOM) {
win->windowstate = GHOST_kWindowStateNormal;
wm_init_state.override_flag &= ~WIN_OVERRIDE_GEOM;
}
else {
win->windowstate = GHOST_WINDOW_STATE_DEFAULT;
}
}
if (wm_init_state.override_flag & WIN_OVERRIDE_WINSTATE) {