mirror of
https://github.com/gryf/wmaker.git
synced 2025-12-24 15:12:32 +01:00
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
This commit is contained in:
committed by
Carlos R. Mafra
parent
ceedad4231
commit
3e83e9d5ae
23
src/icon.c
23
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)
|
||||
|
||||
Reference in New Issue
Block a user