diff options
Diffstat (limited to 'source/blender/windowmanager/intern/wm_window.c')
-rw-r--r-- | source/blender/windowmanager/intern/wm_window.c | 39 |
1 files changed, 23 insertions, 16 deletions
diff --git a/source/blender/windowmanager/intern/wm_window.c b/source/blender/windowmanager/intern/wm_window.c index db427ea68d1..5cf2f8932f5 100644 --- a/source/blender/windowmanager/intern/wm_window.c +++ b/source/blender/windowmanager/intern/wm_window.c @@ -1,4 +1,4 @@ -/** +/* * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** @@ -26,6 +26,11 @@ * ***** END GPL LICENSE BLOCK ***** */ +/** \file blender/windowmanager/intern/wm_window.c + * \ingroup wm + */ + + #include <math.h> #include <stdlib.h> #include <stdio.h> @@ -69,7 +74,7 @@ #include "GPU_extensions.h" /* the global to talk to ghost */ -GHOST_SystemHandle g_system= NULL; +static GHOST_SystemHandle g_system= NULL; /* set by commandline */ static int prefsizx= 0, prefsizy= 0, prefstax= 0, prefstay= 0, initialstate= GHOST_kWindowStateNormal; @@ -233,6 +238,8 @@ wmWindow *wm_window_copy(bContext *C, wmWindow *winorig) /* this is event from ghost, or exit-blender op */ void wm_window_close(bContext *C, wmWindowManager *wm, wmWindow *win) { + bScreen *screen= win->screen; + BLI_remlink(&wm->windows, win); wm_draw_window_clear(win); @@ -241,14 +248,14 @@ void wm_window_close(bContext *C, wmWindowManager *wm, wmWindow *win) WM_event_remove_handlers(C, &win->modalhandlers); ED_screen_exit(C, win, win->screen); - /* if temp screen, delete it */ - if(win->screen->temp) { + wm_window_free(C, wm, win); + + /* if temp screen, delete it after window free (it stops jobs that can access it) */ + if(screen->temp) { Main *bmain= CTX_data_main(C); - free_libblock(&bmain->screen, win->screen); + free_libblock(&bmain->screen, screen); } - wm_window_free(C, wm, win); - /* check remaining windows */ if(wm->windows.first) { for(win= wm->windows.first; win; win= win->next) @@ -273,12 +280,7 @@ void wm_window_title(wmWindowManager *wm, wmWindow *win) /* this is set to 1 if you don't have startup.blend open */ if(G.save_over && G.main->name[0]) { char str[sizeof(G.main->name) + 12]; - - if(wm->file_saved) - sprintf(str, "Blender [%s]", G.main->name); - else - sprintf(str, "Blender* [%s]", G.main->name); - + BLI_snprintf(str, sizeof(str), "Blender%s [%s]", wm->file_saved ? "":"*", G.main->name); GHOST_SetTitle(win->ghostwin, str); } else @@ -528,7 +530,12 @@ int wm_window_duplicate_exec(bContext *C, wmOperator *UNUSED(op)) int wm_window_fullscreen_toggle_exec(bContext *C, wmOperator *UNUSED(op)) { wmWindow *window= CTX_wm_window(C); - GHOST_TWindowState state = GHOST_GetWindowState(window->ghostwin); + GHOST_TWindowState state; + + if(G.background) + return OPERATOR_CANCELLED; + + state= GHOST_GetWindowState(window->ghostwin); if(state!=GHOST_kWindowStateFullScreen) GHOST_SetWindowState(window->ghostwin, GHOST_kWindowStateFullScreen); else @@ -1160,12 +1167,12 @@ void WM_setprefsize(int stax, int stay, int sizx, int sizy) } /* for borderless and border windows set from command-line */ -void WM_setinitialstate_fullscreen() +void WM_setinitialstate_fullscreen(void) { initialstate= GHOST_kWindowStateFullScreen; } -void WM_setinitialstate_normal() +void WM_setinitialstate_normal(void) { initialstate= GHOST_kWindowStateNormal; } |