1
0
mirror of https://github.com/valinet/ExplorerPatcher.git synced 2024-11-23 23:21:08 +01:00

Weather: Wait a bit before refreshing when network connectivity is restored

This is so that we avoid a situation where the browser was looping on
trying to display the error page. Each navigation request was
erroring out, and the error said something along the lines of
"Your computer went to sleep". Indeed, this bug could be reproduced by
hibernating the computer and then waking it up - it seemed to occur
pretty frequently, especially on battery, when the power budget is more
constrained, and thus the speed of the PC as well. Hopefully, this
commit and the previous one addresses this issue.
This commit is contained in:
Valentin Radu 2022-08-04 23:57:33 +03:00
parent aeb8e54b58
commit da3fece8cd

View File

@ -75,7 +75,8 @@ HRESULT STDMETHODCALLTYPE INetworkListManagerEvents_ConnectivityChanged(void* _t
{
printf("[Network Events] Internet connection status is: Available.\n");
LONG64 dwUpdateSchedule = InterlockedAdd64(&_this->dwUpdateSchedule, 0);
PostMessageW(_this->hWnd, EP_WEATHER_WM_FETCH_DATA, 0, 0);
SetTimer(_this->hWnd, EP_WEATHER_TIMER_REQUEST_REFRESH, EP_WEATHER_TIMER_REQUEST_REFRESH_DELAY, NULL);
//PostMessageW(_this->hWnd, EP_WEATHER_WM_FETCH_DATA, 0, 0);
SetTimer(_this->hWnd, EP_WEATHER_TIMER_SCHEDULE_REFRESH, dwUpdateSchedule, NULL);
printf("[Network Events] Reinstalled refresh timer.\n");
}