fix: add destroy() and signal cleanup across widgets, fix settings window + menu regressions

P0 leak fixes: context/action menus destroyed on deactivate, config
callbacks unregistered in settings widgets, recorder and server signal
IDs stored and disconnected, bluetooth client closed and unsubscribed,
rfkill timer removed, seek timers cancelled, dropdown and options menus
freed, app name cache LRU-bounded.

Fix desktop 'Edit Widgets' and settings menu regressions by deferring
destroy out of Gtk signal handlers via GLib.idle_add.

Fix settings entry fields by connecting the activate signal explicitly
(Enter saves the value).
This commit is contained in:
sankalp committed 2026-08-01 19:44:39 +05:45
1 parent 55fc3fba21
commit d8696b9198
13 files changed
+180 -44

No files matched your search

+8 -1
View File
@@ -164,6 +164,7 @@ class DesktopWidgetWindow(WaylandWindow):
self._dragging_eb: Gtk.EventBox | None = None
self._drag_drop_success: bool = False
self._input_rebuild_pending: bool = False
self._context_menu: Gtk.Menu | None = None
self._root = Box(h_expand=True, v_expand=True)
self._root.add(self._fixed)
@@ -296,7 +297,7 @@ class DesktopWidgetWindow(WaylandWindow):
return False
def _show_context_menu(self, event: Gdk.EventButton) -> None:
menu = Gtk.Menu()
menu = self._context_menu = Gtk.Menu()
label_text = "Done Edit" if self._edit_mode else "Edit Widgets"
edit_item = Gtk.CheckMenuItem(label=label_text)
@@ -304,9 +305,15 @@ class DesktopWidgetWindow(WaylandWindow):
edit_item.connect("toggled", self._on_edit_toggled)
menu.append(edit_item)
menu.connect("deactivate", self._on_context_menu_deactivate)
menu.show_all()
menu.popup_at_pointer(event)
def _on_context_menu_deactivate(self, menu) -> None:
if self._context_menu is menu:
self._context_menu = None
GLib.idle_add(menu.destroy)
# edit mode
def _on_edit_toggled(self, item) -> None: