mirror of
https://github.com/gryf/wmaker.git
synced 2025-12-23 22:52:34 +01:00
WindowMaker: New function get_pixmap_icon_from_user_icon
The new function get_pixmap_icon_from_user_icon() splits the function wIconUpdate().
This commit is contained in:
committed by
Carlos R. Mafra
parent
cf9f0ec67e
commit
72f359be44
30
src/icon.c
30
src/icon.c
@@ -58,6 +58,7 @@ static void miniwindowDblClick(WObjDescriptor * desc, XEvent * event);
|
|||||||
|
|
||||||
void get_pixmap_icon_from_icon_win(WIcon *icon);
|
void get_pixmap_icon_from_icon_win(WIcon *icon);
|
||||||
int get_pixmap_icon_from_wm_hints(WScreen *scr, WWindow *wwin, WIcon *icon);
|
int get_pixmap_icon_from_wm_hints(WScreen *scr, WWindow *wwin, WIcon *icon);
|
||||||
|
void get_pixmap_icon_from_user_icon(WScreen *scr, WIcon * icon);
|
||||||
/****** Notification Observers ******/
|
/****** Notification Observers ******/
|
||||||
|
|
||||||
static void appearanceObserver(void *self, WMNotification * notif)
|
static void appearanceObserver(void *self, WMNotification * notif)
|
||||||
@@ -562,10 +563,10 @@ void wIconUpdate(WIcon * icon)
|
|||||||
XFreePixmap(dpy, icon->pixmap);
|
XFreePixmap(dpy, icon->pixmap);
|
||||||
icon->pixmap = None;
|
icon->pixmap = None;
|
||||||
|
|
||||||
if (wwin && WFLAGP(wwin, always_user_icon))
|
if (wwin && WFLAGP(wwin, always_user_icon)) {
|
||||||
goto user_icon;
|
/* Forced use user_icon */
|
||||||
|
get_pixmap_icon_from_user_icon(scr, icon);
|
||||||
if (icon->icon_win != None) {
|
} else if (icon->icon_win != None) {
|
||||||
/* Get the Pixmap from the WIcon */
|
/* Get the Pixmap from the WIcon */
|
||||||
get_pixmap_icon_from_icon_win(icon);
|
get_pixmap_icon_from_icon_win(icon);
|
||||||
} else if (wwin && wwin->net_icon_image) {
|
} else if (wwin && wwin->net_icon_image) {
|
||||||
@@ -574,9 +575,20 @@ void wIconUpdate(WIcon * icon)
|
|||||||
icon->shadowed, icon->tile_type, icon->highlighted);
|
icon->shadowed, icon->tile_type, icon->highlighted);
|
||||||
} else if (wwin && wwin->wm_hints && (wwin->wm_hints->flags & IconPixmapHint)) {
|
} else if (wwin && wwin->wm_hints && (wwin->wm_hints->flags & IconPixmapHint)) {
|
||||||
if (get_pixmap_icon_from_wm_hints(scr, wwin, icon))
|
if (get_pixmap_icon_from_wm_hints(scr, wwin, icon))
|
||||||
goto user_icon;
|
get_pixmap_icon_from_user_icon(scr, icon);
|
||||||
} else {
|
} else {
|
||||||
user_icon:
|
get_pixmap_icon_from_user_icon(scr, icon);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (icon->pixmap != None)
|
||||||
|
XSetWindowBackgroundPixmap(dpy, icon->core->window, icon->pixmap);
|
||||||
|
|
||||||
|
XClearWindow(dpy, icon->core->window);
|
||||||
|
wIconPaint(icon);
|
||||||
|
}
|
||||||
|
|
||||||
|
void get_pixmap_icon_from_user_icon(WScreen *scr, WIcon * icon)
|
||||||
|
{
|
||||||
if (icon->file_image) {
|
if (icon->file_image) {
|
||||||
icon->pixmap = makeIcon(scr, icon->file_image, icon->show_title,
|
icon->pixmap = makeIcon(scr, icon->file_image, icon->show_title,
|
||||||
icon->shadowed, icon->tile_type, icon->highlighted);
|
icon->shadowed, icon->tile_type, icon->highlighted);
|
||||||
@@ -618,12 +630,6 @@ void wIconUpdate(WIcon * icon)
|
|||||||
icon->pixmap = None;
|
icon->pixmap = None;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (icon->pixmap != None)
|
|
||||||
XSetWindowBackgroundPixmap(dpy, icon->core->window, icon->pixmap);
|
|
||||||
|
|
||||||
XClearWindow(dpy, icon->core->window);
|
|
||||||
wIconPaint(icon);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Get the Pixmap from the WIcon of the WWindow */
|
/* Get the Pixmap from the WIcon of the WWindow */
|
||||||
void get_pixmap_icon_from_icon_win(WIcon * icon)
|
void get_pixmap_icon_from_icon_win(WIcon * icon)
|
||||||
|
|||||||
Reference in New Issue
Block a user