summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOlivier Fourdan <fourdan@xfce.org>2015-01-24 21:29:26 +0100
committerOlivier Fourdan <fourdan@xfce.org>2015-01-24 21:29:26 +0100
commitb6f753b547e83c399e0c80921d3420b54f0f22a2 (patch)
tree42c32c737c401d259ca809ff8d5ecb51804d0e86
parentf0869d25e23436a91612c7885206d87a3c2e9cea (diff)
downloadxfwm4-b6f753b547e83c399e0c80921d3420b54f0f22a2.tar.gz
Switch back to bilinear interpolation
And apply saturation on iconified windows. Signed-off-by: Olivier Fourdan <fourdan@xfce.org>
-rw-r--r--src/icons.c31
-rw-r--r--src/mypixmap.c4
2 files changed, 22 insertions, 13 deletions
diff --git a/src/icons.c b/src/icons.c
index 64df23381..259ad71b5 100644
--- a/src/icons.c
+++ b/src/icons.c
@@ -91,7 +91,7 @@ inline_icon_at_size (const guint8 *data, int width, int height)
w = gdk_pixbuf_get_width (base);
h = gdk_pixbuf_get_height (base);
downsize_ratio (&w, &h, width, height);
- scaled = gdk_pixbuf_scale_simple (base, w, h, GDK_INTERP_NEAREST);
+ scaled = gdk_pixbuf_scale_simple (base, w, h, GDK_INTERP_BILINEAR);
g_object_unref (G_OBJECT (base));
@@ -508,7 +508,7 @@ scaled_from_pixdata (guchar * pixdata, int w, int h, int dest_w, int dest_h)
if (w != dest_w || h != dest_h)
{
downsize_ratio (&w, &h, dest_w, dest_h);
- dest = gdk_pixbuf_scale_simple (src, w, h, GDK_INTERP_NEAREST);
+ dest = gdk_pixbuf_scale_simple (src, w, h, GDK_INTERP_BILINEAR);
g_object_unref (G_OBJECT (src));
}
else
@@ -582,22 +582,31 @@ GdkPixbuf *
getClientIcon (Client *c, int width, int height)
{
ScreenInfo *screen_info;
- DisplayInfo *display_info;
+ GdkPixbuf *icon_pixbuf;
+ GdkPixbuf *icon_pixbuf_stated;
Pixmap pixmap;
g_return_val_if_fail (c != NULL, NULL);
screen_info = c->screen_info;
- display_info = screen_info->display_info;
- pixmap = compositorGetWindowPixmap (display_info, c->frame);
+ icon_pixbuf = NULL;
+ pixmap = compositorGetWindowPixmap (screen_info, c->frame);
if (pixmap != None)
{
- GdkPixbuf *icon = try_pixmap_and_mask (screen_info, pixmap, None, width, height);
- if (icon)
- {
- return icon;
- }
+ icon_pixbuf = try_pixmap_and_mask (screen_info, pixmap, None, width, height);
+ }
+ if (!icon_pixbuf)
+ {
+ icon_pixbuf = getAppIcon (screen_info, c->window, width, height);
+ }
+
+ if (FLAG_TEST (c->flags, CLIENT_FLAG_ICONIFIED))
+ {
+ icon_pixbuf_stated = gdk_pixbuf_copy (icon_pixbuf);
+ gdk_pixbuf_saturate_and_pixelate (icon_pixbuf, icon_pixbuf_stated, 0.55, TRUE);
+ g_object_unref (icon_pixbuf);
+ icon_pixbuf = icon_pixbuf_stated;
}
- return getAppIcon (screen_info, c->window, width, height);
+ return icon_pixbuf;
}
diff --git a/src/mypixmap.c b/src/mypixmap.c
index 97e670fba..0c516726f 100644
--- a/src/mypixmap.c
+++ b/src/mypixmap.c
@@ -784,7 +784,7 @@ xfwmPixmapCompose (GdkPixbuf *pixbuf, const gchar * dir, const gchar * file)
gdk_pixbuf_get_height (alpha));
gdk_pixbuf_composite (alpha, pixbuf, 0, 0, width, height,
- 0, 0, 1.0, 1.0, GDK_INTERP_NEAREST, 0xFF);
+ 0, 0, 1.0, 1.0, GDK_INTERP_BILINEAR, 0xFF);
g_object_unref (alpha);
@@ -921,7 +921,7 @@ xfwmPixmapRenderGdkPixbuf (xfwmPixmap * pm, GdkPixbuf *pixbuf)
src = gdk_pixbuf_get_from_drawable(NULL, GDK_DRAWABLE (destw), cmap,
dest_x, dest_y, 0, 0, width, height);
gdk_pixbuf_composite (pixbuf, src, 0, 0, width, height,
- 0, 0, 1.0, 1.0, GDK_INTERP_NEAREST, 0xFF);
+ 0, 0, 1.0, 1.0, GDK_INTERP_BILINEAR, 0xFF);
gdk_draw_pixbuf (GDK_DRAWABLE (destw), NULL, src, 0, 0, dest_x, dest_y,
width, height, GDK_RGB_DITHER_NONE, 0, 0);