From: "Rodolfo García Peñas (kix)" <[email protected]>
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 6332afe..14c287f 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)
--
1.7.10.4
--
To unsubscribe, send mail to [email protected].