From 8a73c36643c8e29ab250e367436536a976a1b753 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Tue, 11 Jul 2023 12:21:04 +1000 Subject: [PATCH] Fix #109952: Unknown engine warning only shown when loading from a popup Displaying the warning on file load depended on `wm->winactive` being set, and didn't work when loading a file from the file-open window or when loading files using a command-line argument. Resolve using the first window as a fallback. This happens to resolve #109770, although not freeing timers on exit is likely to be an issue under other circumstances. --- source/blender/windowmanager/intern/wm_event_system.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/source/blender/windowmanager/intern/wm_event_system.cc b/source/blender/windowmanager/intern/wm_event_system.cc index 8024f99b844..a63089e5abc 100644 --- a/source/blender/windowmanager/intern/wm_event_system.cc +++ b/source/blender/windowmanager/intern/wm_event_system.cc @@ -885,13 +885,14 @@ static void wm_event_handler_ui_cancel(bContext *C) void WM_report_banner_show() { wmWindowManager *wm = static_cast(G_MAIN->wm.first); + wmWindow *win = wm->winactive ? wm->winactive : static_cast(wm->windows.first); ReportList *wm_reports = &wm->reports; /* After adding reports to the global list, reset the report timer. */ WM_event_remove_timer(wm, nullptr, wm_reports->reporttimer); /* Records time since last report was added. */ - wm_reports->reporttimer = WM_event_add_timer(wm, wm->winactive, TIMERREPORT, 0.05); + wm_reports->reporttimer = WM_event_add_timer(wm, win, TIMERREPORT, 0.05); ReportTimerInfo *rti = MEM_cnew(__func__); wm_reports->reporttimer->customdata = rti;