- commit
- 4e21c145e4612ae87b40d393f508bc0220dcdd84
- parent
- 9e0aab365df79db731938251a376a6436acd4c19
- Author
- Tobias Bengfort <tobias.bengfort@posteo.de>
- Date
- 2026-03-01 09:09
work around broken MenuItem.set_label() always recreate the menu item
Diffstat
| M | notification_hub.py | 25 | ++++++++++++------------- |
1 files changed, 12 insertions, 13 deletions
diff --git a/notification_hub.py b/notification_hub.py
@@ -93,19 +93,18 @@ def on_add_notification(params, id): 93 93 label = f'{app_name}: {params["summary"]}' 94 94 95 95 if thread:96 -1 thread['id'] = id97 -1 thread['menuitem'].set_label(label)98 -1 else:99 -1 item = Gio.MenuItem.new(label, app_name)100 -1 actions.add_action_entries([(app_name, clear_thread)], app_name)101 -1 item.set_attribute([('app-name', 's', app_name)])102 -1 menu.append_item(item)103 -1 indicator.set_status(AppIndicator3.IndicatorStatus.ATTENTION)104 -1105 -1 threads[app_name] = {106 -1 'menuitem': item,107 -1 'id': id,108 -1 }-1 96 remove_menu_item(menu, app_name) -1 97 -1 98 item = Gio.MenuItem.new(label, app_name) -1 99 actions.add_action_entries([(app_name, clear_thread)], app_name) -1 100 item.set_attribute([('app-name', 's', app_name)]) -1 101 menu.append_item(item) -1 102 indicator.set_status(AppIndicator3.IndicatorStatus.ATTENTION) -1 103 -1 104 threads[app_name] = { -1 105 'menuitem': item, -1 106 'id': id, -1 107 } 109 108 110 109 111 110 def on_close_notification(id):