From 9864c9e7e7b4d375f75437390ea7f3a3d26edeec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Sun, 16 Aug 2020 16:31:23 +0200 Subject: [PATCH] Connect to button-press-event to fill the favorite menu The menu must be filled before the toggled event is triggered so we can not use 'clicked' nor 'toggled'. Indeed 'button-press-event' is the first one but we must make the callback continue to propagate the event. issue9530 review296051002 --- tryton/gui/main.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/tryton/gui/main.py b/tryton/gui/main.py index 9fa77f848f..3e450c7422 100644 --- a/tryton/gui/main.py +++ b/tryton/gui/main.py @@ -155,7 +155,7 @@ class Main(Gtk.Application): 'tryton-bookmarks', Gtk.IconSize.BUTTON)) self.menu_favorite = Gtk.Menu.new() favorite.set_popup(self.menu_favorite) - favorite.connect('clicked', self.favorite_set) + favorite.connect('button-press-event', self.favorite_set) self.header.pack_start(favorite) self.set_global_search() @@ -433,7 +433,7 @@ class Main(Gtk.Application): def favorite_set(self, *args): if self.menu_favorite.get_children(): - return True + return def _action_favorite(widget, id_): event = Gtk.get_current_event() @@ -466,7 +466,6 @@ class Main(Gtk.Application): manage_favorites.connect('activate', _manage_favorites) self.menu_favorite.add(manage_favorites) self.menu_favorite.show_all() - return True def favorite_unset(self): for child in self.menu_favorite.get_children():