fix: do_unrealize durch Signal-Handler ersetzen (PyGObject VFunc-Kompatibilität)
do_unrealize als GObject-VFunc-Override crashte beim super()-Chain-Up. Signal-basierter _on_unrealize-Handler wie bei _on_realize.
This commit is contained in:
parent
4cd73a430b
commit
8f2540024d
@ -74,6 +74,7 @@ class GreeterWindow(Gtk.ApplicationWindow):
|
|||||||
# Defer initial user selection until the window is realized,
|
# Defer initial user selection until the window is realized,
|
||||||
# so get_color() returns the actual theme foreground for SVG tinting
|
# so get_color() returns the actual theme foreground for SVG tinting
|
||||||
self.connect("realize", self._on_realize)
|
self.connect("realize", self._on_realize)
|
||||||
|
self.connect("unrealize", self._on_unrealize)
|
||||||
|
|
||||||
def _on_realize(self, widget: Gtk.Widget) -> None:
|
def _on_realize(self, widget: Gtk.Widget) -> None:
|
||||||
"""Called when the window is realized — select initial user.
|
"""Called when the window is realized — select initial user.
|
||||||
@ -84,12 +85,11 @@ class GreeterWindow(Gtk.ApplicationWindow):
|
|||||||
"""
|
"""
|
||||||
GLib.idle_add(self._select_initial_user)
|
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."""
|
"""Clean up resources when the window is unrealized."""
|
||||||
if self._wallpaper_ctx is not None:
|
if self._wallpaper_ctx is not None:
|
||||||
self._wallpaper_ctx.__exit__(None, None, None)
|
self._wallpaper_ctx.__exit__(None, None, None)
|
||||||
self._wallpaper_ctx = None
|
self._wallpaper_ctx = None
|
||||||
super().do_unrealize()
|
|
||||||
|
|
||||||
def _build_ui(self) -> None:
|
def _build_ui(self) -> None:
|
||||||
"""Build the complete greeter UI layout."""
|
"""Build the complete greeter UI layout."""
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user