mirror of
https://github.com/gryf/wmaker.git
synced 2026-04-18 22:33:32 +02: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);
|
||||
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 ******/
|
||||
|
||||
static void appearanceObserver(void *self, WMNotification * notif)
|
||||
@@ -562,10 +563,10 @@ void wIconUpdate(WIcon * icon)
|
||||
XFreePixmap(dpy, icon->pixmap);
|
||||
icon->pixmap = None;
|
||||
|
||||
if (wwin && WFLAGP(wwin, always_user_icon))
|
||||
goto user_icon;
|
||||
|
||||
if (icon->icon_win != None) {
|
||||
if (wwin && WFLAGP(wwin, always_user_icon)) {
|
||||
/* Forced use user_icon */
|
||||
get_pixmap_icon_from_user_icon(scr, icon);
|
||||
} else if (icon->icon_win != None) {
|
||||
/* Get the Pixmap from the WIcon */
|
||||
get_pixmap_icon_from_icon_win(icon);
|
||||
} else if (wwin && wwin->net_icon_image) {
|
||||
@@ -574,9 +575,20 @@ void wIconUpdate(WIcon * icon)
|
||||
icon->shadowed, icon->tile_type, icon->highlighted);
|
||||
} else if (wwin && wwin->wm_hints && (wwin->wm_hints->flags & IconPixmapHint)) {
|
||||
if (get_pixmap_icon_from_wm_hints(scr, wwin, icon))
|
||||
goto user_icon;
|
||||
get_pixmap_icon_from_user_icon(scr, icon);
|
||||
} 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) {
|
||||
icon->pixmap = makeIcon(scr, icon->file_image, icon->show_title,
|
||||
icon->shadowed, icon->tile_type, icon->highlighted);
|
||||
@@ -618,12 +630,6 @@ void wIconUpdate(WIcon * icon)
|
||||
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 */
|
||||
void get_pixmap_icon_from_icon_win(WIcon * icon)
|
||||
|
||||
Reference in New Issue
Block a user