This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project wmaker-crm.git.

The branch, next has been updated
       via  6cbdebb84b90d273eb4f3538508c2df2ab9f825f (commit)
      from  9079b904d69e2112d63f1a6ca38eea647f394e23 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://repo.or.cz/w/wmaker-crm.git/commit/6cbdebb84b90d273eb4f3538508c2df2ab9f825f

commit 6cbdebb84b90d273eb4f3538508c2df2ab9f825f
Author: Rodolfo García Peñas (kix) <[email protected]>
Date:   Sun Mar 4 12:45:34 2012 +0100

    WindowMaker: New get_wwindow_image_from_x11 function
    
    A new function is created to get the image from the X11 window.
    
    The function updateIconImage is splitted in two blocks, one is moved
    to get_wwindow_image_from_x11 with the X11 code, and other is used
    to update the Application and Window icons (kept in the same function).

diff --git a/src/wmspec.c b/src/wmspec.c
index 5bdc43c..9456841 100644
--- a/src/wmspec.c
+++ b/src/wmspec.c
@@ -413,40 +413,47 @@ static RImage *makeRImageFromARGBData(unsigned long *data)
        return image;
 }
 
-static void updateIconImage(WWindow * wwin)
+static RImage *get_wwindow_image_from_x11(WWindow *wwin)
 {
-       unsigned long *property, *data;
-       unsigned long items, rest;
+       RImage *image;
        Atom type;
        int format;
+       unsigned long items, rest;
+       unsigned long *property, *data;
 
-       /* Refresh icon image from X11 */
-       if (wwin->net_icon_image)
-               RReleaseImage(wwin->net_icon_image);
-
-       wwin->net_icon_image = NULL;
-
+       /* Get the icon from X11 Window */
        if (XGetWindowProperty(dpy, wwin->client_win, net_wm_icon, 0L, LONG_MAX,
                               False, XA_CARDINAL, &type, &format, &items, 
&rest,
                               (unsigned char **)&property) != Success || 
!property)
-               return;
+               return NULL;
 
        if (type != XA_CARDINAL || format != 32 || items < 2) {
                XFree(property);
-               return;
+               return NULL;
        }
 
        /* Find the best icon */
        data = findBestIcon(property, items);
        if (!data) {
                XFree(property);
-               return;
+               return NULL;
        }
 
        /* Save the best icon in the X11 icon */
-       wwin->net_icon_image = makeRImageFromARGBData(data);
+       image = makeRImageFromARGBData(data);
 
        XFree(property);
+       return image;
+}
+
+static void updateIconImage(WWindow *wwin)
+{
+       /* Remove the icon image from X11 */
+       if (wwin->net_icon_image)
+               RReleaseImage(wwin->net_icon_image);
+
+       /* Save the icon in the X11 icon */
+       wwin->net_icon_image = get_wwindow_image_from_x11(wwin);
 
        /* Refresh the Window Icon */
        if (wwin->icon)

-----------------------------------------------------------------------

Summary of changes:
 src/wmspec.c |   33 ++++++++++++++++++++-------------
 1 files changed, 20 insertions(+), 13 deletions(-)


repo.or.cz automatic notification. Contact project admin [email protected]
if you want to unsubscribe, or site admin [email protected] if you receive
no reply.
-- 
wmaker-crm.git ("The Window Maker window manager")


-- 
To unsubscribe, send mail to [email protected].

Reply via email to