[vte/vte-next: 47/47] Remove fake transparency support from VteBg



commit b140ceb365d23622054190c946062dee2a2ae008
Author: Christian Persch <chpe gnome org>
Date:   Tue May 3 02:03:25 2011 +0200

    Remove fake transparency support from VteBg
    
    There also goes the direct Gdk/X11 dependency.

 configure.in      |   11 +---
 src/vte-private.h |    2 -
 src/vte.c         |  188 ++++------------------------------------------------
 src/vteapp.c      |   11 +---
 src/vtebg.c       |  187 +---------------------------------------------------
 src/vtebg.h       |    1 -
 6 files changed, 20 insertions(+), 380 deletions(-)
---
diff --git a/configure.in b/configure.in
index e41dab0..a32a187 100644
--- a/configure.in
+++ b/configure.in
@@ -390,16 +390,7 @@ esac
 
 # Search for the required modules.
 
-# We have a direct dependency on X11 on gdk-x11, see bug #613525
-AC_MSG_CHECKING([for GDK target])
-GDK_TARGET="$($PKG_CONFIG --variable target gdk-$GTK_API_VERSION)"
-AC_MSG_RESULT([$GDK_TARGET])
-case "$GDK_TARGET" in
-  x11) PLATFORM_PKGS="x11 cairo-xlib" ;;
-  *) PLATFORM_PKGS="" ;;
-esac
-
-VTE_PKGS="glib-2.0 >= $GLIB_REQUIRED gobject-2.0 pango >= $PANGO_REQUIRED gtk+-$GTK_API_VERSION >= $GTK_REQUIRED gobject-2.0 gio-2.0 gio-unix-2.0 $PLATFORM_PKGS"
+VTE_PKGS="glib-2.0 >= $GLIB_REQUIRED gobject-2.0 pango >= $PANGO_REQUIRED gtk+-$GTK_API_VERSION >= $GTK_REQUIRED gobject-2.0 gio-2.0 gio-unix-2.0"
 PKG_CHECK_MODULES([VTE],[$VTE_PKGS])
 AC_SUBST([VTE_PKGS])
 
