summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBehdad Esfahbod <behdad@gnome.org>2009-03-09 10:20:54 +0000
committerBehdad Esfahbod <behdad@src.gnome.org>2009-03-09 10:20:54 +0000
commit73ba06532e7a061176230ea25296b99fd97c14c1 (patch)
tree3e7add3c1afeb2429d89b48d4a869f504cfdd8b7
parent43a9b809e5cf9ccf1a685a7a0ccc0761ff206690 (diff)
downloadvte-73ba06532e7a061176230ea25296b99fd97c14c1.tar.gz
Bug 574616 – "real" transparency not working from python bindings
2009-03-09 Behdad Esfahbod <behdad@gnome.org> Bug 574616 – "real" transparency not working from python bindings * src/vtepangocairo.c (_vte_pangocairo_destroy), (_vte_pangocairo_set_background_image): Better handle failure of creating pixmap. * src/vtebg.c (vte_bg_get_pixmap): Get rid of unused mask parameter. svn path=/trunk/; revision=2379
-rw-r--r--ChangeLog10
-rw-r--r--src/vtebg.c7
-rw-r--r--src/vtepangocairo.c46
3 files changed, 32 insertions, 31 deletions
diff --git a/ChangeLog b/ChangeLog
index f554c983..06d329a7 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2009-03-09 Behdad Esfahbod <behdad@gnome.org>
+
+ Bug 574616 – "real" transparency not working from python bindings
+
+ * src/vtepangocairo.c (_vte_pangocairo_destroy),
+ (_vte_pangocairo_set_background_image): Better handle failure of
+ creating pixmap.
+
+ * src/vtebg.c (vte_bg_get_pixmap): Get rid of unused mask parameter.
+
2009-03-07 Behdad Esfahbod <behdad@gnome.org>
Bug 574025 – Crash in _vte_terminal_insert_char
diff --git a/src/vtebg.c b/src/vtebg.c
index 8f0645d4..07e8821a 100644
--- a/src/vtebg.c
+++ b/src/vtebg.c
@@ -555,7 +555,6 @@ vte_bg_get_pixmap(VteBg *bg,
gpointer cached;
GdkColormap *rcolormap;
GdkPixmap *pixmap;
- GdkBitmap *mask;
GdkPixbuf *pixbuf;
char *file;
@@ -652,7 +651,6 @@ vte_bg_get_pixmap(VteBg *bg,
}
pixmap = NULL;
- mask = NULL;
if (GDK_IS_PIXBUF(pixbuf)) {
/* If the image is smaller than 256x256 then tile it into a
* pixbuf that is at least this large. This is done because
@@ -661,11 +659,8 @@ vte_bg_get_pixmap(VteBg *bg,
pixbuf = _vte_bg_resize_pixbuf(pixbuf, 256, 256);
gdk_pixbuf_render_pixmap_and_mask_for_colormap(pixbuf,
colormap,
- &pixmap, &mask,
+ &pixmap, NULL,
0);
- if (mask != NULL) {
- g_object_unref(mask);
- }
g_object_unref(pixbuf);
}
diff --git a/src/vtepangocairo.c b/src/vtepangocairo.c
index 9bed66b2..465eebc5 100644
--- a/src/vtepangocairo.c
+++ b/src/vtepangocairo.c
@@ -817,6 +817,7 @@ _vte_pangocairo_destroy (struct _vte_draw *draw)
}
g_slice_free (struct _vte_pangocairo_data, draw->impl_data);
+ draw->impl_data = NULL;
}
static void
@@ -864,43 +865,38 @@ _vte_pangocairo_set_background_image (struct _vte_draw *draw,
{
struct _vte_pangocairo_data *data = draw->impl_data;
GdkPixmap *pixmap;
-
- if (type == VTE_BG_SOURCE_NONE)
- return;
-
- if (data->bg_pattern) {
- cairo_pattern_destroy (data->bg_pattern);
- data->bg_pattern = NULL;
- }
+ cairo_pattern_t *old_pattern;
+ cairo_surface_t *surface;
+ cairo_t *cr;
pixmap = vte_bg_get_pixmap (vte_bg_get_for_screen (gtk_widget_get_screen (draw->widget)),
type, pixbuf, file,
color, saturation,
_vte_draw_get_colormap(draw, TRUE));
- if (pixmap) {
+ if (!pixmap)
+ return;
- /* Ugh... We need to create a dummy cairo_t */
- cairo_surface_t *surface;
- cairo_t *cr;
+ if (data->bg_pattern)
+ cairo_pattern_destroy (data->bg_pattern);
- surface = cairo_image_surface_create (CAIRO_FORMAT_ARGB32, 0, 0);
- cr = cairo_create (surface);
+ /* Ugh... We need to create a dummy cairo_t */
+ surface = cairo_image_surface_create (CAIRO_FORMAT_ARGB32, 0, 0);
+ cr = cairo_create (surface);
- gdk_cairo_set_source_pixmap (cr, pixmap, 0, 0);
- data->bg_pattern = cairo_pattern_reference (cairo_get_source (cr));
+ gdk_cairo_set_source_pixmap (cr, pixmap, 0, 0);
+ data->bg_pattern = cairo_pattern_reference (cairo_get_source (cr));
- cairo_destroy (cr);
- cairo_surface_destroy (surface);
+ cairo_destroy (cr);
+ cairo_surface_destroy (surface);
- /* Transfer the pixmap ownership to the pattern */
- cairo_pattern_set_user_data (data->bg_pattern,
- (cairo_user_data_key_t *) data,
- pixmap,
- (cairo_destroy_func_t) g_object_unref);
+ /* Transfer the pixmap ownership to the pattern */
+ cairo_pattern_set_user_data (data->bg_pattern,
+ (cairo_user_data_key_t *) data,
+ pixmap,
+ (cairo_destroy_func_t) g_object_unref);
- cairo_pattern_set_extend (data->bg_pattern, CAIRO_EXTEND_REPEAT);
- }
+ cairo_pattern_set_extend (data->bg_pattern, CAIRO_EXTEND_REPEAT);
}
static void