[Bf-blender-cvs] [7ccf0c694f1] topbar: Don't open old info editor topbar when going fullscreen
Julian Eisel
noreply at git.blender.org
Sat Jul 29 19:46:49 CEST 2017
Commit: 7ccf0c694f1106b5df84c8605362ead69b099a82
Author: Julian Eisel
Date: Sat Jul 29 19:45:44 2017 +0200
Branches: topbar
https://developer.blender.org/rB7ccf0c694f1106b5df84c8605362ead69b099a82
Don't open old info editor topbar when going fullscreen
===================================================================
M source/blender/blenloader/intern/versioning_280.c
M source/blender/editors/screen/screen_edit.c
M source/blender/makesdna/DNA_screen_types.h
===================================================================
diff --git a/source/blender/blenloader/intern/versioning_280.c b/source/blender/blenloader/intern/versioning_280.c
index 324183cf5f0..806efcd66ba 100644
--- a/source/blender/blenloader/intern/versioning_280.c
+++ b/source/blender/blenloader/intern/versioning_280.c
@@ -376,6 +376,8 @@ void do_versions_after_linking_280(Main *main)
MEM_freeN(area);
}
+ /* AREA_TEMP_INFO is deprecated from now on, it should only be set for info areas
+ * which are deleted above, so don't need to unset it. Its slot/bit can be reused */
}
}
}
diff --git a/source/blender/editors/screen/screen_edit.c b/source/blender/editors/screen/screen_edit.c
index 0ec2e9c1d1a..798bf72964b 100644
--- a/source/blender/editors/screen/screen_edit.c
+++ b/source/blender/editors/screen/screen_edit.c
@@ -1270,7 +1270,6 @@ void ED_screen_update_after_scene_change(const bScreen *screen, Scene *scene_new
ScrArea *ED_screen_full_newspace(bContext *C, ScrArea *sa, int type)
{
wmWindow *win = CTX_wm_window(C);
- bScreen *screen = CTX_wm_screen(C);
ScrArea *newsa = NULL;
if (!sa || sa->full == NULL) {
@@ -1278,18 +1277,7 @@ ScrArea *ED_screen_full_newspace(bContext *C, ScrArea *sa, int type)
}
if (!newsa) {
- if (sa->full && (screen->state == SCREENMAXIMIZED)) {
- /* if this has been called from the temporary info header generated in
- * temp fullscreen layouts, find the correct fullscreen area to change
- * to create a new space inside */
- for (newsa = screen->areabase.first; newsa; newsa = newsa->next) {
- if (!(sa->flag & AREA_TEMP_INFO))
- break;
- }
- }
- else {
- newsa = sa;
- }
+ newsa = sa;
}
BLI_assert(newsa);
@@ -1419,7 +1407,6 @@ ScrArea *ED_screen_state_toggle(bContext *C, wmWindow *win, ScrArea *sa, const s
}
ED_area_data_swap(old, sa);
- if (sa->flag & AREA_TEMP_INFO) sa->flag &= ~AREA_TEMP_INFO;
old->full = NULL;
/* animtimer back */
@@ -1442,6 +1429,8 @@ ScrArea *ED_screen_state_toggle(bContext *C, wmWindow *win, ScrArea *sa, const s
ScrArea *newa;
char newname[MAX_ID_NAME - 2];
+ BLI_assert(ELEM(state, SCREENMAXIMIZED, SCREENFULL));
+
oldscreen = WM_window_get_active_screen(win);
oldscreen->state = state;
@@ -1460,50 +1449,30 @@ ScrArea *ED_screen_state_toggle(bContext *C, wmWindow *win, ScrArea *sa, const s
/* use random area when we have no active one, e.g. when the
* mouse is outside of the window and we open a file browser */
- if (!sa)
+ if (!sa) {
sa = oldscreen->areabase.first;
-
- if (state == SCREENMAXIMIZED) {
- /* returns the top small area */
- newa = area_split(sc, (ScrArea *)sc->areabase.first, 'h', 0.99f, 1);
- ED_area_newspace(C, newa, SPACE_INFO, false);
-
- /* copy area */
- newa = newa->prev;
- ED_area_data_swap(newa, sa);
- sa->flag |= AREA_TEMP_INFO;
-
- sa->full = oldscreen;
- newa->full = oldscreen;
- newa->next->full = oldscreen; // XXX
}
- else if (state == SCREENFULL) {
- newa = (ScrArea *)sc->areabase.first;
- /* copy area */
- ED_area_data_swap(newa, sa);
- newa->flag = sa->flag; /* mostly for AREA_FLAG_WASFULLSCREEN */
+ newa = (ScrArea *)sc->areabase.first;
+
+ /* copy area */
+ ED_area_data_swap(newa, sa);
+ newa->flag = sa->flag; /* mostly for AREA_FLAG_WASFULLSCREEN */
+ if (state == SCREENFULL) {
/* temporarily hide the side panels/header */
for (ar = newa->regionbase.first; ar; ar = ar->next) {
ar->flagfullscreen = ar->flag;
- if (ELEM(ar->regiontype,
- RGN_TYPE_UI,
- RGN_TYPE_HEADER,
- RGN_TYPE_TOOLS))
- {
+ if (ELEM(ar->regiontype, RGN_TYPE_UI, RGN_TYPE_HEADER, RGN_TYPE_TOOLS)){
ar->flag |= RGN_FLAG_HIDDEN;
}
}
-
- sa->full = oldscreen;
- newa->full = oldscreen;
- }
- else {
- BLI_assert(false);
}
+ sa->full = oldscreen;
+ newa->full = oldscreen;
+
ED_screen_change(C, sc);
}
diff --git a/source/blender/makesdna/DNA_screen_types.h b/source/blender/makesdna/DNA_screen_types.h
index be41442c423..a3069479d3f 100644
--- a/source/blender/makesdna/DNA_screen_types.h
+++ b/source/blender/makesdna/DNA_screen_types.h
@@ -295,7 +295,11 @@ enum {
HEADER_NO_PULLDOWN = (1 << 0),
AREA_FLAG_DRAWJOINTO = (1 << 1),
AREA_FLAG_DRAWJOINFROM = (1 << 2),
- AREA_TEMP_INFO = (1 << 3),
+#ifdef DNA_DEPRECATED_ALLOW
+ AREA_TEMP_INFO = (1 << 3), /* versioned to make slot reusable */
+#endif
+ /* update size of regions within the area */
+ AREA_FLAG_REGION_SIZE_UPDATE = (1 << 3),
AREA_FLAG_DRAWSPLIT_H = (1 << 4),
AREA_FLAG_DRAWSPLIT_V = (1 << 5),
/* used to check if we should switch back to prevspace (of a different type) */
@@ -304,8 +308,6 @@ enum {
AREA_FLAG_STACKED_FULLSCREEN = (1 << 7),
/* update action zones (even if the mouse is not intersecting them) */
AREA_FLAG_ACTIONZONES_UPDATE = (1 << 8),
- /* update size of regions within the area */
- AREA_FLAG_REGION_SIZE_UPDATE = (1 << 9),
};
#define EDGEWIDTH 1
More information about the Bf-blender-cvs
mailing list