idle added event back to gtk thread

This commit is contained in:
itdominator 2024-09-16 20:45:30 -05:00
parent cc5d56a067
commit 9052867c24

View File

@ -9,6 +9,8 @@ from multiprocessing.connection import Client
from multiprocessing.connection import Listener
# Lib imports
import gi
from gi.repository import GLib
# Application imports
from .singleton import Singleton
@ -82,7 +84,7 @@ class LSPEndpointServer(Singleton):
data_str = base64.b64decode(data.encode("utf-8")).decode("utf-8")
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()
break
@ -97,6 +99,8 @@ class LSPEndpointServer(Singleton):
conn.close()
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:
try: