[Xfce4-commits] [xfce/xfwm4] 02/02: Save the picture, not the pixmap

noreply at xfce.org noreply at xfce.org
Tue Feb 10 23:21:37 CET 2015


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

olivier pushed a commit to branch master
in repository xfce/xfwm4.

commit f4cfcf61f351e23a6e52136e97aefe06bee87e4f
Author: Olivier Fourdan <fourdan at xfce.org>
Date:   Tue Feb 10 23:20:10 2015 +0100

    Save the picture, not the pixmap
    
    This also works without named window pixmap.
    
    Signed-off-by: Olivier Fourdan <fourdan at xfce.org>
---
 src/compositor.c |   27 +++------------------------
 src/icons.c      |    7 +++++--
 2 files changed, 8 insertions(+), 26 deletions(-)

diff --git a/src/compositor.c b/src/compositor.c
index 5843709..eeda61f 100644
--- a/src/compositor.c
+++ b/src/compositor.c
@@ -129,8 +129,6 @@ struct _CWindow
     Damage damage;
 #if HAVE_NAME_WINDOW_PIXMAP
     Pixmap name_window_pixmap;
-    /* Save a copy for use when the window is unmapped */
-    Pixmap saved_window_pixmap;
 #endif /* HAVE_NAME_WINDOW_PIXMAP */
     Picture picture;
     Picture saved_picture;
@@ -741,22 +739,9 @@ free_win_data (CWindow *cw, gboolean delete)
     display_info = screen_info->display_info;
 
 #if HAVE_NAME_WINDOW_PIXMAP
-    if (cw->saved_window_pixmap)
-    {
-        XFreePixmap (display_info->dpy, cw->saved_window_pixmap);
-        cw->saved_window_pixmap = None;
-    }
-
     if (cw->name_window_pixmap)
     {
-        if (delete)
-        {
-            XFreePixmap (display_info->dpy, cw->name_window_pixmap);
-        }
-        else
-        {
-            cw->saved_window_pixmap = cw->name_window_pixmap;
-        }
+        XFreePixmap (display_info->dpy, cw->name_window_pixmap);
         cw->name_window_pixmap = None;
     }
 #endif
@@ -2219,7 +2204,6 @@ add_win (DisplayInfo *display_info, Window id, Client *c)
     }
 #if HAVE_NAME_WINDOW_PIXMAP
     new->name_window_pixmap = None;
-    new->saved_window_pixmap = None;
 #endif
     new->picture = None;
     new->saved_picture = None;
@@ -2342,11 +2326,6 @@ resize_win (CWindow *cw, gint x, gint y, gint width, gint height, gint bw)
             XFreePixmap (display_info->dpy, cw->name_window_pixmap);
             cw->name_window_pixmap = None;
         }
-        if (cw->saved_window_pixmap)
-        {
-            XFreePixmap (display_info->dpy, cw->saved_window_pixmap);
-            cw->saved_window_pixmap = None;
-        }
 #endif
         if (cw->picture)
         {
@@ -3056,7 +3035,7 @@ compositorScaleWindowPixmap (CWindow *cw, guint *width, guint *height)
     int tx, ty, src_size, dest_size;
     unsigned int src_w, src_h;
     unsigned int dst_w, dst_h;
-    XRenderColor c = { 0xffff, 0xffff, 0xffff, 0xffff };
+    XRenderColor c = { 0x7fff, 0x7fff, 0x7fff, 0xffff };
 
     screen_info = cw->screen_info;
     dpy = myScreenGetXDisplay (screen_info);
@@ -3124,7 +3103,7 @@ compositorScaleWindowPixmap (CWindow *cw, guint *width, guint *height)
     tmpPicture = XRenderCreatePicture (dpy, tmpPixmap, render_format, 0, NULL);
     XRenderFillRectangle (dpy, PictOpSrc, tmpPicture, &c, 0, 0, src_w, src_h);
     XFixesSetPictureClipRegion (dpy, tmpPicture, 0, 0, None);
-    XRenderComposite (dpy, PictOpOver, srcPicture, None, tmpPicture,
+    XRenderComposite (dpy, PictOpSrc, srcPicture, None, tmpPicture,
                       0, 0, 0, 0, 0, 0, src_w, src_h);
 
     XRenderSetPictureFilter (dpy, tmpPicture, FilterBest, NULL, 0);
diff --git a/src/icons.c b/src/icons.c
index 1066f1e..9250043 100644
--- a/src/icons.c
+++ b/src/icons.c
@@ -423,8 +423,11 @@ get_pixbuf_from_pixmap (GdkScreen *gscreen, Pixmap xpixmap, guint src_x, guint s
     }
 
     cmap = get_cmap (drawable, gscreen);
-    retval = gdk_pixbuf_get_from_drawable (NULL, drawable, cmap, src_x, src_y,
-                                           dest_x, dest_y, width, height);
+    retval = gdk_pixbuf_new (GDK_COLORSPACE_RGB, FALSE, 8, width, height);
+    gdk_pixbuf_fill (retval, 0xFF);
+
+    gdk_pixbuf_get_from_drawable (retval, drawable, cmap, src_x, src_y,
+                                  dest_x, dest_y, width, height);
 
     if (G_LIKELY(cmap))
     {

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


More information about the Xfce4-commits mailing list