[Bf-blender-cvs] [ba8c21989c9] blender2.8: WM: avoid re-initializing tools while resizing areas

Campbell Barton noreply at git.blender.org
Wed Nov 28 03:59:27 CET 2018


Commit: ba8c21989c9b75bc8ec3bcacc381b2787fb07704
Author: Campbell Barton
Date:   Wed Nov 28 13:50:15 2018 +1100
Branches: blender2.8
https://developer.blender.org/rBba8c21989c9b75bc8ec3bcacc381b2787fb07704

WM: avoid re-initializing tools while resizing areas

Every update caused the gizmo to be recreated.

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

M	source/blender/blenkernel/BKE_global.h
M	source/blender/editors/screen/area.c
M	source/blender/editors/screen/screen_ops.c

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

diff --git a/source/blender/blenkernel/BKE_global.h b/source/blender/blenkernel/BKE_global.h
index 410c8bb3a65..9a6560238ea 100644
--- a/source/blender/blenkernel/BKE_global.h
+++ b/source/blender/blenkernel/BKE_global.h
@@ -206,6 +206,7 @@ enum {
 #define G_TRANSFORM_EDIT        2
 #define G_TRANSFORM_SEQ         4
 #define G_TRANSFORM_FCURVES     8
+#define G_TRANSFORM_WM          16
 
 /* Memory is allocated where? blender.c */
 extern Global G;
diff --git a/source/blender/editors/screen/area.c b/source/blender/editors/screen/area.c
index 3a6cac5d958..0f024b02c43 100644
--- a/source/blender/editors/screen/area.c
+++ b/source/blender/editors/screen/area.c
@@ -1640,9 +1640,12 @@ void ED_area_initialize(wmWindowManager *wm, wmWindow *win, ScrArea *sa)
 	}
 
 
-	if ((1 << sa->spacetype) & WM_TOOLSYSTEM_SPACE_MASK) {
-		WM_toolsystem_refresh_screen_area(workspace, view_layer, sa);
-		sa->flag |= AREA_FLAG_ACTIVE_TOOL_UPDATE;
+	/* Avoid re-initializing tools while resizing the window. */
+	if ((G.moving & G_TRANSFORM_WM) == 0) {
+		if ((1 << sa->spacetype) & WM_TOOLSYSTEM_SPACE_MASK) {
+			WM_toolsystem_refresh_screen_area(workspace, view_layer, sa);
+			sa->flag |= AREA_FLAG_ACTIVE_TOOL_UPDATE;
+		}
 	}
 }
 
diff --git a/source/blender/editors/screen/screen_ops.c b/source/blender/editors/screen/screen_ops.c
index 2305ce8f5fe..812455333e9 100644
--- a/source/blender/editors/screen/screen_ops.c
+++ b/source/blender/editors/screen/screen_ops.c
@@ -1541,6 +1541,8 @@ static void area_move_exit(bContext *C, wmOperator *op)
 	/* this makes sure aligned edges will result in aligned grabbing */
 	BKE_screen_remove_double_scrverts(CTX_wm_screen(C));
 	BKE_screen_remove_double_scredges(CTX_wm_screen(C));
+
+	G.moving &= ~G_TRANSFORM_WM;
 }
 
 static int area_move_exec(bContext *C, wmOperator *op)
@@ -1563,6 +1565,8 @@ static int area_move_invoke(bContext *C, wmOperator *op, const wmEvent *event)
 	if (!area_move_init(C, op))
 		return OPERATOR_PASS_THROUGH;
 
+	G.moving |= G_TRANSFORM_WM;
+
 	/* add temp handler */
 	WM_event_add_modal_handler(C, op);



More information about the Bf-blender-cvs mailing list