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.
This commit is contained in:
Philipp Hörist 2017-09-23 10:10:36 +02:00
parent 9785f31415
commit 65d2284b59
1 changed files with 11 additions and 2 deletions

View File

@ -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: