[vte] widget: Remove faux-transparency support



commit 0ea015d952803f380f62ca1eb5b72d8638f58e6c
Author: Christian Persch <chpe gnome org>
Date:   Thu Mar 27 15:26:35 2014 +0100

    widget: Remove faux-transparency support
    
    Remove snapshotting the X root window used to emulate transparency on
    non-composited WMs. There also goes the last explicit X dependency.

 configure.ac                   |   13 +---
 doc/reference/vte-sections.txt |    1 -
 src/vte-private.h              |    2 -
 src/vte.c                      |  188 +++-------------------------------------
 src/vteapp.c                   |   13 ++--
 src/vtebg.c                    |  188 +---------------------------------------
 src/vtebg.h                    |    1 -
 src/vtedeprecated.h            |    2 -
 8 files changed, 23 insertions(+), 385 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index 2644c2f..33c6665 100644
--- a/configure.ac
+++ b/configure.ac
@@ -280,18 +280,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 targets])
-GDK_TARGETS="$($PKG_CONFIG --variable targets gdk-$GTK_API_VERSION)"
-AC_MSG_RESULT([$GDK_TARGETS])
-PLATFORM_PKGS=
-for i in $GDK_TARGETS; do
-  if test "$i" = "x11"; then
-    PLATFORM_PKGS="$PLATFORM_PKGS x11 cairo-xlib"
-  fi
-done
-
-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/doc/reference/vte-sections.txt b/doc/reference/vte-sections.txt
index b0d6115..38c281a 100644
--- a/doc/reference/vte-sections.txt
+++ b/doc/reference/vte-sections.txt
@@ -121,7 +121,6 @@ vte_terminal_im_append_menuitems
 vte_terminal_set_background_image
 vte_terminal_set_background_image_file
 vte_terminal_set_background_saturation
-vte_terminal_set_background_transparent
 vte_terminal_set_scroll_background
 
 <SUBSECTION Private>
diff --git a/src/vte-private.h b/src/vte-private.h
index 71cac73..485230e 100644
--- a/src/vte-private.h
+++ b/src/vte-private.h
@@ -400,9 +400,7 @@ struct _VteTerminalPrivate {
         gchar *current_file_uri_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 bd9ff4e..dc1425c 100644
--- a/src/vte.c
+++ b/src/vte.c
@@ -156,7 +156,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,
@@ -2356,8 +2355,7 @@ _vte_terminal_set_color_foreground(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.
  */
 static void
 _vte_terminal_set_color_background(VteTerminal *terminal,
@@ -4495,44 +4493,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)
 {
@@ -8094,7 +8054,6 @@ 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;
 
         pvt->alternate_screen_scroll = TRUE;
 
@@ -8102,11 +8061,6 @@ vte_terminal_init(VteTerminal *terminal)
         * 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
@@ -8264,16 +8218,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)
@@ -8286,15 +8230,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);
@@ -8441,7 +8376,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;
@@ -8489,14 +8423,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);
 
@@ -10382,11 +10308,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,
@@ -10714,9 +10636,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;
@@ -10833,11 +10752,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:
-                        G_GNUC_BEGIN_IGNORE_DEPRECATIONS;
-                        vte_terminal_set_background_transparent (terminal, g_value_get_boolean (value));
-                        G_GNUC_END_IGNORE_DEPRECATIONS;
-                        break;
                 case PROP_BACKSPACE_BINDING:
                         vte_terminal_set_backspace_binding (terminal, g_value_get_enum (value));
                         break;
@@ -11606,11 +11520,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
          *
@@ -11628,12 +11542,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
@@ -11648,27 +11562,6 @@ vte_terminal_class_init(VteTerminalClass *klass)
                                      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
-         *
-         * Deprecated: 0.34.8
-         */
-        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:
          *
          * *Controls what string or control sequence the terminal sends to its child
@@ -12427,28 +12320,7 @@ vte_terminal_background_update(VteTerminal *terminal)
 
         _vte_draw_set_background_solid (terminal->pvt->draw, &color);
 
-       /* 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,
@@ -12504,10 +12376,10 @@ 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
+ * 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.
  *
  * Deprecated: 0.34.8
  */
@@ -12543,11 +12415,11 @@ 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
+ * 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.38
@@ -12577,42 +12449,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.
- *
- * Deprecated: 0.34.8
- */
-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 336bb6c..0695fb1 100644
--- a/src/vteapp.c
+++ b/src/vteapp.c
@@ -548,7 +548,8 @@ main(int argc, char **argv)
 #endif
                NULL};
        const char *background = NULL;
-       gboolean transparent = FALSE, audible = TRUE,
+        char *transparent = NULL;
+       gboolean audible = TRUE,
                 debug = FALSE, dingus = FALSE, dbuffer = TRUE,
                 console = FALSE, scroll = FALSE, keep = FALSE,
                 icon_title = FALSE, shell = TRUE, highlight_set = FALSE,
@@ -596,8 +597,8 @@ main(int argc, char **argv)
                },
                {
                        "transparent", 'T', 0,
-                       G_OPTION_ARG_NONE, &transparent,
-                       "Enable the use of a transparent background", NULL
+                       G_OPTION_ARG_STRING, &transparent,
+                       "Enable the use of a transparent background", "ALPHA"
                },
                {
                        "double-buffer", '2', G_OPTION_FLAG_REVERSE,
@@ -891,9 +892,9 @@ main(int argc, char **argv)
                vte_terminal_set_background_image_file(terminal,
                                                       background);
        }
-       if (transparent) {
-               vte_terminal_set_background_transparent(terminal,
-                                                       TRUE);
+       if (transparent != NULL) {
+                tint.alpha = g_ascii_strtod (transparent, NULL);
+                g_free (transparent);
                 vte_terminal_set_background_tint_color_rgba(terminal, &tint);
         }
         G_GNUC_END_IGNORE_DEPRECATIONS;
diff --git a/src/vtebg.c b/src/vtebg.c
index 0ce4269..240895a 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,25 +97,6 @@ vte_bg_get_for_screen(GdkScreen *screen)
                /* connect bg to screen */
                 pvt = bg->pvt;
                pvt->screen = screen;
-#ifdef GDK_WINDOWING_X11
-            if (GDK_IS_X11_DISPLAY(gdk_screen_get_display(screen)))
-            {
-                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;
@@ -277,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;
@@ -362,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;
@@ -420,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,
@@ -451,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);
@@ -472,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;
 
@@ -490,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 a9d37d1..8e2a705 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;
diff --git a/src/vtedeprecated.h b/src/vtedeprecated.h
index 621f3f7..9de0a40 100644
--- a/src/vtedeprecated.h
+++ b/src/vtedeprecated.h
@@ -39,8 +39,6 @@ void vte_terminal_set_background_image_file(VteTerminal *terminal,
                                            const char *path) G_GNUC_DEPRECATED;
 void vte_terminal_set_background_saturation(VteTerminal *terminal,
                                            double saturation) G_GNUC_DEPRECATED;
-void vte_terminal_set_background_transparent(VteTerminal *terminal,
-                                            gboolean transparent) G_GNUC_DEPRECATED;
 void vte_terminal_set_opacity(VteTerminal *terminal, guint16 opacity) G_GNUC_DEPRECATED;
 
 G_END_DECLS


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