diff --git a/src/moongreet/greeter.py b/src/moongreet/greeter.py index 8178a59..64c724d 100644 --- a/src/moongreet/greeter.py +++ b/src/moongreet/greeter.py @@ -74,6 +74,7 @@ class GreeterWindow(Gtk.ApplicationWindow): # Defer initial user selection until the window is realized, # so get_color() returns the actual theme foreground for SVG tinting self.connect("realize", self._on_realize) + self.connect("unrealize", self._on_unrealize) def _on_realize(self, widget: Gtk.Widget) -> None: """Called when the window is realized — select initial user. @@ -84,12 +85,11 @@ class GreeterWindow(Gtk.ApplicationWindow): """ GLib.idle_add(self._select_initial_user) - def do_unrealize(self) -> None: + def _on_unrealize(self, widget: Gtk.Widget) -> None: """Clean up resources when the window is unrealized.""" if self._wallpaper_ctx is not None: self._wallpaper_ctx.__exit__(None, None, None) self._wallpaper_ctx = None - super().do_unrealize() def _build_ui(self) -> None: """Build the complete greeter UI layout."""