@@ -67,11 +67,7 @@ def __init__(self, socket_path=None, auto_reconnect=False):
6767 if not socket_path :
6868 raise Exception ('Failed to retrieve the i3 or sway IPC socket path' )
6969
70- if auto_reconnect :
71- self .subscriptions = EventType .SHUTDOWN .value
72- else :
73- self .subscriptions = 0
74-
70+ self .subscriptions = 0
7571 self ._pubsub = PubSub (self )
7672 self ._socket_path = socket_path
7773 self ._cmd_socket = socket .socket (socket .AF_UNIX , socket .SOCK_STREAM )
@@ -80,7 +76,6 @@ def __init__(self, socket_path=None, auto_reconnect=False):
8076 self ._sub_socket = None
8177 self ._sub_lock = Lock ()
8278 self ._auto_reconnect = auto_reconnect
83- self ._restarting = False
8479 self ._quitting = False
8580 self ._synchronizer = None
8681
@@ -465,8 +460,6 @@ def _event_socket_poll(self):
465460 elif msg_type == EventType .SHUTDOWN .value :
466461 event_name = 'shutdown'
467462 event = ShutdownEvent (data )
468- if event .change == 'restart' :
469- self ._restarting = True
470463 elif msg_type == EventType .TICK .value :
471464 event_name = 'tick'
472465 event = TickEvent (data )
@@ -511,13 +504,9 @@ def main(self, timeout: float = 0.0):
511504
512505 self ._event_socket_teardown ()
513506
514- if self ._quitting or not self ._restarting or not self . auto_reconnect :
507+ if self ._quitting or not self .auto_reconnect :
515508 break
516509
517- self ._restarting = False
518- # The ipc told us it's restarting and the user wants to survive
519- # restarts. Wait for the socket path to reappear and reconnect
520- # to it.
521510 if not self ._wait_for_socket ():
522511 break
523512
0 commit comments