UI: Enable writing global area data (top-bar, status-bar) to .blend's

There should not be much user visible here (other than T73668 being addressed).

I added the writing code already for the initial implementation of workspaces,
but we decided to keep it disabled until the top-bar design is more clear. It
was never planned to keep this disabled for so long.

Fixes T73668.
This commit is contained in:
Julian Eisel 2020-11-02 18:32:12 +01:00
parent cf7343a355
commit ef4aa42ea4
Notes: blender-bot 2023-02-14 11:07:28 +01:00
Referenced by commit 5c72a4d452, Fix T84780: Corrupt screen layout when loading file with area full-screen
Referenced by issue #82387, File saved in 2.92 alpha cannnot be opened in previous versions
Referenced by issue #73668, "Show menu" isn't respected on save as default
4 changed files with 0 additions and 30 deletions

View File

@ -1368,14 +1368,12 @@ static void write_area_regions(BlendWriter *writer, ScrArea *area)
}
BLO_write_struct(writer, SpaceConsole, sl);
}
#ifdef WITH_GLOBAL_AREA_WRITING
else if (sl->spacetype == SPACE_TOPBAR) {
BLO_write_struct(writer, SpaceTopBar, sl);
}
else if (sl->spacetype == SPACE_STATUSBAR) {
BLO_write_struct(writer, SpaceStatusBar, sl);
}
#endif
else if (sl->spacetype == SPACE_USERPREF) {
BLO_write_struct(writer, SpaceUserPref, sl);
}
@ -1397,9 +1395,7 @@ void BKE_screen_area_map_blend_write(BlendWriter *writer, ScrAreaMap *area_map)
BLO_write_struct(writer, ScrArea, area);
#ifdef WITH_GLOBAL_AREA_WRITING
BLO_write_struct(writer, ScrGlobalAreaData, area->global);
#endif
write_area_regions(writer, area);

View File

@ -1639,12 +1639,6 @@ static void write_windowmanager(BlendWriter *writer, wmWindowManager *wm, const
write_wm_xr_data(writer, &wm->xr);
LISTBASE_FOREACH (wmWindow *, win, &wm->windows) {
#ifndef WITH_GLOBAL_AREA_WRITING
/* Don't write global areas yet, while we make changes to them. */
ScrAreaMap global_areas = win->global_areas;
memset(&win->global_areas, 0, sizeof(win->global_areas));
#endif
/* update deprecated screen member (for so loading in 2.7x uses the correct screen) */
win->screen = BKE_workspace_active_screen_get(win->workspace_hook);
@ -1652,11 +1646,7 @@ static void write_windowmanager(BlendWriter *writer, wmWindowManager *wm, const
BLO_write_struct(writer, WorkSpaceInstanceHook, win->workspace_hook);
BLO_write_struct(writer, Stereo3dFormat, win->stereo3d_format);
#ifdef WITH_GLOBAL_AREA_WRITING
BKE_screen_area_map_blend_write(writer, &win->global_areas);
#else
win->global_areas = global_areas;
#endif
/* data is written, clear deprecated data again */
win->screen = NULL;

View File

@ -322,10 +322,6 @@ typedef struct uiPreview {
char _pad1[6];
} uiPreview;
/* These two lines with # tell makesdna this struct can be excluded.
* Should be: #ifndef WITH_GLOBAL_AREA_WRITING */
#
#
typedef struct ScrGlobalAreaData {
/* Global areas have a non-dynamic size. That means, changing the window
* size doesn't affect their size at all. However, they can still be

View File

@ -59,10 +59,6 @@ struct wmTimer;
/* Defined in `buttons_intern.h`. */
typedef struct SpaceProperties_Runtime SpaceProperties_Runtime;
/* TODO 2.8: We don't write the global areas to files currently. Uncomment
* define to enable writing (should become the default in a bit). */
//#define WITH_GLOBAL_AREA_WRITING
/* -------------------------------------------------------------------- */
/** \name SpaceLink (Base)
* \{ */
@ -1672,10 +1668,6 @@ typedef enum eSpaceClip_GPencil_Source {
/** \name Top Bar
* \{ */
/* These two lines with # tell makesdna this struct can be excluded.
* Should be: #ifndef WITH_GLOBAL_AREA_WRITING */
#
#
typedef struct SpaceTopBar {
SpaceLink *next, *prev;
/** Storage of regions for inactive spaces. */
@ -1692,10 +1684,6 @@ typedef struct SpaceTopBar {
/** \name Status Bar
* \{ */
/* These two lines with # tell makesdna this struct can be excluded.
* Should be: #ifndef WITH_GLOBAL_AREA_WRITING */
#
#
typedef struct SpaceStatusBar {
SpaceLink *next, *prev;
/** Storage of regions for inactive spaces. */