Commit: 1764f5b24d2457fd897cc1df43afaa5ece63ee4a
Author: Nathan Craddock
Date:   Wed Jun 17 13:46:00 2020 -0600
Branches: soc-2020-outliner
https://developer.blender.org/rB1764f5b24d2457fd897cc1df43afaa5ece63ee4a

Only switch tabs for visible properties editors

Instead of iterating over each Space in the area, only update the first
in the list which is the currently visible one. This prevents updating
the properties editor when it is not currently visible.

===================================================================

M       source/blender/editors/space_buttons/buttons_context.c

===================================================================

diff --git a/source/blender/editors/space_buttons/buttons_context.c 
b/source/blender/editors/space_buttons/buttons_context.c
index 84f101d60d0..3d35c83f908 100644
--- a/source/blender/editors/space_buttons/buttons_context.c
+++ b/source/blender/editors/space_buttons/buttons_context.c
@@ -106,12 +106,13 @@ void ED_buttons_set_context(const bContext *C, const 
short context)
 {
   bScreen *screen = CTX_wm_screen(C);
   LISTBASE_FOREACH (ScrArea *, area, &screen->areabase) {
-    LISTBASE_FOREACH (SpaceLink *, sl, &area->spacedata) {
-      if (sl->spacetype == SPACE_PROPERTIES) {
-        SpaceProperties *sbuts = (SpaceProperties *)sl;
-        sbuts->mainbuser = context;
-        sbuts->mainb = sbuts->mainbuser;
-      }
+    /* Only update for properties editors that are visible */
+    SpaceLink *sl = area->spacedata.first;
+
+    if (sl->spacetype == SPACE_PROPERTIES) {
+      SpaceProperties *sbuts = (SpaceProperties *)sl;
+      sbuts->mainbuser = context;
+      sbuts->mainb = sbuts->mainbuser;
     }
   }
 }

_______________________________________________
Bf-blender-cvs mailing list
[email protected]
https://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to