[Xfce4-commits] [xfce/xfce4-session] 02/30: xfsm-fadeout: Migrate away from GdkPixmap

noreply at xfce.org noreply at xfce.org
Sun May 15 18:03:21 CEST 2016


This is an automated email from the git hooks/post-receive script.

eric pushed a commit to branch master
in repository xfce/xfce4-session.

commit 5c63bc0bc56db587af43a6ab2c86b0b3b6f8171a
Author: Eric Koegel <eric.koegel at gmail.com>
Date:   Mon Mar 21 09:34:06 2016 +0300

    xfsm-fadeout: Migrate away from GdkPixmap
    
    Since it will be deprecated in GTK3.
---
 xfce4-session/xfsm-fadeout.c | 34 ++++++++++++++++------------------
 1 file changed, 16 insertions(+), 18 deletions(-)

diff --git a/xfce4-session/xfsm-fadeout.c b/xfce4-session/xfsm-fadeout.c
index 10c60d6..a3a0f01 100644
--- a/xfce4-session/xfsm-fadeout.c
+++ b/xfce4-session/xfsm-fadeout.c
@@ -39,19 +39,19 @@ struct _XfsmFadeout
 XfsmFadeout*
 xfsm_fadeout_new (GdkDisplay *display)
 {
-  GdkWindowAttr  attr;
-  XfsmFadeout   *fadeout;
-  GdkWindow     *root;
-  GdkCursor     *cursor;
-  cairo_t       *cr;
-  gint           width;
-  gint           height;
-  gint           n;
-  GdkPixbuf     *root_pixbuf;
-  GdkPixmap     *backbuf;
-  GdkScreen     *gdk_screen;
-  GdkWindow     *window;
-  GdkColor       black = { 0, };
+  GdkWindowAttr    attr;
+  XfsmFadeout     *fadeout;
+  GdkWindow       *root;
+  GdkCursor       *cursor;
+  cairo_t         *cr;
+  gint             width;
+  gint             height;
+  gint             n;
+  GdkPixbuf       *root_pixbuf;
+  cairo_surface_t *surface;
+  GdkScreen       *gdk_screen;
+  GdkWindow       *window;
+  GdkColor         black = { 0, };
 
   fadeout = g_slice_new0 (XfsmFadeout);
 
@@ -89,8 +89,8 @@ xfsm_fadeout_new (GdkDisplay *display)
       else
         {
           /* create background for window */
-          backbuf = gdk_pixmap_new (GDK_DRAWABLE (root), width, height, -1);
-          cr = gdk_cairo_create (GDK_DRAWABLE (backbuf));
+          surface = gdk_window_create_similar_surface (root, CAIRO_CONTENT_COLOR_ALPHA, width, height);
+          cr = cairo_create (surface);
 
           /* make of copy of the root window */
           root_pixbuf = gdk_pixbuf_get_from_drawable (NULL, GDK_DRAWABLE (root), NULL,
@@ -103,9 +103,7 @@ xfsm_fadeout_new (GdkDisplay *display)
           gdk_cairo_set_source_color (cr, &black);
           cairo_paint_with_alpha (cr, 0.50);
           cairo_destroy (cr);
-
-          gdk_window_set_back_pixmap (window, backbuf, FALSE);
-          g_object_unref (G_OBJECT (backbuf));
+          cairo_surface_destroy (surface);
         }
 
       fadeout->windows = g_slist_prepend (fadeout->windows, window);

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Xfce4-commits mailing list