[Sugar-devel] [PATCH sugar-toolkit] Tell GTK that Palettes are pop-ups

Sascha Silbe silbe at activitycentral.com
Sat Jun 11 13:01:34 EDT 2011


The Palettes are genuine client-managed pop-up windows. If we don't tell GTK
about that, it won't set the override-redirect flag so the window manager
will try to manage the window (placement, decorations, etc.) which naturally
interferes with our management of the window (pop-up / -down).

Signed-off-by: Sascha Silbe <silbe at activitycentral.com>
---

For some reason, this isn't a problem with metacity (maybe some kind of
compatibility heuristics?), just notion (the only other window manager I
tried). There's no observable change of behaviour with metacity, so it should
qualify as a bug fix.

 src/sugar/graphics/palettewindow.py |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/src/sugar/graphics/palettewindow.py b/src/sugar/graphics/palettewindow.py
index 5281e54..0d56f77 100644
--- a/src/sugar/graphics/palettewindow.py
+++ b/src/sugar/graphics/palettewindow.py
@@ -155,7 +155,9 @@ class PaletteWindow(gtk.Window):
         self._popdown_anim = animator.Animator(0.6, 10)
         self._popdown_anim.add(_PopdownAnimation(self))

-        gobject.GObject.__init__(self, **kwargs)
+        gtk.Window.__init__(self, type=gtk.WINDOW_POPUP)
+        for name, value in kwargs.items():
+            setattr(self.props, name, value)

         self.set_decorated(False)
         self.set_resizable(False)
--
1.7.2.5



More information about the Sugar-devel mailing list