Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/source
diff options
context:
space:
mode:
authorDalai Felinto <dfelinto@gmail.com>2019-02-16 00:13:17 +0300
committerDalai Felinto <dfelinto@gmail.com>2019-02-16 00:13:20 +0300
commiteff3728db912abc1477d0e90d2a6533b61f7295f (patch)
treeecb73ff785068166957133494c1cc3e67156b614 /source
parent2b7752fb00737d29200d6c0aeb6a782b1a969c65 (diff)
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.
Diffstat (limited to 'source')
-rw-r--r--source/blender/editors/screen/workspace_layout_edit.c19
1 files changed, 14 insertions, 5 deletions
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;
}