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
diff options
context:
space:
mode:
authorJulian Eisel <julian@blender.org>2020-03-06 18:22:28 +0300
committerJulian Eisel <julian@blender.org>2020-03-06 18:27:13 +0300
commitd5572eacc5958db38ac4a4a32eddb3a2cd24bf68 (patch)
tree5252d8f509dae02bf9c137a1710c073d5bbac592 /source/blender/editors/interface/view2d_ops.c
parentb242cc67928a6858a835c088e4d3ea8822c83168 (diff)
Cleanup: Reduce context usage in UI functions
Part of https://developer.blender.org/T74429. There's a chance that this causes some issues becaue in some cases we change from getting the window from context to getting it from somewhere else.
Diffstat (limited to 'source/blender/editors/interface/view2d_ops.c')
-rw-r--r--source/blender/editors/interface/view2d_ops.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/source/blender/editors/interface/view2d_ops.c b/source/blender/editors/interface/view2d_ops.c
index 527c23e4588..10d327cb2ba 100644
--- a/source/blender/editors/interface/view2d_ops.c
+++ b/source/blender/editors/interface/view2d_ops.c
@@ -188,7 +188,7 @@ static void view_pan_apply_ex(bContext *C, v2dViewPanData *vpd, float dx, float
ED_region_tag_redraw_no_rebuild(vpd->ar);
/* request updates to be done... */
- WM_event_add_mousemove(C);
+ WM_event_add_mousemove(CTX_wm_window(C));
UI_view2d_sync(vpd->sc, vpd->sa, v2d, V2D_LOCK_COPY);
}
@@ -1592,6 +1592,7 @@ void UI_view2d_smooth_view(bContext *C, ARegion *ar, const rctf *cur, const int
/* only meant for timer usage */
static int view2d_smoothview_invoke(bContext *C, wmOperator *UNUSED(op), const wmEvent *event)
{
+ wmWindow *win = CTX_wm_window(C);
ARegion *ar = CTX_wm_region(C);
View2D *v2d = &ar->v2d;
struct SmoothView2DStore *sms = v2d->sms;
@@ -1616,11 +1617,11 @@ static int view2d_smoothview_invoke(bContext *C, wmOperator *UNUSED(op), const w
MEM_freeN(v2d->sms);
v2d->sms = NULL;
- WM_event_remove_timer(CTX_wm_manager(C), CTX_wm_window(C), v2d->smooth_timer);
+ WM_event_remove_timer(CTX_wm_manager(C), win, v2d->smooth_timer);
v2d->smooth_timer = NULL;
/* Event handling won't know if a UI item has been moved under the pointer. */
- WM_event_add_mousemove(C);
+ WM_event_add_mousemove(win);
}
else {
/* ease in/out */