From: "Rodolfo García Peñas (kix)" <[email protected]>
The function get_wwindow_image_from_x11() is now get_window_image_from_x11()
and do the same work, but now the argument is a Window struct, not a WWindow.
This change is better, because allow to objects with Windows, but without
WWindows, call this function.
The function now is not static, to allow use it in other parts of the code.
---
src/wmspec.c | 6 +++---
src/wmspec.h | 1 +
2 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/src/wmspec.c b/src/wmspec.c
index 6bd51ce..b3dfb8b 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 63d1eff..5bb26f0 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
--
1.7.10.4
--
To unsubscribe, send mail to [email protected].