From 4081d7fac430916093c188e8193b31446b8e1976 Mon Sep 17 00:00:00 2001 From: Bernd Schoolmann Date: Sat, 23 Dec 2023 23:59:40 +0100 Subject: [PATCH] Fix background portal task idling in the background --- ui/background.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/ui/background.py b/ui/background.py index f684b4f..b14bec1 100644 --- a/ui/background.py +++ b/ui/background.py @@ -5,11 +5,13 @@ import gc from gi.repository import Gtk, Adw, GLib, Gio from random import randint import time - +import os +from threading import Timer def receive_autostart(self, *args): print("autostart enabled..!?") print(args) + os._exit(0) def request_autostart(): bus = Gio.bus_get_sync(Gio.BusType.SESSION, None) @@ -54,5 +56,8 @@ def request_autostart(): request_autostart() +thread = Timer(10, os._exit, [0]) +thread.start() + loop = GLib.MainLoop() loop.run()