Commit cb455f32 authored by Nalin Dahyabhai's avatar Nalin Dahyabhai

account for the foreign root pixmap not having a colormap by default,

* src/vtebg.c(_vte_bg_get_pixmap, _vte_bg_get_pixbuf): account for the foreign
	root pixmap not having a colormap by default, using the root window's
	colormap if it doesn't already have one set.
parent de0363de
2003-05-12 nalin
* src/vtebg.c(_vte_bg_get_pixmap, _vte_bg_get_pixbuf): account for the
foreign root pixmap not having a colormap by default, using the root
window's colormap if it doesn't already have one set.
2003-05-12 nalin
* src/iso2022.c(_vte_iso2022_state_new): if we can't convert from the
locale encoding to UTF-8, use UTF-8 as the locale encoding (#112614).
......
......@@ -529,9 +529,12 @@ vte_bg_get_pixmap(VteBg *bg,
if (GDK_IS_PIXMAP(bg->root_pixmap)) {
gdk_drawable_get_size(bg->root_pixmap, &width, &height);
rcolormap = gdk_drawable_get_colormap(gdk_get_default_root_window());
if (gdk_drawable_get_colormap(bg->root_pixmap) == NULL) {
gdk_drawable_set_colormap(bg->root_pixmap, rcolormap);
}
pixbuf = gdk_pixbuf_get_from_drawable(NULL,
bg->root_pixmap,
rcolormap,
NULL,
0, 0,
0, 0,
width, height);
......@@ -597,6 +600,7 @@ vte_bg_get_pixbuf(VteBg *bg,
struct VteBgCacheItem *item;
GObject *cached;
GdkPixbuf *pixbuf;
GdkColormap *rcolormap;
char *file;
if (bg == NULL) {
......@@ -628,13 +632,15 @@ vte_bg_get_pixbuf(VteBg *bg,
switch (source_type) {
case VTE_BG_SOURCE_ROOT:
if (GDK_IS_PIXMAP(bg->root_pixmap)) {
GdkColormap *colormap;
gint width, height;
gdk_drawable_get_size(bg->root_pixmap, &width, &height);
colormap = gdk_drawable_get_colormap(bg->root_pixmap);
rcolormap = gdk_drawable_get_colormap(gdk_get_default_root_window());
if (gdk_drawable_get_colormap(bg->root_pixmap) == NULL) {
gdk_drawable_set_colormap(bg->root_pixmap, rcolormap);
}
pixbuf = gdk_pixbuf_get_from_drawable(NULL,
bg->root_pixmap,
colormap,
NULL,
0, 0,
0, 0,
width, height);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment