From: Rodolfo García Peñas (kix) Date: Sat, 3 Nov 2012 18:54:00 +0000 (+0100) Subject: Make get_wwindow_image_from_x11() take Window as argument X-Git-Tag: wmaker-0.95.4~65 X-Git-Url: https://repo.or.cz/w/wmaker-crm.git/commitdiff_plain/19326554cc18f6b5effd59caabf7ae824ed0e699 Make get_wwindow_image_from_x11() take Window as argument The function get_wwindow_image_from_x11() is renamed to get_window_image_from_x11() and does the same work, but now its argument is a Window struct instead of a WWindow. This change is better because it allows objects with Windows (but without WWindows) to call this function. The function now is not static to allow its use in other parts of the code. --- 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