Emit palette popup only after the window is mapped. This fixes ticket #3486.

This commit is contained in:
Benjamin Berg 2008-02-25 16:12:08 +00:00
parent c9871633e3
commit 826bf9dd4c

View File

@ -151,6 +151,7 @@ class Palette(gtk.Window):
self.set_border_width(self.style.xthickness) self.set_border_width(self.style.xthickness)
self.connect('realize', self._realize_cb) self.connect('realize', self._realize_cb)
self.connect('destroy', self.__destroy_cb) self.connect('destroy', self.__destroy_cb)
self.connect('map-event', self.__map_event_cb)
self.palette_state = self.PRIMARY self.palette_state = self.PRIMARY
@ -419,12 +420,6 @@ class Palette(gtk.Window):
self.menu.set_active(True) self.menu.set_active(True)
self.show() self.show()
self._invoker.notify_popup()
self._up = True
_palette_observer.emit('popup', self)
self.emit('popup')
def _hide(self): def _hide(self):
self._secondary_anim.stop() self._secondary_anim.stop()
@ -515,6 +510,13 @@ class Palette(gtk.Window):
if self != palette: if self != palette:
self._hide() self._hide()
def __map_event_cb(self, widget, event):
self._invoker.notify_popup()
self._up = True
_palette_observer.emit('popup', self)
self.emit('popup')
class PaletteActionBar(gtk.HButtonBox): class PaletteActionBar(gtk.HButtonBox):
def add_action(label, icon_name=None): def add_action(label, icon_name=None):
button = Button(label) button = Button(label)