void wm_window_title(wmWindowManager *wm, wmWindow *win) { /* handle the 'temp' window, only set title when not set before */ if (win->screen && win->screen->temp) { char *title = GHOST_GetTitle(win->ghostwin); if (title == NULL || title[0] == 0) GHOST_SetTitle(win->ghostwin, "Blender"); } else { /* 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]; BLI_snprintf(str, sizeof(str), "Blender%s [%s]", wm->file_saved ? "" : "*", G.main->name); GHOST_SetTitle(win->ghostwin, str); } else GHOST_SetTitle(win->ghostwin, "Blender"); /* Informs GHOST of unsaved changes, to set window modified visual indicator (MAC OS X) * and to give hint of unsaved changes for a user warning mechanism * in case of OS application terminate request (e.g. OS Shortcut Alt+F4, Cmd+Q, (...), or session end) */ GHOST_SetWindowModifiedState(win->ghostwin, (GHOST_TUns8) !wm->file_saved); #if defined(__APPLE__) && !defined(GHOST_COCOA) if (wm->file_saved) GHOST_SetWindowState(win->ghostwin, GHOST_kWindowStateUnModified); else GHOST_SetWindowState(win->ghostwin, GHOST_kWindowStateModified); #endif } }
void wm_window_title(wmWindowManager *wm, wmWindow *win) { if (win->screen && win->screen->temp) { /* nothing to do for 'temp' windows, * because WM_window_open_temp always sets window title */ } else { /* 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) + 24]; BLI_snprintf(str, sizeof(str), "Blender%s [%s%s]", wm->file_saved ? "" : "*", G.main->name, G.main->recovered ? " (Recovered)" : ""); GHOST_SetTitle(win->ghostwin, str); } else GHOST_SetTitle(win->ghostwin, "Blender"); /* Informs GHOST of unsaved changes, to set window modified visual indicator (MAC OS X) * and to give hint of unsaved changes for a user warning mechanism * in case of OS application terminate request (e.g. OS Shortcut Alt+F4, Cmd+Q, (...), or session end) */ GHOST_SetWindowModifiedState(win->ghostwin, (GHOST_TUns8) !wm->file_saved); } }