From 3a16ccb4d453f399482f81fc35326edce88d7118 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philipp=20H=C3=B6rist?= Date: Thu, 6 Sep 2018 21:38:41 +0200 Subject: [PATCH] Revert "Windows: Remove locked screen detection" This reverts commit 05307bd6098343993b6b57544ee5fccd2a3ce7ac --- gajim/common/idle.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/gajim/common/idle.py b/gajim/common/idle.py index 034cf0750..5bce7699f 100644 --- a/gajim/common/idle.py +++ b/gajim/common/idle.py @@ -168,6 +168,13 @@ class WindowsIdleMonitor: info = self.SystemParametersInfo(0x72, 0, ctypes.byref(saver_runing), 0) if info and saver_runing.value: return True + + # Check if Screen is locked + desk = self.OpenInputDesktop(0, False, 0) + if not desk: + return True + self.CloseDesktop(desk) + return False