diff --git a/advanced-scene-switcher-win.cpp b/advanced-scene-switcher-win.cpp index c90da2d5..31d2bf6f 100644 --- a/advanced-scene-switcher-win.cpp +++ b/advanced-scene-switcher-win.cpp @@ -1,10 +1,8 @@ #include #include #include "advanced-scene-switcher.hpp" -//dasoven region_start #include #include -//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; +} \ No newline at end of file diff --git a/advanced-scene-switcher.cpp b/advanced-scene-switcher.cpp index d77690fa..f8e45af6 100644 --- a/advanced-scene-switcher.cpp +++ b/advanced-scene-switcher.cpp @@ -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; diff --git a/advanced-scene-switcher.hpp b/advanced-scene-switcher.hpp index fd067641..0dd04668 100644 --- a/advanced-scene-switcher.hpp +++ b/advanced-scene-switcher.hpp @@ -111,8 +111,7 @@ void GetWindowList(std::vector &windows); void GetCurrentWindowTitle(std::string &title); std::pair getCursorPos(); bool isFullscreen(); -int getLastInputTime(); -int getTime(); +int secondsSinceLastInput(); bool isInFocus(const QString &exeToCheck); void GetProcessList(QStringList &processes);