diff options
author | Calum Lind <calumlind@gmail.com> | 2019-03-29 15:06:38 +0000 |
---|---|---|
committer | Calum Lind <calumlind@gmail.com> | 2019-03-29 15:13:02 +0000 |
commit | 84643fb6f78202593483c91ca1133409a48ccdad (patch) | |
tree | e1368095cf8ad61e1c58e27ef5059d3aecf2d473 /deluge/ui/gtk3/gtkui.py | |
parent | c8b621172ecd3d2dc1d423a153c18ad495f85921 (diff) | |
download | deluge-84643fb6f78202593483c91ca1133409a48ccdad.tar.gz deluge-84643fb6f78202593483c91ca1133409a48ccdad.tar.bz2 deluge-84643fb6f78202593483c91ca1133409a48ccdad.zip |
[GTK] Remove running reactor in Gdk thread
The Gdk threading code is causing issue on Windows and this method
of moving the main loop to a thread has been deprecated and advised
against so removing without adding replacement as it currently
only creates one main thread and should still be fine.
If a blocking operation occures and needs solving, see the pygobject
guide for recommened way to use threads in Gtk:
https://pygobject.readthedocs.io/en/latest/guide/threading.html
Diffstat (limited to 'deluge/ui/gtk3/gtkui.py')
-rw-r--r-- | deluge/ui/gtk3/gtkui.py | 10 |
1 files changed, 1 insertions, 9 deletions
diff --git a/deluge/ui/gtk3/gtkui.py b/deluge/ui/gtk3/gtkui.py index 88fb1016b..c30561ecb 100644 --- a/deluge/ui/gtk3/gtkui.py +++ b/deluge/ui/gtk3/gtkui.py @@ -22,7 +22,7 @@ gi.require_version('Gtk', '3.0') # NOQA: E402 gi.require_version('Gdk', '3.0') # NOQA: E402 # isort:imports-thirdparty -from gi.repository.Gdk import Display, threads_enter, threads_init, threads_leave +from gi.repository.Gdk import Display from gi.repository.GLib import set_prgname from gi.repository.Gtk import Builder, ResponseType from twisted.internet import defer, gtk3reactor @@ -189,10 +189,6 @@ class GtkUI(object): self.queuedtorrents = QueuedTorrents() self.ipcinterface = IPCInterface(args.torrents) - # Since PyGObject 3.10.2, calling GObject.threads_init() this is no longer needed. - # For details on need for threading, see: https://wiki.gnome.org/Projects/PyGObject/Threading - threads_init() - # We make sure that the UI components start once we get a core URI client.set_disconnect_callback(self.__on_disconnect) @@ -248,13 +244,9 @@ class GtkUI(object): def start(self): reactor.callWhenRunning(self._on_reactor_start) - - # Initialize gdk threading - threads_enter() reactor.run() # Reactor is not running. Any async callbacks (Deferreds) can no longer # be processed from this point on. - threads_leave() def shutdown(self, *args, **kwargs): log.debug('GTKUI shutting down...') |