diff options
Diffstat (limited to 'source/blender/windowmanager/intern')
-rw-r--r-- | source/blender/windowmanager/intern/wm_event_system.c | 2 | ||||
-rw-r--r-- | source/blender/windowmanager/intern/wm_tooltip.c | 19 |
2 files changed, 18 insertions, 3 deletions
diff --git a/source/blender/windowmanager/intern/wm_event_system.c b/source/blender/windowmanager/intern/wm_event_system.c index f074c083b31..cd1357e85b1 100644 --- a/source/blender/windowmanager/intern/wm_event_system.c +++ b/source/blender/windowmanager/intern/wm_event_system.c @@ -2422,7 +2422,7 @@ static int wm_handlers_do_intern(bContext *C, wmEvent *event, ListBase *handlers int part; gz = wm_gizmomap_highlight_find(gzmap, C, event, &part); if (wm_gizmomap_highlight_set(gzmap, C, gz, part) && gz != NULL) { - WM_tooltip_timer_init(C, CTX_wm_window(C), region, WM_gizmomap_tooltip_init, false); + WM_tooltip_timer_init(C, CTX_wm_window(C), region, WM_gizmomap_tooltip_init); } } else { diff --git a/source/blender/windowmanager/intern/wm_tooltip.c b/source/blender/windowmanager/intern/wm_tooltip.c index 0953351de2b..58c657bf116 100644 --- a/source/blender/windowmanager/intern/wm_tooltip.c +++ b/source/blender/windowmanager/intern/wm_tooltip.c @@ -37,9 +37,24 @@ #include "WM_api.h" #include "WM_types.h" +void WM_tooltip_immediate_init( + bContext *C, wmWindow *win, ARegion *ar, + wmTooltipInitFn init) +{ + WM_tooltip_timer_clear(C, win); + + bScreen *screen = WM_window_get_active_screen(win); + if (screen->tool_tip == NULL) { + screen->tool_tip = MEM_callocN(sizeof(*screen->tool_tip), __func__); + } + screen->tool_tip->region_from = ar; + screen->tool_tip->init = init; + WM_tooltip_init(C, win); +} + void WM_tooltip_timer_init( bContext *C, wmWindow *win, ARegion *ar, - wmTooltipInitFn init, bool quick) + wmTooltipInitFn init) { WM_tooltip_timer_clear(C, win); @@ -50,7 +65,7 @@ void WM_tooltip_timer_init( } screen->tool_tip->region_from = ar; screen->tool_tip->timer = WM_event_add_timer( - wm, win, TIMER, quick ? UI_TOOLTIP_DELAY_QUICK : UI_TOOLTIP_DELAY); + wm, win, TIMER, UI_TOOLTIP_DELAY); screen->tool_tip->init = init; } |