diff options
author | Simon Schampijer <simon@laptop.org> | 2013-03-14 11:00:22 (GMT) |
---|---|---|
committer | Ajay Garg <ajay@activitycentral.com> | 2013-03-22 14:09:22 (GMT) |
commit | 7d96644129aecb8c927063b0cdbc93db240c0e86 (patch) | |
tree | 9ce21e9e5d91097fb2f61b42f9a83c1077620b7a | |
parent | c604372047af85164833a6b754534ba42c3a6893 (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>
Signed-off-by: Ajay Garg <ajay@activitycentral.com>
-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 e192a7c..60c24ec 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() |