summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2018-06-18 18:52:42 +0300
committerGeorge Hazan <ghazan@miranda.im>2018-06-18 18:52:49 +0300
commitcbce1d961ed4a3da99ea8aedc351c047ee2a305d (patch)
treebca75e588653d36bd4e9e9434397735396644307 /src
parent0380fd10e7934563116b2eeaec5414778068cfaa (diff)
fixes #1427 (Miranda doesn't set status back when returning from idle)
Diffstat (limited to 'src')
-rw-r--r--src/core/stdautoaway/src/idle.cpp28
1 files changed, 16 insertions, 12 deletions
diff --git a/src/core/stdautoaway/src/idle.cpp b/src/core/stdautoaway/src/idle.cpp
index 4c15eede06..7e6143a428 100644
--- a/src/core/stdautoaway/src/idle.cpp
+++ b/src/core/stdautoaway/src/idle.cpp
@@ -45,22 +45,26 @@ static int IdleObject_IsUserIdle()
static void CALLBACK IdleTimer(HWND, UINT, UINT_PTR idEvent, DWORD)
{
- if (g_hTimer == idEvent) {
- if (g_plugin.bIdleCheck && IdleObject_IsUserIdle())
- Idle_Enter(1);
+ if (g_hTimer != idEvent)
+ return;
- else if (g_plugin.bIdleOnSaver && IsScreenSaverRunning())
- Idle_Enter(2);
+ if (g_plugin.bIdleCheck && IdleObject_IsUserIdle())
+ Idle_Enter(1);
- else if (g_plugin.bIdleOnFullScr && IsFullScreen())
- Idle_Enter(3);
+ else if (g_plugin.bIdleOnSaver && IsScreenSaverRunning())
+ Idle_Enter(2);
- else if (g_plugin.bIdleOnLock && IsWorkstationLocked())
- Idle_Enter(4);
+ else if (g_plugin.bIdleOnFullScr && IsFullScreen())
+ Idle_Enter(3);
- else if (g_plugin.bIdleOnTerminal && IsTerminalDisconnected())
- Idle_Enter(5);
- }
+ else if (g_plugin.bIdleOnLock && IsWorkstationLocked())
+ Idle_Enter(4);
+
+ else if (g_plugin.bIdleOnTerminal && IsTerminalDisconnected())
+ Idle_Enter(5);
+
+ else // not idle
+ Idle_Enter(-1);
}
void IdleObject_Create()