From 5beb8b777904fb96c470f9dd665eb16ce51c35e0 Mon Sep 17 00:00:00 2001 From: Matthew Allum Date: Mon, 30 Jun 2008 22:00:49 +0000 Subject: [PATCH] 2008-06-30 Matthew Allum Bug 1008 - tfp still a bit borked * clutter/x11/clutter-x11-texture-pixmap.c: Fix from Andy Wingo for sync_window borkage --- ChangeLog | 7 ++++++ clutter/x11/clutter-x11-texture-pixmap.c | 27 ++++++++++++------------ 2 files changed, 21 insertions(+), 13 deletions(-) diff --git a/ChangeLog b/ChangeLog index 1070fab15..13e47081d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2008-06-30 Matthew Allum + + Bug 1008 - tfp still a bit borked + + * clutter/x11/clutter-x11-texture-pixmap.c: + Fix from Andy Wingo for sync_window borkage + 2008-06-30 Neil Roberts Bug 985 - MSC math.h / M_PI issue diff --git a/clutter/x11/clutter-x11-texture-pixmap.c b/clutter/x11/clutter-x11-texture-pixmap.c index cee43c731..43e0fd9dc 100644 --- a/clutter/x11/clutter-x11-texture-pixmap.c +++ b/clutter/x11/clutter-x11-texture-pixmap.c @@ -1024,33 +1024,34 @@ void clutter_x11_texture_pixmap_sync_window (ClutterX11TexturePixmap *texture) { ClutterX11TexturePixmapPrivate *priv; - Pixmap pixmap; + Pixmap pixmap, prev_pixmap; g_return_if_fail (CLUTTER_X11_IS_TEXTURE_PIXMAP (texture)); priv = texture->priv; - /* we own the pixmap */ - if (priv->pixmap) + if (!clutter_x11_has_composite_extension()) { - pixmap = priv->pixmap; - /* This will cause an additional notify emission; suckiness. */ - clutter_x11_texture_pixmap_set_pixmap (texture, None); - XFreePixmap (clutter_x11_get_default_display (), pixmap); + clutter_x11_texture_pixmap_set_pixmap (texture, priv->window); + return; } + + /* we own the pixmap */ + prev_pixmap = priv->pixmap; - if (priv->window && clutter_x11_has_composite_extension()) + if (priv->window) { + Display *dpy = clutter_x11_get_default_display (); + clutter_x11_trap_x_errors (); - pixmap = XCompositeNameWindowPixmap (clutter_x11_get_default_display(), - priv->window); + pixmap = XCompositeNameWindowPixmap (dpy, priv->window); clutter_x11_untrap_x_errors (); clutter_x11_texture_pixmap_set_pixmap (texture, pixmap); - } - pixmap = priv->window; - clutter_x11_texture_pixmap_set_pixmap (texture, pixmap); + if (prev_pixmap) + XFreePixmap (dpy, prev_pixmap); + } } /**