From 3e83e9d5ae307dae664ce4142ff80cb7d0b39ce7 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Rodolfo=20Garc=C3=ADa=20Pe=C3=B1as=20=28kix=29?= Date: Sat, 3 Nov 2012 19:53:59 +0100 Subject: [PATCH] New functions get_*_icon_from_x11 A new functions get_pixmap_icon_from_x11 and get_rimage_icon_from_x11 are included in icon.h 1. get_pixmap_icon_from_x11, set the rimage at icon->file_image The code sets net_icon_image in icon->file_image 2. The get_rimage_icon_from_x11 function, only converts the icon->file_image in icon->pixmap --- src/icon.c | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/src/icon.c b/src/icon.c index 3e46f04a..b02fce05 100644 --- a/src/icon.c +++ b/src/icon.c @@ -67,6 +67,8 @@ static void get_pixmap_icon_from_user_icon(WIcon *icon); static void get_rimage_icon_from_user_icon(WIcon *icon); static void get_pixmap_icon_from_default_icon(WIcon *icon); static void get_rimage_icon_from_default_icon(WIcon *icon); +static void get_pixmap_icon_from_x11(WIcon *icon); +static void get_rimage_icon_from_x11(WIcon *icon); static void icon_update_pixmap(WIcon *icon, RImage *image); static void unset_icon_image(WIcon *icon); @@ -611,7 +613,7 @@ void wIconUpdate(WIcon *icon) get_pixmap_icon_from_icon_win(icon); } else if (wwin && wwin->net_icon_image) { /* Use _NET_WM_ICON icon */ - icon_update_pixmap(icon, wwin->net_icon_image); + get_pixmap_icon_from_x11(icon); } else if (wwin && wwin->wm_hints && (wwin->wm_hints->flags & IconPixmapHint)) { /* Get the Pixmap from the wm_hints, else, from the user */ if (get_pixmap_icon_from_wm_hints(icon)) @@ -630,6 +632,25 @@ void wIconUpdate(WIcon *icon) wIconPaint(icon); } +static void get_pixmap_icon_from_x11(WIcon *icon) +{ + /* Set the icon->file_image */ + get_rimage_icon_from_x11(icon); + + /* Update icon->pixmap */ + icon_update_pixmap(icon, icon->file_image); +} + +static void get_rimage_icon_from_x11(WIcon *icon) +{ + /* Remove the icon image */ + unset_icon_image(icon); + + /* Set the new icon image */ + icon->file = NULL; + icon->file_image = RRetainImage(icon->owner->net_icon_image); +} + static void get_rimage_icon_from_user_icon(WIcon *icon) { if (icon->file_image) -- 2.11.4.GIT