diff options
author | George Hazan <ghazan@miranda.im> | 2018-06-18 18:52:42 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2018-06-18 18:52:49 +0300 |
commit | cbce1d961ed4a3da99ea8aedc351c047ee2a305d (patch) | |
tree | bca75e588653d36bd4e9e9434397735396644307 /src/core | |
parent | 0380fd10e7934563116b2eeaec5414778068cfaa (diff) |
fixes #1427 (Miranda doesn't set status back when returning from idle)
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/stdautoaway/src/idle.cpp | 28 |
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() |