Palette: handle the case where setting the transient window does fail, SL #4221

The expected parent window did likely change, for example
this can happen when we switch the Home Views while a Palette
of a canvas icon is popping up (SL #4221). In that case
send the 'popdown' signal so that for example the hovering
state feedback can be cleared.

Signed-off-by: Simon Schampijer <simon@laptop.org>
Acked-by: Manuel Quiñones <manuq@laptop.org>
master
Simon Schampijer 11 years ago
parent dcbdcd77fe
commit b3048112d6

@ -623,7 +623,13 @@ class PaletteWindow(GObject.GObject):
self._alignment = self._invoker.get_alignment(full_size_request)
self.update_position()
self._widget.set_transient_for(self._invoker.get_toplevel())
try:
self._widget.set_transient_for(self._invoker.get_toplevel())
except TypeError:
# the expected parent window did likely change e.g. SL #4221
# popdown the Palette
self.emit('popdown')
return
self._popdown_anim.stop()

Loading…
Cancel
Save