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  9079b904d69e2112d63f1a6ca38eea647f394e23 (commit)
       via  f550333474cffb8ca210d12354b3abb2927f7b04 (commit)
      from  fe3cbb0dc4e10400ab58f9b0c5f844ae5c0d66ee (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/9079b904d69e2112d63f1a6ca38eea647f394e23

commit 9079b904d69e2112d63f1a6ca38eea647f394e23
Author: Rodolfo García Peñas (kix) <[email protected]>
Date:   Sun Mar 4 13:00:08 2012 +0100

    Little simplification in makeIcon()

diff --git a/src/icon.c b/src/icon.c
index be1b3a7..b5b9dbc 100644
--- a/src/icon.c
+++ b/src/icon.c
@@ -281,31 +281,29 @@ static Pixmap makeIcon(WScreen *scr, RImage *icon, int 
titled, int shadowed, int
        Pixmap pixmap;
        int x, y, sx, sy;
        unsigned w, h;
-       int theight = WMFontHeight(scr->icon_title_font);
+       int theight = 0;
 
-       if (tileType == TILE_NORMAL)
+       if (tileType == TILE_NORMAL) {
                tile = RCloneImage(scr->icon_tile);
-       else {
+       } else {
                assert(scr->clip_tile);
                tile = RCloneImage(scr->clip_tile);
        }
+
        if (icon) {
                w = (icon->width > wPreferences.icon_size)
                    ? wPreferences.icon_size : icon->width;
                x = (wPreferences.icon_size - w) / 2;
                sx = (icon->width - w) / 2;
 
-               if (!titled) {
-                       h = (icon->height > wPreferences.icon_size)
-                           ? wPreferences.icon_size : icon->height;
-                       y = (wPreferences.icon_size - h) / 2;
-                       sy = (icon->height - h) / 2;
-               } else {
-                       h = (icon->height + theight > wPreferences.icon_size
-                            ? wPreferences.icon_size - theight : icon->height);
-                       y = theight + ((int)wPreferences.icon_size - theight - 
h) / 2;
-                       sy = (icon->height - h) / 2;
-               }
+               if (titled)
+                       theight = WMFontHeight(scr->icon_title_font);
+
+               h = (icon->height + theight > wPreferences.icon_size
+                    ? wPreferences.icon_size - theight : icon->height);
+               y = theight + (wPreferences.icon_size - theight - h) / 2;
+               sy = (icon->height - h) / 2;
+
                RCombineArea(tile, icon, sx, sy, w, h, x, y);
        }
 
@@ -318,6 +316,7 @@ static Pixmap makeIcon(WScreen *scr, RImage *icon, int 
titled, int shadowed, int
                color.alpha = 150;      /* about 60% */
                RClearImage(tile, &color);
        }
+
        if (highlighted) {
                RColor color;
 
@@ -326,9 +325,9 @@ static Pixmap makeIcon(WScreen *scr, RImage *icon, int 
titled, int shadowed, int
                RLightImage(tile, &color);
        }
 
-       if (!RConvertImage(scr->rcontext, tile, &pixmap)) {
+       if (!RConvertImage(scr->rcontext, tile, &pixmap))
                wwarning(_("error rendering image:%s"), 
RMessageForError(RErrorCode));
-       }
+
        RReleaseImage(tile);
 
        if (titled)
@@ -611,11 +610,10 @@ void wIconUpdate(WIcon * icon)
                icon->pixmap = pixmap;
 
                if (XGetWindowAttributes(dpy, icon->icon_win, &attr)) {
-                       if (attr.all_event_masks & ButtonPressMask) {
+                       if (attr.all_event_masks & ButtonPressMask)
                                wHackedGrabButton(Button1, MOD_MASK, 
icon->core->window, True,
                                                  ButtonPressMask, 
GrabModeSync, GrabModeAsync,
                                                  None, wCursor[WCUR_ARROW]);
-                       }
                }
        } else if (wwin && wwin->net_icon_image) {
                /* Use _NET_WM_ICON icon */
@@ -677,13 +675,11 @@ void wIconUpdate(WIcon * icon)
                icon->pixmap = pixmap;
        } else {
  user_icon:
-
                if (icon->file_image) {
                        icon->pixmap = makeIcon(scr, icon->file_image, 
icon->show_title,
                                                icon->shadowed, 
icon->tile_type, icon->highlighted);
                } else {
                        /* make default icons */
-
                        if (!scr->def_icon_pixmap) {
                                RImage *image = NULL;
                                char *path;
@@ -698,10 +694,9 @@ void wIconUpdate(WIcon * icon)
                                        }
 
                                        image = RLoadImage(scr->rcontext, path, 
0);
-                                       if (!image) {
+                                       if (!image)
                                                wwarning(_("could not load 
default icon "%s":%s"),
                                                         file, 
RMessageForError(RErrorCode));
-                                       }
                                        wfree(path);
                                }
  make_icons:
@@ -713,19 +708,18 @@ void wIconUpdate(WIcon * icon)
                                        RReleaseImage(image);
                        }
 
-                       if (icon->show_title) {
+                       if (icon->show_title)
                                XSetWindowBackgroundPixmap(dpy, 
icon->core->window, scr->def_ticon_pixmap);
-                       } else {
+                       else
                                XSetWindowBackgroundPixmap(dpy, 
icon->core->window, scr->def_icon_pixmap);
-                       }
+
                        icon->pixmap = None;
                }
        }
-       if (icon->pixmap != None) {
+       if (icon->pixmap != None)
                XSetWindowBackgroundPixmap(dpy, icon->core->window, 
icon->pixmap);
-       }
-       XClearWindow(dpy, icon->core->window);
 
+       XClearWindow(dpy, icon->core->window);
        wIconPaint(icon);
 }
 

http://repo.or.cz/w/wmaker-crm.git/commit/f550333474cffb8ca210d12354b3abb2927f7b04

commit f550333474cffb8ca210d12354b3abb2927f7b04
Author: Rodolfo García Peñas (kix) <[email protected]>
Date:   Sun Mar 4 12:26:33 2012 +0100

    Coding style cleanup in wmspec.c
    
    This commit cleans the source a bit and adds some comments.

diff --git a/src/wmspec.c b/src/wmspec.c
index 1b4cf03..5bdc43c 100644
--- a/src/wmspec.c
+++ b/src/wmspec.c
@@ -404,18 +404,10 @@ static RImage *makeRImageFromARGBData(unsigned long *data)
 
        for (imgdata = image->data, i = 2; i < size + 2; i++, imgdata += 4) {
                pixel = data[i];
-#if 0//BYTE_ORDER == BIG_ENDIAN
-               imgdata[2] = (pixel >> 24) & 0xff;      /* A */
-               imgdata[1] = (pixel >> 16) & 0xff;      /* R */
-               imgdata[0] = (pixel >> 8) & 0xff;       /* G */
-               imgdata[3] = (pixel >> 0) & 0xff;       /* B */
-#else                          /* Little endian */
                imgdata[3] = (pixel >> 24) & 0xff;      /* A */
                imgdata[0] = (pixel >> 16) & 0xff;      /* R */
                imgdata[1] = (pixel >> 8) & 0xff;       /* G */
                imgdata[2] = (pixel >> 0) & 0xff;       /* B */
-#endif                         /* endianness */
-
        }
 
        return image;
@@ -428,34 +420,41 @@ static void updateIconImage(WWindow * wwin)
        Atom type;
        int format;
 
+       /* Refresh icon image from X11 */
        if (wwin->net_icon_image)
                RReleaseImage(wwin->net_icon_image);
+
        wwin->net_icon_image = NULL;
 
        if (XGetWindowProperty(dpy, wwin->client_win, net_wm_icon, 0L, LONG_MAX,
                               False, XA_CARDINAL, &type, &format, &items, 
&rest,
-                              (unsigned char **)&property) != Success || 
!property) {
+                              (unsigned char **)&property) != Success || 
!property)
                return;
-       }
 
        if (type != XA_CARDINAL || format != 32 || items < 2) {
                XFree(property);
                return;
        }
 
+       /* Find the best icon */
        data = findBestIcon(property, items);
        if (!data) {
                XFree(property);
                return;
        }
 
+       /* Save the best icon in the X11 icon */
        wwin->net_icon_image = makeRImageFromARGBData(data);
 
        XFree(property);
 
-       if (wwin->icon) wIconUpdate(wwin->icon);
+       /* Refresh the Window Icon */
+       if (wwin->icon)
+               wIconUpdate(wwin->icon);
+
+       /* Refresh the application icon */
        WApplication *app = wApplicationOf(wwin->main_window);
-       if (app && app->app_icon){
+       if (app && app->app_icon) {
                wIconUpdate(app->app_icon->icon);
                wAppIconPaint(app->app_icon);
        }

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

Summary of changes:
 src/icon.c   |   50 ++++++++++++++++++++++----------------------------
 src/wmspec.c |   23 +++++++++++------------
 2 files changed, 33 insertions(+), 40 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