Commit fd23d880 authored by eta's avatar eta Committed by eta

Run GTK main loop in between incoming stanzas

- This prevents 30-60 second lockups when starting gajim while the main thread
  is processing large numbers of incoming stanzas and not yielding to the GTK
  main loop at all.
- This is done by explicitly running the main loop after a stanza is received,
  if there are events pending.

(Empirically, this makes gajim actually usable on my machine, whereas current
master is pretty bad lockup-wise after startup/reconnection...)
parent 029dfc0e
Pipeline #6006 failed with stages
in 0 seconds
......@@ -20,6 +20,7 @@ from nbxmpp.const import StreamError
from nbxmpp.const import ConnectionType
from gi.repository import GLib
from gi.repository import Gtk
from gajim.common import passwords
from gajim.common.nec import NetworkEvent
......@@ -345,6 +346,9 @@ class Client(ConnectionHandlers):
app.nec.push_incoming_event(NetworkEvent('stanza-received',
account=self._account,
stanza=stanza))
while Gtk.events_pending():
Gtk.main_iteration()
def get_own_jid(self):
"""
Return the last full JID we received on a bind event.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment