@@ -67,11 +67,7 @@ def __init__(self, socket_path=None, auto_reconnect=False):
67
67
if not socket_path :
68
68
raise Exception ('Failed to retrieve the i3 or sway IPC socket path' )
69
69
70
- if auto_reconnect :
71
- self .subscriptions = EventType .SHUTDOWN .value
72
- else :
73
- self .subscriptions = 0
74
-
70
+ self .subscriptions = 0
75
71
self ._pubsub = PubSub (self )
76
72
self ._socket_path = socket_path
77
73
self ._cmd_socket = socket .socket (socket .AF_UNIX , socket .SOCK_STREAM )
@@ -80,7 +76,6 @@ def __init__(self, socket_path=None, auto_reconnect=False):
80
76
self ._sub_socket = None
81
77
self ._sub_lock = Lock ()
82
78
self ._auto_reconnect = auto_reconnect
83
- self ._restarting = False
84
79
self ._quitting = False
85
80
self ._synchronizer = None
86
81
@@ -465,8 +460,6 @@ def _event_socket_poll(self):
465
460
elif msg_type == EventType .SHUTDOWN .value :
466
461
event_name = 'shutdown'
467
462
event = ShutdownEvent (data )
468
- if event .change == 'restart' :
469
- self ._restarting = True
470
463
elif msg_type == EventType .TICK .value :
471
464
event_name = 'tick'
472
465
event = TickEvent (data )
@@ -511,13 +504,9 @@ def main(self, timeout: float = 0.0):
511
504
512
505
self ._event_socket_teardown ()
513
506
514
- if self ._quitting or not self ._restarting or not self . auto_reconnect :
507
+ if self ._quitting or not self .auto_reconnect :
515
508
break
516
509
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.
521
510
if not self ._wait_for_socket ():
522
511
break
523
512
0 commit comments