Merge pull request #26254 from ksooo/video-cleanup-contextmenus
[xbmc.git] / xbmc / platform / win32 / powermanagement / WinIdleTimer.cpp
blobe3bfdd12ee07df0fbcd8ec80521b01b1e3209267
1 /*
2 * Copyright (C) 2005-2018 Team Kodi
3 * This file is part of Kodi - https://kodi.tv
5 * SPDX-License-Identifier: GPL-2.0-or-later
6 * See LICENSES/README.md for more information.
7 */
8 #include "powermanagement/WinIdleTimer.h"
10 #include "ServiceBroker.h"
11 #include "application/ApplicationComponents.h"
12 #include "application/ApplicationPowerHandling.h"
14 void CWinIdleTimer::StartZero()
16 const auto& components = CServiceBroker::GetAppComponents();
17 const auto appPower = components.GetComponent<CApplicationPowerHandling>();
18 if (!appPower->IsDPMSActive())
19 SetThreadExecutionState(ES_SYSTEM_REQUIRED|ES_DISPLAY_REQUIRED);
20 CStopWatch::StartZero();