diff options
author | Simon Schampijer <simon@laptop.org> | 2013-03-14 11:00:22 (GMT) |
---|---|---|
committer | Simon Schampijer <simon@laptop.org> | 2013-03-14 15:14:55 (GMT) |
commit | b3048112d67db0c4901c49bf366d43e55d9b2fd5 (patch) | |
tree | ca6c3b2de733b1c00721226828cd6b57311ca49b /src | |
parent | dcbdcd77fe803ca12d5b973ea3764d2042a9a991 (diff) |
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>
Diffstat (limited to 'src')
-rw-r--r-- | src/sugar3/graphics/palettewindow.py | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/sugar3/graphics/palettewindow.py b/src/sugar3/graphics/palettewindow.py index c48ae55..995e258 100644 --- a/src/sugar3/graphics/palettewindow.py +++ b/src/sugar3/graphics/palettewindow.py @@ -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() |