My app activates manual proxy settings when a connection toggle is turned on and turns proxy off when toggle position is reversed. The problem is, if a user presses a cross to shut the app down, they are left with manual proxy mode and broken internet.
My current code, where I already tried some solutions I found online:
class App(Adw.Application):
def __init__(self):
super().__init__(application_id="com.example.VPNApp")
self.connect("shutdown", self.on_shutdown)
def do_activate(self):
# Create and show the main app window
global window
window = EvadeWindow(application=self)
window.present()
app.inhibit(win, Gtk.ApplicationInhibitFlags.LOGOUT |
Gtk.ApplicationInhibitFlags.SUSPEND, 'It\'s time to do some tasks:\n1) Task one ...\n2) Task two ...\n3) Task three ...')
def on_shutdown(self, app):
shut_sing_box_processes()
print('all sb shdown')
None of them work. It should print 'all sb shdown' every time I press an X, but I’m left with broken proxy instead.