This commit is contained in:
WarmUpTill 2017-02-03 22:11:47 +01:00 committed by GitHub
parent 667cb6b898
commit 6a60cd01fa
3 changed files with 5 additions and 18 deletions

View File

@ -1,10 +1,8 @@
#include <windows.h>
#include <util/platform.h>
#include "advanced-scene-switcher.hpp"
//dasoven region_start
#include <TlHelp32.h>
#include <Psapi.h>
//dasoven region_end
using namespace std;
@ -97,7 +95,6 @@ bool isFullscreen()
return false;
}
//dasoven region_start
void GetProcessList(QStringList &processes) {
HANDLE procSnapshot;
@ -140,7 +137,6 @@ bool isInFocus(const QString &exeToCheck) {
return exeToCheck == QString::fromWCharArray(executablePath).split(QRegExp("(/|\\\\)")).back();
}
//dasoven region_end
int getLastInputTime()
{
@ -156,15 +152,7 @@ int getTime()
return GetTickCount();
}
bool SS()
int secondsSinceLastInput()
{
bool time = false;
if(SystemParametersInfo(
SPI_GETSCREENSAVEACTIVE,
NULL,
&time,
NULL
));
return time;
}
return (getTime() - getLastInputTime()) / 1000;
}

View File

@ -2643,7 +2643,7 @@ void SwitcherData::Thread()
}
}
if (!ignoreIdle && getTime() - getLastInputTime() > idleData.time * 1000)
if (!ignoreIdle && secondsSinceLastInput() > idleData.time)
{
scene = idleData.scene;
transition = idleData.transition;

View File

@ -111,8 +111,7 @@ void GetWindowList(std::vector<std::string> &windows);
void GetCurrentWindowTitle(std::string &title);
std::pair<int, int> getCursorPos();
bool isFullscreen();
int getLastInputTime();
int getTime();
int secondsSinceLastInput();
bool isInFocus(const QString &exeToCheck);
void GetProcessList(QStringList &processes);