diff options
author | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2018-06-12 17:57:01 +0300 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2018-06-12 18:07:18 +0300 |
commit | 376bc88dc027a8dfc5bd2f92253b17738b825c39 (patch) | |
tree | 8b6fe0d4f7be2afcebfe8f7612facc547e44dfbf | |
parent | 3801736b891ea0a1ca3c9a8927a44d38527fcefc (diff) |
Fix leak of manipulator tooltip timers.
This was causing performance degradation over time in posing, as the
manipulator recomputes the center locations for every event.
Ref T55442.
4 files changed, 9 insertions, 4 deletions
diff --git a/source/blender/windowmanager/intern/wm_event_system.c b/source/blender/windowmanager/intern/wm_event_system.c index a6b76796c7f..00f5f6c1368 100644 --- a/source/blender/windowmanager/intern/wm_event_system.c +++ b/source/blender/windowmanager/intern/wm_event_system.c @@ -2386,8 +2386,7 @@ static int wm_handlers_do_intern(bContext *C, wmEvent *event, ListBase *handlers if (event->type == MOUSEMOVE && !wm_manipulatormap_modal_get(mmap)) { int part; mpr = wm_manipulatormap_highlight_find(mmap, C, event, &part); - wm_manipulatormap_highlight_set(mmap, C, mpr, part); - if (mpr != NULL) { + if (wm_manipulatormap_highlight_set(mmap, C, mpr, part) && mpr != NULL) { WM_tooltip_timer_init(C, CTX_wm_window(C), region, WM_manipulatormap_tooltip_init); } } diff --git a/source/blender/windowmanager/intern/wm_tooltip.c b/source/blender/windowmanager/intern/wm_tooltip.c index 6096317b582..94a44a97afd 100644 --- a/source/blender/windowmanager/intern/wm_tooltip.c +++ b/source/blender/windowmanager/intern/wm_tooltip.c @@ -41,6 +41,8 @@ void WM_tooltip_timer_init( bContext *C, wmWindow *win, ARegion *ar, wmTooltipInitFn init) { + WM_tooltip_timer_clear(C, win); + bScreen *screen = WM_window_get_active_screen(win); wmWindowManager *wm = CTX_wm_manager(C); if (screen->tool_tip == NULL) { diff --git a/source/blender/windowmanager/manipulators/intern/wm_manipulator_map.c b/source/blender/windowmanager/manipulators/intern/wm_manipulator_map.c index ab8c797df69..0b4b1f5e9e1 100644 --- a/source/blender/windowmanager/manipulators/intern/wm_manipulator_map.c +++ b/source/blender/windowmanager/manipulators/intern/wm_manipulator_map.c @@ -846,7 +846,7 @@ bool WM_manipulatormap_cursor_set(const wmManipulatorMap *mmap, wmWindow *win) return false; } -void wm_manipulatormap_highlight_set( +bool wm_manipulatormap_highlight_set( wmManipulatorMap *mmap, const bContext *C, wmManipulator *mpr, int part) { if ((mpr != mmap->mmap_context.highlight) || @@ -881,7 +881,11 @@ void wm_manipulatormap_highlight_set( ARegion *ar = CTX_wm_region(C); ED_region_tag_redraw(ar); } + + return true; } + + return false; } wmManipulator *wm_manipulatormap_highlight_get(wmManipulatorMap *mmap) diff --git a/source/blender/windowmanager/manipulators/wm_manipulator_wmapi.h b/source/blender/windowmanager/manipulators/wm_manipulator_wmapi.h index 87cf711a60b..7b294b9320f 100644 --- a/source/blender/windowmanager/manipulators/wm_manipulator_wmapi.h +++ b/source/blender/windowmanager/manipulators/wm_manipulator_wmapi.h @@ -77,7 +77,7 @@ void wm_manipulatormap_handler_context(bContext *C, struct wmEventHandler *handl struct wmManipulator *wm_manipulatormap_highlight_find( struct wmManipulatorMap *mmap, bContext *C, const struct wmEvent *event, int *r_part); -void wm_manipulatormap_highlight_set( +bool wm_manipulatormap_highlight_set( struct wmManipulatorMap *mmap, const bContext *C, struct wmManipulator *mpr, int part); struct wmManipulator *wm_manipulatormap_highlight_get(struct wmManipulatorMap *mmap); |