From eff3728db912abc1477d0e90d2a6533b61f7295f Mon Sep 17 00:00:00 2001 From: Dalai Felinto Date: Fri, 15 Feb 2019 19:13:17 -0200 Subject: Fix T61512: Crash switching workspace with fullscreen area In this case we simply create a new screen area that copies the currently fullscreened area. Note: At the moment there is no indicative in the non-main window that we are in fullscreen. That happens because this information is part of the bar and we have no topbar in this window. --- source/blender/editors/screen/workspace_layout_edit.c | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) (limited to 'source') diff --git a/source/blender/editors/screen/workspace_layout_edit.c b/source/blender/editors/screen/workspace_layout_edit.c index 808b48a58dd..cf2b168f510 100644 --- a/source/blender/editors/screen/workspace_layout_edit.c +++ b/source/blender/editors/screen/workspace_layout_edit.c @@ -64,13 +64,22 @@ WorkSpaceLayout *ED_workspace_layout_duplicate( bScreen *screen_new; WorkSpaceLayout *layout_new; - if (BKE_screen_is_fullscreen_area(screen_old)) { - return NULL; /* XXX handle this case! */ - } - layout_new = ED_workspace_layout_add(bmain, workspace, win, name); screen_new = BKE_workspace_layout_screen_get(layout_new); - screen_data_copy(screen_new, screen_old); + + if (BKE_screen_is_fullscreen_area(screen_old)) { + for (ScrArea *area_old = screen_old->areabase.first; area_old; area_old = area_old->next) { + if (area_old->full) { + ScrArea *area_new = (ScrArea *)screen_new->areabase.first; + ED_area_data_copy(area_new, area_old, true); + ED_area_tag_redraw(area_new); + break; + } + } + } + else { + screen_data_copy(screen_new, screen_old); + } return layout_new; } -- cgit v1.2.3