diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2018-09-27 15:51:33 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2018-09-27 15:51:33 +0300 |
commit | 4de1e673a411d14c5ab980d37cc3e1bb8b3d99ea (patch) | |
tree | f4f84a3813247e9b8ba07ade7fbce3e52fd4d48d /source/blender/windowmanager | |
parent | 1472550ba195a3278ee3eb2977515c2c3b62c9ce (diff) | |
parent | 8f9a6b1bab89b9af821b3996514af7de7c8cce7c (diff) |
Merge branch 'master' into blender2.8
Diffstat (limited to 'source/blender/windowmanager')
-rw-r--r-- | source/blender/windowmanager/WM_api.h | 1 | ||||
-rw-r--r-- | source/blender/windowmanager/intern/wm_window.c | 14 |
2 files changed, 13 insertions, 2 deletions
diff --git a/source/blender/windowmanager/WM_api.h b/source/blender/windowmanager/WM_api.h index 65cb0f956a5..7f97831c6b7 100644 --- a/source/blender/windowmanager/WM_api.h +++ b/source/blender/windowmanager/WM_api.h @@ -88,6 +88,7 @@ const char *WM_init_state_app_template_get(void); void WM_init_state_size_set (int stax, int stay, int sizx, int sizy); void WM_init_state_fullscreen_set(void); void WM_init_state_normal_set(void); +void WM_init_window_focus_set(bool do_it); void WM_init_native_pixels(bool do_it); void WM_init (struct bContext *C, int argc, const char **argv); diff --git a/source/blender/windowmanager/intern/wm_window.c b/source/blender/windowmanager/intern/wm_window.c index c460ea88474..4363591299e 100644 --- a/source/blender/windowmanager/intern/wm_window.c +++ b/source/blender/windowmanager/intern/wm_window.c @@ -117,8 +117,9 @@ static struct WMInitStruct { int windowstate; WinOverrideFlag override_flag; + bool window_focus; bool native_pixels; -} wm_init_state = {0, 0, 0, 0, GHOST_kWindowStateNormal, 0, true}; +} wm_init_state = {0, 0, 0, 0, GHOST_kWindowStateNormal, 0, true, true}; /* ******** win open & close ************ */ @@ -671,7 +672,9 @@ static void wm_window_ghostwindow_add(wmWindowManager *wm, const char *title, wm #ifndef __APPLE__ /* set the state here, so minimized state comes up correct on windows */ - GHOST_SetWindowState(ghostwin, (GHOST_TWindowState)win->windowstate); + if (wm_init_state.window_focus) { + GHOST_SetWindowState(ghostwin, (GHOST_TWindowState)win->windowstate); + } #endif /* until screens get drawn, make it nice gray */ glClearColor(0.55, 0.55, 0.55, 0.0); @@ -1682,6 +1685,8 @@ void wm_ghost_init(bContext *C) if (wm_init_state.native_pixels) { GHOST_UseNativePixels(); } + + GHOST_UseWindowFocus(wm_init_state.window_focus); } } @@ -1961,6 +1966,11 @@ void WM_init_state_normal_set(void) wm_init_state.override_flag |= WIN_OVERRIDE_WINSTATE; } +void WM_init_window_focus_set(bool do_it) +{ + wm_init_state.window_focus = do_it; +} + void WM_init_native_pixels(bool do_it) { wm_init_state.native_pixels = do_it; |