Fix login freeze: make the UPower proxy lookup async, not blocking #2

Merged
Quinta0 merged 1 commits from claude/gnome-wallpaper-auto-rotation-r1ailq into main 2026-08-06 11:21:08 +02:00
Quinta0 commented 2026-08-06 11:20:59 +02:00 (Migrated from github.com)

_connectPowerWatches() used Gio.DBusProxy.new_for_bus_sync(), which blocks gnome-shell's single main thread until the system bus replies. Since gnome-shell is the Wayland compositor, that stalls the entire screen for however long it takes — and this runs every time live wallpaper starts, including automatically at login whenever it was left enabled. Right after login, with upowerd/D-Bus still warming up alongside everything else, that block can run for many seconds up to the ~25s GDBus timeout, which matches reports of the whole system freezing right after the greeter/login. Switched to the async new_for_bus(), guarded by a generation counter so a stale in-flight lookup can't clobber state from a later _stop()/_connectPowerWatches().

_connectPowerWatches() used Gio.DBusProxy.new_for_bus_sync(), which blocks gnome-shell's single main thread until the system bus replies. Since gnome-shell is the Wayland compositor, that stalls the entire screen for however long it takes — and this runs every time live wallpaper starts, including automatically at login whenever it was left enabled. Right after login, with upowerd/D-Bus still warming up alongside everything else, that block can run for many seconds up to the ~25s GDBus timeout, which matches reports of the whole system freezing right after the greeter/login. Switched to the async new_for_bus(), guarded by a generation counter so a stale in-flight lookup can't clobber state from a later _stop()/_connectPowerWatches().
Sign in to join this conversation.