diff options
author | Julian Eisel <eiseljulian@gmail.com> | 2020-02-04 21:51:35 +0300 |
---|---|---|
committer | Julian Eisel <eiseljulian@gmail.com> | 2020-02-04 21:54:06 +0300 |
commit | f7ca86369da89a6726bc9edc9bf4e875b2b43c46 (patch) | |
tree | 81fd5f2f163214d01f77fd2dc640ab2d9668d42e /source/blender/windowmanager/intern/wm_event_system.c | |
parent | c19112d755f1aa0e2343e07a8f6162a438189a7b (diff) |
Reports: Add utility to cancel displayed reports
Sebastián Barschkis needs something like this to fix an issue, so he
asked me to add this to the release branch. It's unused for now.
Diffstat (limited to 'source/blender/windowmanager/intern/wm_event_system.c')
-rw-r--r-- | source/blender/windowmanager/intern/wm_event_system.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/source/blender/windowmanager/intern/wm_event_system.c b/source/blender/windowmanager/intern/wm_event_system.c index f5970e8fb61..104fbc84306 100644 --- a/source/blender/windowmanager/intern/wm_event_system.c +++ b/source/blender/windowmanager/intern/wm_event_system.c @@ -861,6 +861,16 @@ void WM_report_banner_show(void) wm_reports->reporttimer->customdata = rti; } +/** + * Hide all currently displayed banners and abort their timer. + */ +void WM_report_banners_cancel(Main *bmain) +{ + wmWindowManager *wm = bmain->wm.first; + BKE_reports_clear(&wm->reports); + WM_event_remove_timer(wm, NULL, wm->reports.reporttimer); +} + bool WM_event_is_last_mousemove(const wmEvent *event) { while ((event = event->next)) { |