generated from itdominator/Python-With-Gtk-Template
idle added event back to gtk thread
This commit is contained in:
parent
cc5d56a067
commit
9052867c24
|
@ -9,6 +9,8 @@ from multiprocessing.connection import Client
|
||||||
from multiprocessing.connection import Listener
|
from multiprocessing.connection import Listener
|
||||||
|
|
||||||
# Lib imports
|
# Lib imports
|
||||||
|
import gi
|
||||||
|
from gi.repository import GLib
|
||||||
|
|
||||||
# Application imports
|
# Application imports
|
||||||
from .singleton import Singleton
|
from .singleton import Singleton
|
||||||
|
@ -82,7 +84,7 @@ class LSPEndpointServer(Singleton):
|
||||||
data_str = base64.b64decode(data.encode("utf-8")).decode("utf-8")
|
data_str = base64.b64decode(data.encode("utf-8")).decode("utf-8")
|
||||||
json_blob = json.loads(data_str)
|
json_blob = json.loads(data_str)
|
||||||
|
|
||||||
event_system.emit(json_blob["method"], (json_blob,))
|
GLib.idle_add(self._do_emit, json_blob["method"], json_blob)
|
||||||
|
|
||||||
conn.close()
|
conn.close()
|
||||||
break
|
break
|
||||||
|
@ -97,6 +99,8 @@ class LSPEndpointServer(Singleton):
|
||||||
conn.close()
|
conn.close()
|
||||||
break
|
break
|
||||||
|
|
||||||
|
def _do_emit(self, method, json_blob):
|
||||||
|
event_system.emit(method, (json_blob,))
|
||||||
|
|
||||||
def send_client_ipc_message(self, message: str = "Empty Data...") -> None:
|
def send_client_ipc_message(self, message: str = "Empty Data...") -> None:
|
||||||
try:
|
try:
|
||||||
|
|
Loading…
Reference in New Issue