[gnome-flashback] common: remove gf_bg_get_surface_from_root



commit 7b6273a6e786081b24e4b0a8f111ef5962b229e3
Author: Alberts Muktupāvels <alberts muktupavels gmail com>
Date:   Sat Mar 20 18:27:54 2021 +0200

    common: remove gf_bg_get_surface_from_root

 gnome-flashback/libcommon/gf-bg.c | 89 ---------------------------------------
 gnome-flashback/libcommon/gf-bg.h |  2 -
 2 files changed, 91 deletions(-)
---
diff --git a/gnome-flashback/libcommon/gf-bg.c b/gnome-flashback/libcommon/gf-bg.c
index 68230bc..14d0410 100644
--- a/gnome-flashback/libcommon/gf-bg.c
+++ b/gnome-flashback/libcommon/gf-bg.c
@@ -1065,95 +1065,6 @@ make_root_pixmap (GdkScreen *screen, gint width, gint height)
        return surface;
 }
 
-cairo_surface_t *
-gf_bg_get_surface_from_root (GdkScreen *screen)
-{
-       int result;
-       gint format;
-       gulong nitems;
-       gulong bytes_after;
-       gpointer data;
-       Atom type;
-       Display *display;
-       int screen_num;
-       cairo_surface_t *surface;
-       cairo_surface_t *source_pixmap;
-       int width, height;
-       cairo_t *cr;
-
-       display = GDK_DISPLAY_XDISPLAY (gdk_screen_get_display (screen));
-       screen_num = gdk_screen_get_number (screen);
-
-       result = XGetWindowProperty (display,
-                                    RootWindow (display, screen_num),
-                                    gdk_x11_get_xatom_by_name ("_XROOTPMAP_ID"),
-                                    0L, 1L, False, XA_PIXMAP,
-                                    &type, &format, &nitems, &bytes_after,
-                                    (guchar **) &data);
-       surface = NULL;
-       source_pixmap = NULL;
-
-       if (result != Success || type != XA_PIXMAP ||
-           format != 32 || nitems != 1) {
-               XFree (data);
-               data = NULL;
-       }
-
-       if (data != NULL) {
-                Pixmap xpixmap = *(Pixmap *) data;
-                Window root_return;
-                int x_ret, y_ret;
-                unsigned int w_ret, h_ret, bw_ret, depth_ret;
-
-               gdk_error_trap_push ();
-                if (XGetGeometry (GDK_SCREEN_XDISPLAY (screen),
-                                  xpixmap,
-                                  &root_return,
-                                  &x_ret, &y_ret, &w_ret, &h_ret, &bw_ret, &depth_ret)) {
-                        source_pixmap = cairo_xlib_surface_create (GDK_SCREEN_XDISPLAY (screen),
-                                                                   xpixmap,
-                                                                   GDK_VISUAL_XVISUAL 
(gdk_screen_get_system_visual (screen)),
-                                                                   w_ret, h_ret);
-                }
-
-                gdk_error_trap_pop_ignored ();
-       }
-
-       width = gdk_screen_get_width (screen);
-       height = gdk_screen_get_height (screen);
-
-        if (source_pixmap) {
-                surface = cairo_surface_create_similar (source_pixmap,
-                                                        CAIRO_CONTENT_COLOR,
-                                                        width, height);
-
-                cr = cairo_create (surface);
-                cairo_set_source_surface (cr, source_pixmap, 0, 0);
-                cairo_paint (cr);
-
-                if (cairo_status (cr) != CAIRO_STATUS_SUCCESS) {
-                        cairo_surface_destroy (surface);
-                        surface = NULL;
-                }
-
-                cairo_destroy (cr);
-        }
-
-        if (surface == NULL) {
-               surface = gdk_window_create_similar_surface (gdk_screen_get_root_window (screen),
-                                                             CAIRO_CONTENT_COLOR,
-                                                             width, height);
-        }
-
-       if (source_pixmap != NULL)
-               cairo_surface_destroy (source_pixmap);
-
-       if (data != NULL)
-               XFree (data);
-
-       return surface;
-}
-
 static void
 gf_bg_set_root_pixmap_id (GdkScreen       *screen,
                           cairo_surface_t *surface)
diff --git a/gnome-flashback/libcommon/gf-bg.h b/gnome-flashback/libcommon/gf-bg.h
index b7e40b8..d02cf17 100644
--- a/gnome-flashback/libcommon/gf-bg.h
+++ b/gnome-flashback/libcommon/gf-bg.h
@@ -54,8 +54,6 @@ cairo_surface_t *gf_bg_create_surface           (GfBG                  *bg,
 void             gf_bg_set_surface_as_root      (GdkScreen             *screen,
                                                 cairo_surface_t       *surface);
 
-cairo_surface_t *gf_bg_get_surface_from_root (GdkScreen *screen);
-
 GdkRGBA *gf_bg_get_average_color_from_surface (cairo_surface_t *surface);
 
 G_END_DECLS


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