From 6579f425ffd70c3d2df00f8d42b6026440b45ee3 Mon Sep 17 00:00:00 2001 From: Corewala Date: Tue, 8 Jun 2021 12:25:39 -0400 Subject: [PATCH] XInitThreads is called to fix threading issues. For real this time. --- smother.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/smother.py b/smother.py index 5ed1095..386f19d 100755 --- a/smother.py +++ b/smother.py @@ -1,9 +1,12 @@ #!/usr/bin/python3 -W ignore::DeprecationWarning +import ctypes +x11 = ctypes.cdll.LoadLibrary('libX11.so') +x11.XInitThreads() + import gi import os import yaml import time -import ctypes gi.require_version('Gtk', '3.0') from threading import Thread from gi.repository import Gtk @@ -147,8 +150,6 @@ def status_check(self): vpnstatus = False time.sleep(1) -x11 = ctypes.cdll.LoadLibrary('libX11.so') -x11.XInitThreads() win = Smother() win.connect("destroy", Gtk.main_quit) win.show_all()