diff --git a/src/vte-private.h b/src/vte-private.h
index c4a92a0..d26aaaf 100644
--- a/src/vte-private.h
+++ b/src/vte-private.h
@@ -363,9 +363,7 @@ struct _VteTerminalPrivate {
 	gchar *icon_title_changed;
 
 	/* Background images/"transparency". */
-	guint root_pixmap_changed_tag;
 	gboolean bg_update_pending;
-	gboolean bg_transparent;
 	GdkPixbuf *bg_pixbuf;
 	char *bg_file;
         GdkRGBA bg_tint_color;
diff --git a/src/vte.c b/src/vte.c
index d589100..4451506 100644
--- a/src/vte.c
+++ b/src/vte.c
@@ -146,7 +146,6 @@ enum {
         PROP_BACKGROUND_IMAGE_PIXBUF,
         PROP_BACKGROUND_SATURATION,
         PROP_BACKGROUND_TINT_COLOR,
-        PROP_BACKGROUND_TRANSPARENT,
         PROP_BACKSPACE_BINDING,
         PROP_CURSOR_BLINK_MODE,
         PROP_CURSOR_SHAPE,
@@ -2473,8 +2472,7 @@ vte_terminal_set_color_foreground_rgba(VteTerminal *terminal,
  * @background: the new background color
  *
  * Sets the background color for text which does not have a specific background
- * color assigned.  Only has effect when no background image is set and when
- * the terminal is not transparent.
+ * color assigned.  Only has effect when no background image is set.
  *
  * Since: 0.28
  */
@@ -4212,44 +4210,6 @@ vte_terminal_im_preedit_changed(GtkIMContext *im_context, VteTerminal *terminal)
 	_vte_invalidate_cursor_once(terminal, FALSE);
 }
 
-/* Handle the toplevel being reconfigured. */
-static gboolean
-vte_terminal_configure_toplevel(VteTerminal *terminal)
-{
-	_vte_debug_print(VTE_DEBUG_EVENTS, "Top level parent configured.\n");
-
-	if (terminal->pvt->bg_transparent) {
-		/* We have to repaint the entire window, because we don't get
-		 * an expose event unless some portion of our visible area
-		 * moved out from behind another window. */
-		_vte_invalidate_all(terminal);
-	}
-
-	return FALSE;
-}
-
-/* Handle a hierarchy-changed signal. */
-static void
-vte_terminal_hierarchy_changed(GtkWidget *widget, GtkWidget *old_toplevel,
-			       gpointer data)
-{
-	GtkWidget *toplevel;
-
-	_vte_debug_print(VTE_DEBUG_EVENTS, "Hierarchy changed.\n");
-	if (old_toplevel != NULL) {
-		g_signal_handlers_disconnect_by_func(old_toplevel,
-						     vte_terminal_configure_toplevel,
-						     widget);
-	}
-
-	toplevel = gtk_widget_get_toplevel(widget);
-	if (toplevel != NULL) {
-		g_signal_connect_swapped (toplevel, "configure-event",
-				 G_CALLBACK (vte_terminal_configure_toplevel),
-				 widget);
-	}
-}
-
 static void
 vte_terminal_set_inner_border(VteTerminal *terminal)
 {
@@ -7629,17 +7589,11 @@ vte_terminal_init(VteTerminal *terminal)
 	pvt->bg_saturation = 0.4;
 	pvt->selection_block_mode = FALSE;
 	pvt->has_fonts = FALSE;
-	pvt->root_pixmap_changed_tag = 0;
 
 	/* Not all backends generate GdkVisibilityNotify, so mark the
 	 * window as unobscured initially. */
 	pvt->visibility_state = GDK_VISIBILITY_UNOBSCURED;
 
-	/* Listen for hierarchy change notifications. */
-	g_signal_connect(terminal, "hierarchy-changed",
-			 G_CALLBACK(vte_terminal_hierarchy_changed),
-			 NULL);
-
         pvt->inner_border = default_inner_border;
 
 #ifdef VTE_DEBUG
@@ -7796,16 +7750,6 @@ vte_terminal_size_allocate(GtkWidget *widget, GtkAllocation *allocation)
 	}
 }
 
-/* Queue a background update. */
-static void
-root_pixmap_changed_cb(VteBg *bg, VteTerminal *terminal)
-{
-	_vte_debug_print (VTE_DEBUG_EVENTS, "Root pixmap changed.\n");
-	if (terminal->pvt->bg_transparent) {
-		vte_terminal_queue_background_update(terminal);
-	}
-}
-
 /* The window is being destroyed. */
 static void
 vte_terminal_unrealize(GtkWidget *widget)
@@ -7818,15 +7762,6 @@ vte_terminal_unrealize(GtkWidget *widget)
 	terminal = VTE_TERMINAL (widget);
 	window = gtk_widget_get_window (widget);
 
-	/* Disconnect from background-change events. */
-	if (terminal->pvt->root_pixmap_changed_tag != 0) {
-		VteBg       *bg;
-		bg = vte_bg_get_for_screen(gtk_widget_get_screen(widget));
-		g_signal_handler_disconnect (bg,
-				terminal->pvt->root_pixmap_changed_tag);
-		terminal->pvt->root_pixmap_changed_tag = 0;
-	}
-
 	/* Deallocate the cursors. */
 	terminal->pvt->mouse_cursor_visible = FALSE;
 	gdk_cursor_unref(terminal->pvt->mouse_default_cursor);
@@ -7973,7 +7908,6 @@ vte_terminal_finalize(GObject *object)
 {
     	GtkWidget *widget = GTK_WIDGET (object);
     	VteTerminal *terminal = VTE_TERMINAL (object);
-	GtkWidget *toplevel;
 	GtkClipboard *clipboard;
         GtkSettings *settings;
 	struct vte_match_regex *regex;
@@ -8021,14 +7955,6 @@ vte_terminal_finalize(GObject *object)
 	if (terminal->pvt->search_attrs)
 		g_array_free (terminal->pvt->search_attrs, TRUE);
 
-	/* Disconnect from toplevel window configure events. */
-	toplevel = gtk_widget_get_toplevel(&terminal->widget);
-	if ((toplevel != NULL) && (G_OBJECT(toplevel) != object)) {
-		g_signal_handlers_disconnect_by_func(toplevel,
-						     vte_terminal_configure_toplevel,
-						     terminal);
-	}
-
 	/* Disconnect from autoscroll requests. */
 	vte_terminal_stop_autoscroll(terminal);
 
@@ -10275,11 +10201,7 @@ vte_terminal_paint(GtkWidget *widget, cairo_region_t *region)
 
 	/* Designate the start of the drawing operation and clear the area. */
 	_vte_draw_start(terminal->pvt->draw);
-	if (terminal->pvt->bg_transparent) {
-		int x, y;
-		gdk_window_get_origin (gtk_widget_get_window (widget), &x, &y);
-		_vte_draw_set_background_scroll(terminal->pvt->draw, x, y);
-	} else {
+        {
 		if (terminal->pvt->scroll_background) {
 			_vte_draw_set_background_scroll(terminal->pvt->draw,
 							0,
@@ -10599,9 +10521,6 @@ vte_terminal_get_property (GObject *object,
                 case PROP_BACKGROUND_TINT_COLOR:
                         g_value_set_boxed (value, &pvt->bg_tint_color);
                         break;
-                case PROP_BACKGROUND_TRANSPARENT:
-                        g_value_set_boolean (value, pvt->bg_transparent);
-                        break;
                 case PROP_BACKSPACE_BINDING:
                         g_value_set_enum (value, pvt->backspace_binding);
                         break;
@@ -10703,9 +10622,6 @@ vte_terminal_set_property (GObject *object,
                 case PROP_BACKGROUND_TINT_COLOR:
                         vte_terminal_set_background_tint_color_rgba (terminal, g_value_get_boxed (value));
                         break;
-                case PROP_BACKGROUND_TRANSPARENT:
-                        vte_terminal_set_background_transparent (terminal, g_value_get_boolean (value));
-                        break;
                 case PROP_BACKSPACE_BINDING:
                         vte_terminal_set_backspace_binding (terminal, g_value_get_enum (value));
                         break;
@@ -11429,11 +11345,11 @@ vte_terminal_class_init(VteTerminalClass *klass)
          * VteTerminal:background-saturation:
          *
          * If a background image has been set using #VteTerminal:background-image-file: or
-         * #VteTerminal:background-image-pixbuf:, or #VteTerminal:background-transparent:,
+         * #VteTerminal:background-image-pixbuf:,
          * and the saturation value is less
          * than 1.0, the terminal will adjust the colors of the image before drawing
          * the image.  To do so, the terminal will create a copy of the background
-         * image (or snapshot of the root window) and modify its pixel values.
+         * image and modify its pixel values.
          *
          * Since: 0.20
          */
@@ -11449,12 +11365,12 @@ vte_terminal_class_init(VteTerminalClass *klass)
          * VteTerminal:background-tint-color:
          *
          * If a background image has been set using #VteTerminal:background-image-file: or
-         * #VteTerminal:background-image-pixbuf:, or #VteTerminal:background-transparent:, and
+         * #VteTerminal:background-image-pixbuf:, and
          * and the value set by VteTerminal:background-saturation: is less than 1.0,
          * the terminal
          * will adjust the color of the image before drawing the image.  To do so,
-         * the terminal will create a copy of the background image (or snapshot of
-         * the root window) and modify its pixel values.  The initial tint color
+         * the terminal will create a copy of the background image
+         * and modify its pixel values.  The initial tint color
          * is black.
          * 
          * Since: 0.20
@@ -11465,26 +11381,7 @@ vte_terminal_class_init(VteTerminalClass *klass)
                  g_param_spec_boxed ("background-tint-color", NULL, NULL,
                                      GDK_TYPE_RGBA,
                                      G_PARAM_READWRITE | STATIC_PARAMS));
-     
-        /**
-         * VteTerminal:background-transparent:
-         *
-         * Sets whther the terminal uses the pixmap stored in the root
-         * window as the background, adjusted so that if there are no windows
-         * below your application, the widget will appear to be transparent.
-         *
-         * Note: When using a compositing window manager, you should instead
-         * set a RGBA colourmap on the toplevel window, so you get real transparency.
-         *
-         * Since: 0.20
-         */
-        g_object_class_install_property
-                (gobject_class,
-                 PROP_BACKGROUND_TRANSPARENT,
-                 g_param_spec_boolean ("background-transparent", NULL, NULL,
-                                       FALSE,
-                                       G_PARAM_READWRITE | STATIC_PARAMS));
-     
+
         /**
          * VteTerminal:backspace-binding:
          *
@@ -12141,28 +12038,7 @@ vte_terminal_background_update(VteTerminal *terminal)
         rgba.alpha *= terminal->pvt->bg_tint_color.alpha;
         _vte_draw_set_background_solid (terminal->pvt->draw, &rgba);
 
-	/* If we're transparent, and either have no root image or are being
-	 * told to update it, get a new copy of the root window. */
 	saturation = terminal->pvt->bg_saturation;
-	if (terminal->pvt->bg_transparent) {
-		if (terminal->pvt->root_pixmap_changed_tag == 0) {
-			VteBg *bg;
-
-			/* Connect to background-change events. */
-			bg = vte_bg_get_for_screen (gtk_widget_get_screen (&terminal->widget));
-			terminal->pvt->root_pixmap_changed_tag =
-				g_signal_connect(bg, "root-pixmap-changed",
-					G_CALLBACK(root_pixmap_changed_cb),
-					terminal);
-		}
-
-		_vte_draw_set_background_image(terminal->pvt->draw,
-					       VTE_BG_SOURCE_ROOT,
-					       NULL,
-					       NULL,
-					       &terminal->pvt->bg_tint_color,
-					       saturation);
-	} else
 	if (terminal->pvt->bg_file) {
 		_vte_draw_set_background_image(terminal->pvt->draw,
 					       VTE_BG_SOURCE_FILE,
@@ -12217,11 +12093,11 @@ vte_terminal_queue_background_update(VteTerminal *terminal)
  *
  * If a background image has been set using
  * vte_terminal_set_background_image(),
- * vte_terminal_set_background_image_file(), or
- * vte_terminal_set_background_transparent(), and the saturation value is less
+ * vte_terminal_set_background_image_file(),
+ * and the saturation value is less
  * than 1.0, the terminal will adjust the colors of the image before drawing
  * the image.  To do so, the terminal will create a copy of the background
- * image (or snapshot of the root window) and modify its pixel values.
+ * image and modify its pixel values.
  */
 void
 vte_terminal_set_background_saturation(VteTerminal *terminal, double saturation)
@@ -12254,12 +12130,12 @@ vte_terminal_set_background_saturation(VteTerminal *terminal, double saturation)
  *
  * If a background image has been set using
  * vte_terminal_set_background_image(),
- * vte_terminal_set_background_image_file(), or
- * vte_terminal_set_background_transparent(), and the value set by
+ * vte_terminal_set_background_image_file(),
+ * and the value set by
  * vte_terminal_set_background_saturation() is less than one, the terminal
  * will adjust the color of the image before drawing the image.  To do so,
- * the terminal will create a copy of the background image (or snapshot of
- * the root window) and modify its pixel values.  The initial tint color
+ * the terminal will create a copy of the background image
+ * and modify its pixel values.  The initial tint color
  * is black.
  *
  * Since: 0.30
@@ -12289,40 +12165,6 @@ vte_terminal_set_background_tint_color_rgba(VteTerminal *terminal,
 }
 
 /**
- * vte_terminal_set_background_transparent:
- * @terminal: a #VteTerminal
- * @transparent: whether the terminal should fake transparency
- *
- * Sets the terminal's background image to the pixmap stored in the root
- * window, adjusted so that if there are no windows below your application,
- * the widget will appear to be transparent.
- */
-void
-vte_terminal_set_background_transparent(VteTerminal *terminal,
-					gboolean transparent)
-{
-        VteTerminalPrivate *pvt;
-
-	g_return_if_fail(VTE_IS_TERMINAL(terminal));
-
-        pvt = terminal->pvt;
-
-        transparent = transparent != FALSE;
-        if (transparent == pvt->bg_transparent)
-                return;
-
-	_vte_debug_print(VTE_DEBUG_MISC,
-		"Turning background transparency %s.\n",
-			transparent ? "on" : "off");
-		
-	pvt->bg_transparent = transparent;
-        g_object_notify(G_OBJECT (terminal), "background-transparent");
-
-        /* Update the background. */
-        vte_terminal_queue_background_update(terminal);
-}
-
-/**
  * vte_terminal_set_background_image:
  * @terminal: a #VteTerminal
  * @image: (allow-none): a #GdkPixbuf to use, or %NULL to unset the background
diff --git a/src/vteapp.c b/src/vteapp.c
index ece81c1..470a154 100644
--- a/src/vteapp.c
+++ b/src/vteapp.c
@@ -548,7 +548,7 @@ main(int argc, char **argv)
 #endif
 		NULL};
 	const char *background = NULL;
-	gboolean transparent = FALSE, audible = TRUE,
+	gboolean audible = TRUE,
 		 debug = FALSE, dingus = FALSE, dbuffer = TRUE,
 		 console = FALSE, scroll = FALSE, keep = FALSE,
 		 icon_title = FALSE, shell = TRUE, highlight_set = FALSE,
@@ -590,11 +590,6 @@ main(int argc, char **argv)
 			"Disable spawning a shell inside the terminal", NULL
 		},
 		{
-			"transparent", 'T', 0,
-			G_OPTION_ARG_NONE, &transparent,
-			"Enable the use of a transparent background", NULL
-		},
-		{
 			"double-buffer", '2', G_OPTION_FLAG_REVERSE,
 			G_OPTION_ARG_NONE, &dbuffer,
 			"Disable double-buffering", NULL
@@ -884,10 +879,6 @@ main(int argc, char **argv)
 		vte_terminal_set_background_image_file(terminal,
 						       background);
 	}
-	if (transparent) {
-		vte_terminal_set_background_transparent(terminal,
-							TRUE);
-	}
 	vte_terminal_set_background_tint_color_rgba(terminal, &tint);
 	vte_terminal_set_colors_rgba(terminal, &fore, &back, NULL, 0);
 	if (highlight_set) {
diff --git a/src/vtebg.c b/src/vtebg.c
index c53febd..49fb5ab 100644
--- a/src/vtebg.c
+++ b/src/vtebg.c
@@ -25,26 +25,11 @@
 #include "marshal.h"
 #include "vtebg.h"
 
-#ifdef GDK_WINDOWING_X11
-#include <gdk/gdkx.h>
-#include <cairo-xlib.h>
-#endif
-
 G_DEFINE_TYPE(VteBg, vte_bg, G_TYPE_OBJECT)
 
 struct _VteBgPrivate {
 	GList *cache;
 	GdkScreen *screen;
-#ifdef GDK_WINDOWING_X11
-	cairo_surface_t *root_surface;
-        struct {
-                GdkDisplay *display;
-                GdkWindow *window;
-                XID native_window;
-                GdkAtom atom;
-                Atom native_atom;
-        } native;
-#endif
 };
 
 typedef struct {
@@ -58,120 +43,8 @@ typedef struct {
 } VteBgCacheItem;
 
 static void vte_bg_cache_item_free(VteBgCacheItem *item);
-static void vte_bg_cache_prune_int(VteBg *bg, gboolean root);
 static const cairo_user_data_key_t item_surface_key;
 
-#ifdef GDK_WINDOWING_X11
-
-static void
-_vte_bg_display_sync(VteBg *bg)
-{
-        VteBgPrivate *pvt = bg->pvt;
-
-	gdk_display_sync(pvt->native.display);
-}
-
-static gboolean
-_vte_property_get_pixmaps(GdkWindow *window, GdkAtom atom,
-			  GdkAtom *type, int *size,
-			  XID **pixmaps)
-{
-	return gdk_property_get(window, atom, GDK_TARGET_PIXMAP,
-				0, INT_MAX - 3,
-				FALSE,
-				type, NULL, size,
-				(guchar**) pixmaps);
-}
-
-static cairo_surface_t *
-vte_bg_root_surface(VteBg *bg)
-{
-        VteBgPrivate *pvt = bg->pvt;
-	GdkAtom prop_type;
-	int prop_size;
-	Window root;
-	XID *pixmaps;
-	int x, y;
-	unsigned int width, height, border_width, depth;
-	cairo_surface_t *surface = NULL;
-	Display *display;
-	Screen *screen;
-
-	pixmaps = NULL;
-	gdk_error_trap_push();
-	if (!_vte_property_get_pixmaps(pvt->native.window, pvt->native.atom,
-                                       &prop_type, &prop_size,
-                                       &pixmaps))
-		goto out;
-
-	if ((prop_type != GDK_TARGET_PIXMAP) ||
-	    (prop_size < (int)sizeof(XID) ||
-	     (pixmaps == NULL)))
-		goto out_pixmaps;
-		
-	if (!XGetGeometry (GDK_DISPLAY_XDISPLAY (pvt->native.display),
-			   pixmaps[0], &root,
-			   &x, &y, &width, &height, &border_width, &depth))
-		goto out_pixmaps;
-
-	display = gdk_x11_display_get_xdisplay (pvt->native.display);
-	screen = gdk_x11_screen_get_xscreen (pvt->screen);
-	surface = cairo_xlib_surface_create (display,
-					     pixmaps[0],
-					     DefaultVisualOfScreen(screen),
-					     width, height);
-
-        _vte_debug_print(VTE_DEBUG_BG|VTE_DEBUG_EVENTS,
-                         "VteBg new background image %dx%d\n", width, height);
-
- out_pixmaps:
-	g_free(pixmaps);
- out:
-	_vte_bg_display_sync(bg);
-	gdk_error_trap_pop_ignored ();
-
-	return surface;
-}
-
-static void
-vte_bg_set_root_surface(VteBg *bg, cairo_surface_t *surface)
-{
-        VteBgPrivate *pvt = bg->pvt;
-
-	if (pvt->root_surface != NULL) {
-		cairo_surface_destroy (pvt->root_surface);
-	}
-	pvt->root_surface = surface;
-	vte_bg_cache_prune_int (bg, TRUE);
-	g_signal_emit_by_name(bg, "root-pixmap-changed");
-}
-
-static GdkFilterReturn
-vte_bg_root_filter(GdkXEvent *native, GdkEvent *event, gpointer data)
-{
-	XEvent *xevent = (XEvent*) native;
-	VteBg *bg;
-        VteBgPrivate *pvt;
-	cairo_surface_t *surface;
-
-	switch (xevent->type) {
-	case PropertyNotify:
-		bg = VTE_BG(data);
-                pvt = bg->pvt;
-		if ((xevent->xproperty.window == pvt->native.native_window) &&
-		    (xevent->xproperty.atom == pvt->native.native_atom)) {
-			surface = vte_bg_root_surface(bg);
-			vte_bg_set_root_surface(bg, surface);
-		}
-		break;
-	default:
-		break;
-	}
-	return GDK_FILTER_CONTINUE;
-}
-
-#endif /* GDK_WINDOWING_X11 */
-
 static void
 vte_bg_finalize (GObject *obj)
 {
@@ -191,14 +64,6 @@ vte_bg_class_init(VteBgClass *klass)
 
 	gobject_class->finalize = vte_bg_finalize;
 
-	g_signal_new("root-pixmap-changed",
-                     G_OBJECT_CLASS_TYPE(klass),
-                     G_SIGNAL_RUN_LAST,
-                     0,
-                     NULL,
-                     NULL,
-                     g_cclosure_marshal_VOID__VOID,
-                     G_TYPE_NONE, 0);
 	g_type_class_add_private(klass, sizeof (VteBgPrivate));
 }
 
@@ -232,24 +97,6 @@ vte_bg_get_for_screen(GdkScreen *screen)
 		/* connect bg to screen */
                 pvt = bg->pvt;
 		pvt->screen = screen;
-#ifdef GDK_WINDOWING_X11
-            {
-                GdkEventMask events;
-                GdkWindow   *window;
-
-		window = gdk_screen_get_root_window(screen);
-                pvt->native.window = window;
-                pvt->native.native_window = GDK_WINDOW_XID (window);
-                pvt->native.display = gdk_window_get_display(window);
-                pvt->native.native_atom = gdk_x11_get_xatom_by_name_for_display(pvt->native.display, "_XROOTPMAP_ID");
-                pvt->native.atom = gdk_x11_xatom_to_atom_for_display(pvt->native.display, pvt->native.native_atom);
-		pvt->root_surface = vte_bg_root_surface(bg);
-		events = gdk_window_get_events(window);
-		events |= GDK_PROPERTY_CHANGE_MASK;
-		gdk_window_set_events(window, events);
-		gdk_window_add_filter(window, vte_bg_root_filter, bg);
-            }
-#endif /* GDK_WINDOWING_X11 */
 	}
 
 	return bg;
@@ -276,29 +123,21 @@ vte_bg_cache_item_free(VteBgCacheItem *item)
 }
 
 static void
-vte_bg_cache_prune_int(VteBg *bg, gboolean root)
+vte_bg_cache_prune(VteBg *bg)
 {
 	GList *i, *next;
 	for (i = bg->pvt->cache; i != NULL; i = next) {
 		VteBgCacheItem *item = i->data;
 		next = g_list_next (i);
-		/* Prune the item if either it is a "root pixmap" item and
-		 * we want to prune them, or its surface is NULL because
+		/* Prune the item if its surface is NULL because
 		 * whichever object it created has been destroyed. */
-		if ((root && (item->source_type == VTE_BG_SOURCE_ROOT)) ||
-		    item->surface == NULL) {
+		if (item->surface == NULL) {
 			vte_bg_cache_item_free (item);
 			bg->pvt->cache = g_list_delete_link(bg->pvt->cache, i);
 		}
 	}
 }
 
-static void
-vte_bg_cache_prune(VteBg *bg)
-{
-	vte_bg_cache_prune_int(bg, FALSE);
-}
-
 static void item_surface_destroy_func(void *data)
 {
 	VteBgCacheItem *item = data;
@@ -361,8 +200,6 @@ vte_bg_cache_search(VteBg *bg,
 		    (saturation == item->saturation) &&
 		    (source_type == item->source_type)) {
 			switch (source_type) {
-			case VTE_BG_SOURCE_ROOT:
-				break;
 			case VTE_BG_SOURCE_PIXBUF:
 				if (item->source_pixbuf != source_pixbuf) {
 					continue;
@@ -419,11 +256,6 @@ vte_bg_get_surface(VteBg *bg,
 	if (source_type == VTE_BG_SOURCE_NONE) {
 		return NULL;
 	}
-#ifndef GDK_WINDOWING_X11
-        if (source_type == VTE_BG_SOURCE_ROOT) {
-                return NULL;
-        }
-#endif
 
 	cached = vte_bg_cache_search(bg, source_type,
 				     source_pixbuf, source_file,
@@ -450,8 +282,6 @@ vte_bg_get_surface(VteBg *bg,
 	pixbuf = NULL;
 
 	switch (source_type) {
-	case VTE_BG_SOURCE_ROOT:
-		break;
 	case VTE_BG_SOURCE_PIXBUF:
 		item->source_pixbuf = g_object_ref (source_pixbuf);
 		pixbuf = g_object_ref (source_pixbuf);
@@ -471,13 +301,6 @@ vte_bg_get_surface(VteBg *bg,
 		width = gdk_pixbuf_get_width(pixbuf);
 		height = gdk_pixbuf_get_height(pixbuf);
 	}
-#ifdef GDK_WINDOWING_X11
-        else if (source_type == VTE_BG_SOURCE_ROOT &&
-                 pvt->root_surface != NULL) {
-		width = cairo_xlib_surface_get_width(pvt->root_surface);
-		height = cairo_xlib_surface_get_height(pvt->root_surface);
-	}
-#endif
         else
                 goto out;
 
@@ -489,10 +312,6 @@ vte_bg_get_surface(VteBg *bg,
 	cairo_set_operator (cr, CAIRO_OPERATOR_SOURCE);
 	if (pixbuf)
 		gdk_cairo_set_source_pixbuf (cr, pixbuf, 0, 0);
-#ifdef GDK_WINDOWING_X11
-	else if (source_type == VTE_BG_SOURCE_ROOT)
-		cairo_set_source_surface (cr, pvt->root_surface, 0, 0);
-#endif
 	cairo_paint (cr);
 
         alpha = (1. - saturation) * tint->alpha;
diff --git a/src/vtebg.h b/src/vtebg.h
index 700f892..5b4a9b9 100644
--- a/src/vtebg.h
+++ b/src/vtebg.h
@@ -51,7 +51,6 @@ VteBg *vte_bg_get_for_screen(GdkScreen *screen);
 
 typedef enum {
 	VTE_BG_SOURCE_NONE,
-	VTE_BG_SOURCE_ROOT,
 	VTE_BG_SOURCE_PIXBUF,
 	VTE_BG_SOURCE_FILE
 } VteBgSourceType;



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]