WM: avoid re-initializing tools while resizing areas

Every update caused the gizmo to be recreated.
This commit is contained in:
Campbell Barton 2018-11-28 13:50:15 +11:00
parent dcf0860dab
commit ba8c21989c
3 changed files with 11 additions and 3 deletions

View File

@ -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;

View File

@ -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;
}
}
}

View File

@ -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);