diff options
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/editors/include/ED_screen.h | 2 | ||||
-rw-r--r-- | source/blender/editors/render/render_view.c | 4 | ||||
-rw-r--r-- | source/blender/editors/screen/screen_edit.c | 12 | ||||
-rw-r--r-- | source/blender/editors/screen/screen_ops.c | 2 | ||||
-rw-r--r-- | source/blender/windowmanager/intern/wm_event_system.c | 6 |
5 files changed, 18 insertions, 8 deletions
diff --git a/source/blender/editors/include/ED_screen.h b/source/blender/editors/include/ED_screen.h index 7f6679b827b..441a9bdb1c1 100644 --- a/source/blender/editors/include/ED_screen.h +++ b/source/blender/editors/include/ED_screen.h @@ -109,7 +109,7 @@ void ED_screen_animation_timer(struct bContext *C, int redraws, int refresh, void ED_screen_animation_timer_update(struct bScreen *screen, int redraws, int refresh); void ED_screen_restore_temp_type(struct bContext *C, ScrArea *sa); ScrArea *ED_screen_full_newspace(struct bContext *C, ScrArea *sa, int type); -void ED_screen_full_prevspace(struct bContext *C, ScrArea *sa); +void ED_screen_full_prevspace(struct bContext *C, ScrArea *sa, const bool was_prev_temp); void ED_screen_full_restore(struct bContext *C, ScrArea *sa); struct ScrArea *ED_screen_state_toggle(struct bContext *C, struct wmWindow *win, struct ScrArea *sa, const short state); void ED_screens_header_tools_menu_create(struct bContext *C, struct uiLayout *layout, void *arg); diff --git a/source/blender/editors/render/render_view.c b/source/blender/editors/render/render_view.c index f5260b8a568..fc1338c5795 100644 --- a/source/blender/editors/render/render_view.c +++ b/source/blender/editors/render/render_view.c @@ -261,7 +261,7 @@ static int render_view_cancel_exec(bContext *C, wmOperator *UNUSED(op)) if (sima->flag & SI_FULLWINDOW) { sima->flag &= ~SI_FULLWINDOW; - ED_screen_full_prevspace(C, sa); + ED_screen_full_prevspace(C, sa, false); } else { ED_area_prevspace(C, sa); @@ -326,7 +326,7 @@ static int render_view_show_invoke(bContext *C, wmOperator *UNUSED(op), const wm if (sima->flag & SI_FULLWINDOW) { sima->flag &= ~SI_FULLWINDOW; - ED_screen_full_prevspace(C, sa); + ED_screen_full_prevspace(C, sa, false); } else if (sima->next) { /* workaround for case of double prevspace, render window diff --git a/source/blender/editors/screen/screen_edit.c b/source/blender/editors/screen/screen_edit.c index d9bd9cc4f51..0c40c833c0d 100644 --- a/source/blender/editors/screen/screen_edit.c +++ b/source/blender/editors/screen/screen_edit.c @@ -1763,12 +1763,18 @@ ScrArea *ED_screen_full_newspace(bContext *C, ScrArea *sa, int type) return newsa; } -void ED_screen_full_prevspace(bContext *C, ScrArea *sa) +/** + * \a was_prev_temp for the case previous space was a temporary fullscreen as well + */ +void ED_screen_full_prevspace(bContext *C, ScrArea *sa, const bool was_prev_temp) { if (sa->flag & AREA_FLAG_STACKED_FULLSCREEN) { /* stacked fullscreen -> only go back to previous screen and don't toggle out of fullscreen */ ED_area_prevspace(C, sa); - sa->flag &= ~AREA_FLAG_TEMP_TYPE; + /* only clear if previous space wasn't a temp fullscreen as well */ + if (!was_prev_temp) { + sa->flag &= ~AREA_FLAG_TEMP_TYPE; + } } else { ED_screen_restore_temp_type(C, sa); @@ -1803,7 +1809,7 @@ void ED_screen_full_restore(bContext *C, ScrArea *sa) if (sl->next) { if (sa->flag & AREA_FLAG_TEMP_TYPE) { - ED_screen_full_prevspace(C, sa); + ED_screen_full_prevspace(C, sa, false); } else { ED_screen_state_toggle(C, win, sa, state); diff --git a/source/blender/editors/screen/screen_ops.c b/source/blender/editors/screen/screen_ops.c index 9745d01fc89..52eb14aab8d 100644 --- a/source/blender/editors/screen/screen_ops.c +++ b/source/blender/editors/screen/screen_ops.c @@ -3800,7 +3800,7 @@ static int fullscreen_back_exec(bContext *C, wmOperator *op) return OPERATOR_CANCELLED; } - ED_screen_full_prevspace(C, sa); + ED_screen_full_prevspace(C, sa, false); return OPERATOR_FINISHED; } diff --git a/source/blender/windowmanager/intern/wm_event_system.c b/source/blender/windowmanager/intern/wm_event_system.c index 5177e85e827..889a36b6953 100644 --- a/source/blender/windowmanager/intern/wm_event_system.c +++ b/source/blender/windowmanager/intern/wm_event_system.c @@ -1793,7 +1793,11 @@ static int wm_handler_fileselect_do(bContext *C, ListBase *handlers, wmEventHand BLI_remlink(handlers, handler); if (val != EVT_FILESELECT_EXTERNAL_CANCEL) { - ED_screen_full_prevspace(C, CTX_wm_area(C)); + ScrArea *sa = CTX_wm_area(C); + const SpaceLink *sl = sa->spacedata.first; + const bool was_prev_temp = (sl->next && sl->next->spacetype == SPACE_IMAGE); + + ED_screen_full_prevspace(C, sa, was_prev_temp); } wm_handler_op_context(C, handler, CTX_wm_window(C)->eventstate); |