palettemenuwidget: Ensure the widget is realized before popping it up, SL #4388

Otherwise the internal state is messed up, GTK+ grabs may be held on
unrealized widgets.

Signed-off-by: Carlos Garnacho <carlos@lanedo.com>
Acked-by: Simon Schampijer <simon@laptop.org>
This commit is contained in:
Carlos Garnacho 2013-01-17 13:29:51 +01:00 committed by Simon Schampijer
parent 5fd2dd8a98
commit 3596e8c6cb

View File

@ -148,6 +148,7 @@ class _PaletteMenuWidget(Gtk.Menu):
self._invoker = invoker self._invoker = invoker
self._find_all_menus(self) self._find_all_menus(self)
self.realize()
for menu in self._menus: for menu in self._menus:
if self._invoker: if self._invoker:
menu.connect('motion-notify-event', self._motion_notify_cb) menu.connect('motion-notify-event', self._motion_notify_cb)