Philipp Hörist pushed to branch master at gajim / gajim
Commits:
c8b31dff by Philipp Hörist at 2018-09-06T19:44:31Z
Remove verbose logging of idle time
- - - - -
1 changed file:
- gajim/common/idle.py
Changes:
=====================================
gajim/common/idle.py
=====================================
--- a/gajim/common/idle.py
+++ b/gajim/common/idle.py
@@ -257,7 +257,6 @@ class IdleMonitor:
return True
idle_time = self.get_idle_sec()
- log.info('Idle time: %s', idle_time)
# xa is stronger than away so check for xa first
if idle_time > self._xa_interval:
View it on GitLab: https://dev.gajim.org/gajim/gajim/commit/c8b31dffbbc4ebe716ded2a47d01102089…
--
View it on GitLab: https://dev.gajim.org/gajim/gajim/commit/c8b31dffbbc4ebe716ded2a47d01102089…
You're receiving this email because of your account on dev.gajim.org.
Philipp Hörist pushed to branch master at gajim / gajim
Commits:
bba88cf6 by Philipp Hörist at 2018-09-06T19:41:38Z
Windows: Improve locked screen detection
UAC prompts count as locked screens, so only trigger extended away
when the screen is more than 10 seconds locked
Fixes #9117
- - - - -
1 changed file:
- gajim/common/idle.py
Changes:
=====================================
gajim/common/idle.py
=====================================
--- a/gajim/common/idle.py
+++ b/gajim/common/idle.py
@@ -20,6 +20,7 @@
# along with Gajim. If not, see <http://www.gnu.org/licenses/>.
import sys
+import time
import ctypes
import ctypes.util
import logging
@@ -151,6 +152,8 @@ class WindowsIdleMonitor:
self.GetTickCount = ctypes.windll.kernel32.GetTickCount
self.GetLastInputInfo = ctypes.windll.user32.GetLastInputInfo
+ self._locked_time = None
+
class LASTINPUTINFO(ctypes.Structure):
_fields_ = [('cbSize', ctypes.c_uint), ('dwTime', ctypes.c_uint)]
@@ -165,17 +168,29 @@ class WindowsIdleMonitor:
# Check if Screen Saver is running
# 0x72 is SPI_GETSCREENSAVERRUNNING
saver_runing = ctypes.c_int(0)
- info = self.SystemParametersInfo(0x72, 0, ctypes.byref(saver_runing), 0)
+ info = self.SystemParametersInfo(
+ 0x72, 0, ctypes.byref(saver_runing), 0)
if info and saver_runing.value:
return True
# Check if Screen is locked
+ # Also a UAC prompt counts as locked
+ # So just return True if we are more than 10 seconds locked
desk = self.OpenInputDesktop(0, False, 0)
- if not desk:
- return True
+ unlocked = bool(desk)
self.CloseDesktop(desk)
- return False
+ if unlocked:
+ self._locked_time = None
+ return False
+
+ if self._locked_time is None:
+ self._locked_time = time.time()
+ return False
+
+ threshold = time.time() - 10
+ if threshold > self._locked_time:
+ return True
class IdleMonitor:
View it on GitLab: https://dev.gajim.org/gajim/gajim/commit/bba88cf60918e17f5b3a93d904ec2fd612…
--
View it on GitLab: https://dev.gajim.org/gajim/gajim/commit/bba88cf60918e17f5b3a93d904ec2fd612…
You're receiving this email because of your account on dev.gajim.org.
Philipp Hörist pushed to branch master at gajim / gajim
Commits:
3a16ccb4 by Philipp Hörist at 2018-09-06T19:38:41Z
Revert "Windows: Remove locked screen detection"
This reverts commit 05307bd6098343993b6b57544ee5fccd2a3ce7ac
- - - - -
1 changed file:
- gajim/common/idle.py
Changes:
=====================================
gajim/common/idle.py
=====================================
--- 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
View it on GitLab: https://dev.gajim.org/gajim/gajim/commit/3a16ccb4d453f399482f81fc35326edce8…
--
View it on GitLab: https://dev.gajim.org/gajim/gajim/commit/3a16ccb4d453f399482f81fc35326edce8…
You're receiving this email because of your account on dev.gajim.org.
Philipp Hörist pushed to branch master at gajim / gajim
Commits:
05307bd6 by Philipp Hörist at 2018-09-06T19:17:05Z
Windows: Remove locked screen detection
This does not reliably tell us when the screen is locked.
For example this triggers when a UAC prompt is active.
>From the Windows documentation there is no way to determine
if a workstation is locked
Fixes #9117
- - - - -
1 changed file:
- gajim/common/idle.py
Changes:
=====================================
gajim/common/idle.py
=====================================
--- a/gajim/common/idle.py
+++ b/gajim/common/idle.py
@@ -168,13 +168,6 @@ 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
View it on GitLab: https://dev.gajim.org/gajim/gajim/commit/05307bd6098343993b6b57544ee5fccd2a…
--
View it on GitLab: https://dev.gajim.org/gajim/gajim/commit/05307bd6098343993b6b57544ee5fccd2a…
You're receiving this email because of your account on dev.gajim.org.
Philipp Hörist pushed to branch master at gajim / gajim
Commits:
a4a13656 by Philipp Hörist at 2018-09-05T00:59:34Z
Fix license comment format
every linter flags this as an error
- - - - -
30 changed files:
- gajim/adhoc_commands.py
- gajim/advanced_configuration_window.py
- gajim/app_actions.py
- gajim/atom_window.py
- gajim/cell_renderer_image.py
- gajim/chat_control.py
- gajim/chat_control_base.py
- gajim/common/account.py
- gajim/common/app.py
- gajim/common/caps_cache.py
- gajim/common/config.py
- gajim/common/configpaths.py
- gajim/common/connection.py
- gajim/common/connection_handlers.py
- gajim/common/connection_handlers_events.py
- gajim/common/contacts.py
- gajim/common/dbus_support.py
- gajim/common/dh.py
- gajim/common/events.py
- gajim/common/exceptions.py
- gajim/common/fuzzyclock.py
- gajim/common/ged.py
- gajim/common/gpg.py
- gajim/common/helpers.py
- gajim/common/i18n.py
- gajim/common/idle.py
- gajim/common/jingle.py
- gajim/common/jingle_content.py
- gajim/common/jingle_ft.py
- gajim/common/jingle_ftstates.py
The diff was not included because it is too large.
View it on GitLab: https://dev.gajim.org/gajim/gajim/commit/a4a136566f7477e589215efac19eb48d0d…
--
View it on GitLab: https://dev.gajim.org/gajim/gajim/commit/a4a136566f7477e589215efac19eb48d0d…
You're receiving this email because of your account on dev.gajim.org.
Philipp Hörist pushed to branch master at gajim / gajim
Commits:
856a874d by Philipp Hörist at 2018-09-05T00:34:36Z
Fix pyflakes/pycodestyle errors
- - - - -
1 changed file:
- gajim/gtkexcepthook.py
Changes:
=====================================
gajim/gtkexcepthook.py
=====================================
--- a/gajim/gtkexcepthook.py
+++ b/gajim/gtkexcepthook.py
@@ -1,25 +1,21 @@
-# -*- coding:utf-8 -*-
-## gajim/gtkexcepthook.py
-##
-## Copyright (C) 2016-2018 Philipp Hörist <philipp AT hoerist.com>
-## Copyright (C) 2005-2006 Nikos Kouremenos <kourem AT gmail.com>
-## Copyright (C) 2005-2014 Yann Leboulanger <asterix AT lagaule.org>
-## Copyright (C) 2008 Stephan Erb <steve-e AT h3c.de>
-##
-## This file is part of Gajim.
-##
-## Gajim is free software; you can redistribute it and/or modify
-## it under the terms of the GNU General Public License as published
-## by the Free Software Foundation; version 3 only.
-##
-## Gajim is distributed in the hope that it will be useful,
-## but WITHOUT ANY WARRANTY; without even the implied warranty of
-## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-## GNU General Public License for more details.
-##
-## You should have received a copy of the GNU General Public License
-## along with Gajim. If not, see <http://www.gnu.org/licenses/>.
-##
+# Copyright (C) 2016-2018 Philipp Hörist <philipp AT hoerist.com>
+# Copyright (C) 2005-2006 Nikos Kouremenos <kourem AT gmail.com>
+# Copyright (C) 2005-2014 Yann Leboulanger <asterix AT lagaule.org>
+# Copyright (C) 2008 Stephan Erb <steve-e AT h3c.de>
+#
+# This file is part of Gajim.
+#
+# Gajim is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published
+# by the Free Software Foundation; version 3 only.
+#
+# Gajim is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with Gajim. If not, see <http://www.gnu.org/licenses/>.
import sys
import os
@@ -31,8 +27,6 @@ from io import StringIO
from urllib.parse import urlencode
import nbxmpp
-import gi
-gi.require_version('Gtk', '3.0')
from gi.repository import Gtk, GObject
try:
View it on GitLab: https://dev.gajim.org/gajim/gajim/commit/856a874dd5aac864098f37f0fa950bf49b…
--
View it on GitLab: https://dev.gajim.org/gajim/gajim/commit/856a874dd5aac864098f37f0fa950bf49b…
You're receiving this email because of your account on dev.gajim.org.
Philipp Hörist pushed to branch master at gajim / gajim
Commits:
9dd747df by Philipp Hörist at 2018-09-05T00:14:51Z
Windows: Fix IPV6 for Windows 10+
Fixes #9326
- - - - -
2 changed files:
- gajim/common/socks5.py
- gajim/common/zeroconf/client_zeroconf.py
Changes:
=====================================
gajim/common/socks5.py
=====================================
--- a/gajim/common/socks5.py
+++ b/gajim/common/socks5.py
@@ -27,6 +27,7 @@ import struct
import hashlib
import os
import time
+import platform
from errno import EWOULDBLOCK
from errno import ENOBUFS
from errno import EINTR
@@ -1424,8 +1425,7 @@ class Socks5Listener(IdleObject):
# Under windows Vista, we need that to listen on ipv6 AND ipv4
# Doesn't work under windows XP
if os.name == 'nt':
- ver = os.sys.getwindowsversion()
- if (ver[3], ver[0]) == (2, 6): # Win Vista +
+ if int(platform.win32_ver()[0]) >= 6: # Win Vista +
# 47 is socket.IPPROTO_IPV6
# 27 is socket.IPV6_V6ONLY under windows, but not defined ...
self._serv.setsockopt(41, 27, 0)
=====================================
gajim/common/zeroconf/client_zeroconf.py
=====================================
--- a/gajim/common/zeroconf/client_zeroconf.py
+++ b/gajim/common/zeroconf/client_zeroconf.py
@@ -27,6 +27,7 @@ from gajim.common.zeroconf import zeroconf
from nbxmpp.protocol import *
import socket
+import platform
import ssl
import errno
import sys
@@ -73,8 +74,7 @@ class ZeroconfListener(IdleObject):
self._serv.setsockopt(socket.SOL_SOCKET, socket.SO_KEEPALIVE, 1)
self._serv.setsockopt(socket.IPPROTO_TCP, socket.TCP_NODELAY, 1)
if os.name == 'nt':
- ver = os.sys.getwindowsversion()
- if (ver[3], ver[0]) == (2, 6): # Win Vista +
+ if int(platform.win32_ver()[0]) >= 6: # Win Vista +
# 47 is socket.IPPROTO_IPV6
# 27 is socket.IPV6_V6ONLY under windows, but not defined ...
self._serv.setsockopt(41, 27, 0)
View it on GitLab: https://dev.gajim.org/gajim/gajim/commit/9dd747dfe52aa3967c437597c1018d4d5d…
--
View it on GitLab: https://dev.gajim.org/gajim/gajim/commit/9dd747dfe52aa3967c437597c1018d4d5d…
You're receiving this email because of your account on dev.gajim.org.