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:
authorCampbell Barton <ideasman42@gmail.com>2021-06-29 13:50:53 +0300
committerJeroen Bakker <jeroen@blender.org>2021-06-30 10:12:57 +0300
commitcf9cacd091e8cbabf9bfc91b0949bfea785968d4 (patch)
tree9e205ca1173f88090d29225d51c3822fd3d988c5 /source
parent03d5c8b4edf4ca57a731f52795a6331801b8f8ba (diff)
Fix T89526: "Toggle Maximize Area" clears context screen properties
Removed in b787581c9cda5a0cd4bc8b03bbdd1f9832438db4 as it's comment noted it was bad code, the reason for it's necessity was no longer valid. Add this back with comment explaining why it's still needed.
Diffstat (limited to 'source')
-rw-r--r--source/blender/editors/screen/screen_edit.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/source/blender/editors/screen/screen_edit.c b/source/blender/editors/screen/screen_edit.c
index 7ad8eada3b9..c7760aa34b3 100644
--- a/source/blender/editors/screen/screen_edit.c
+++ b/source/blender/editors/screen/screen_edit.c
@@ -1416,6 +1416,14 @@ ScrArea *ED_screen_state_toggle(bContext *C, wmWindow *win, ScrArea *area, const
BLI_assert(CTX_wm_screen(C) == screen);
BLI_assert(CTX_wm_area(C) == NULL); /* May have been freed. */
+ /* Setting the area is only needed for Python scripts that call
+ * operators in succession before returning to the main event loop.
+ * Without this, scripts can't run any operators that require
+ * an area after toggling full-screen for example (see: T89526).
+ * NOTE: an old comment stated this was "bad code",
+ * however it doesn't cause problems so leave as-is. */
+ CTX_wm_area_set(C, screen->areabase.first);
+
return screen->areabase.first;
}