diff --git a/src/wmspec.c b/src/wmspec.c index 6bd51ceb..b3dfb8b6 100644 --- a/src/wmspec.c +++ b/src/wmspec.c @@ -420,7 +420,7 @@ static RImage *makeRImageFromARGBData(unsigned long *data) return image; } -static RImage *get_wwindow_image_from_x11(WWindow *wwin) +RImage *get_window_image_from_x11(Window window) { RImage *image; Atom type; @@ -429,7 +429,7 @@ static RImage *get_wwindow_image_from_x11(WWindow *wwin) unsigned long *property, *data; /* Get the icon from X11 Window */ - if (XGetWindowProperty(dpy, wwin->client_win, net_wm_icon, 0L, LONG_MAX, + if (XGetWindowProperty(dpy, window, net_wm_icon, 0L, LONG_MAX, False, XA_CARDINAL, &type, &format, &items, &rest, (unsigned char **)&property) != Success || !property) return NULL; @@ -464,7 +464,7 @@ static void updateIconImage(WWindow *wwin) RReleaseImage(wwin->net_icon_image); /* Save the icon in the X11 icon */ - wwin->net_icon_image = get_wwindow_image_from_x11(wwin); + wwin->net_icon_image = get_window_image_from_x11(wwin->client_win); /* Refresh the Window Icon */ if (wwin->icon) diff --git a/src/wmspec.h b/src/wmspec.h index 63d1eff7..5bb26f0f 100644 --- a/src/wmspec.h +++ b/src/wmspec.h @@ -45,4 +45,5 @@ char *wNETWMGetIconName(Window window); char *wNETWMGetWindowName(Window window); void wNETFrameExtents(WWindow *wwin); void wNETCleanupFrameExtents(WWindow *wwin); +RImage *get_window_image_from_x11(Window window); #endif