From 65d2284b59f00969c140b1d90e07b99968018a4c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philipp=20H=C3=B6rist?= Date: Sat, 23 Sep 2017 10:10:36 +0200 Subject: [PATCH] Reduce PROCESS_TIMEOUT on Windows If io_add_watch is available like on Linux, the PROCESS_TIMEOUT, is only used to check for timed out events. On Window its also used to call select() on the socket, so we get pending data. We need this as low as possible otherwise Gajim on Windows feels painfully slow. --- gajim/gui_interface.py | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/gajim/gui_interface.py b/gajim/gui_interface.py index d73d9d08c..30ef3a455 100644 --- a/gajim/gui_interface.py +++ b/gajim/gui_interface.py @@ -2309,7 +2309,12 @@ class Interface: app.idlequeue.process() except Exception: # Otherwise, an exception will stop our loop - timeout, in_seconds = app.idlequeue.PROCESS_TIMEOUT + + if sys.platform == 'win32': + timeout, in_seconds = 20, None + else: + timeout, in_seconds = app.idlequeue.PROCESS_TIMEOUT + if in_seconds: GLib.timeout_add_seconds(timeout, self.process_connections) else: @@ -2566,7 +2571,11 @@ class Interface: self.instances['file_transfers'] = dialogs.FileTransfersWindow() GLib.timeout_add(100, self.autoconnect) - timeout, in_seconds = app.idlequeue.PROCESS_TIMEOUT + if sys.platform == 'win32': + timeout, in_seconds = 20, None + else: + timeout, in_seconds = app.idlequeue.PROCESS_TIMEOUT + if in_seconds: GLib.timeout_add_seconds(timeout, self.process_connections) else: