Fix background portal task idling in the background

This commit is contained in:
Bernd Schoolmann 2023-12-23 23:59:40 +01:00
parent ccbfbfe3e3
commit 4081d7fac4
No known key found for this signature in database

View file

@ -5,11 +5,13 @@ import gc
from gi.repository import Gtk, Adw, GLib, Gio from gi.repository import Gtk, Adw, GLib, Gio
from random import randint from random import randint
import time import time
import os
from threading import Timer
def receive_autostart(self, *args): def receive_autostart(self, *args):
print("autostart enabled..!?") print("autostart enabled..!?")
print(args) print(args)
os._exit(0)
def request_autostart(): def request_autostart():
bus = Gio.bus_get_sync(Gio.BusType.SESSION, None) bus = Gio.bus_get_sync(Gio.BusType.SESSION, None)
@ -54,5 +56,8 @@ def request_autostart():
request_autostart() request_autostart()
thread = Timer(10, os._exit, [0])
thread.start()
loop = GLib.MainLoop() loop = GLib.MainLoop()
loop.run() loop.run()