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  2eb1107e20f889ef88f0055b8544b950dd5024a5 (commit)
       via  d8b92c979e16c527fbb1c1f0631eeca9aa8ad042 (commit)
       via  78ff715d39432e44fd57ce91c940ceeaa6b76a23 (commit)
       via  5956d71d77fcb76273c6eccaab2347276c04fbcd (commit)
       via  ead0fb2e4bf14eadf22b23987fd41bc60c6635b1 (commit)
       via  7746fe7c5a46a58eb5a2e5393487de8213bb0a42 (commit)
      from  5dcd31acbe94959656e4d971c0f4b462a0bfb7c7 (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/2eb1107e20f889ef88f0055b8544b950dd5024a5

commit 2eb1107e20f889ef88f0055b8544b950dd5024a5
Author: Rodolfo García Peñas (kix) <[email protected]>
Date:   Wed Nov 14 22:11:49 2012 +0100

    wIconUpdate removed scr variable
    
    The variable scr is not used, so MUST be removed.
    
    This variable can cause a segfault because icon could not exist.

diff --git a/src/icon.c b/src/icon.c
index 1ed90bd..6a0e817 100644
--- a/src/icon.c
+++ b/src/icon.c
@@ -601,11 +601,8 @@ static void unset_icon_image(WIcon *icon)
 
 void wIconUpdate(WIcon *icon)
 {
-       WScreen *scr = icon->core->screen_ptr;
        WWindow *wwin = icon->owner;
 
-       assert(scr->icon_tile != NULL);
-
        if (wwin && WFLAGP(wwin, always_user_icon)) {
                /* Forced use user_icon */
                get_rimage_icon_from_user_icon(icon);

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

commit d8b92c979e16c527fbb1c1f0631eeca9aa8ad042
Author: Rodolfo García Peñas (kix) <[email protected]>
Date:   Wed Nov 14 19:00:22 2012 +0100

    get_default_image resize image
    
    The function get_default_image, used to read the default image, now
    resizes it to the desired size.

diff --git a/src/wdefaults.c b/src/wdefaults.c
index a613a31..0e7d6cd 100644
--- a/src/wdefaults.c
+++ b/src/wdefaults.c
@@ -466,6 +466,10 @@ RImage *get_default_image(WScreen *scr)
        if (!image)
                wwarning(_("could not find default icon "%s""), path);
 
+       /* Resize the icon to the wPreferences.icon_size size
+        * usually this function will return early, because size is right */
+       image = wIconValidateIconSize(image, wPreferences.icon_size);
+
        return image;
 }
 

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

commit 78ff715d39432e44fd57ce91c940ceeaa6b76a23
Author: Rodolfo García Peñas (kix) <[email protected]>
Date:   Wed Nov 14 19:26:12 2012 +0100

    wIconValidateIconSize checks the width and height
    
    The function wIconValidateIconSize checks if the width size and height size 
are
    less than the preference size (and left space for the border). If the width
    size or height size is greater than the preference, then checks what is the
    bigger size of them. Then resize it using the bigger value and holding the
    aspect ratio.
    
    Before this patch, wIconValidateIconSize didn't check if height was bigger
    than width and always suppose that width was greater than height.

diff --git a/src/icon.c b/src/icon.c
index 166c827..1ed90bd 100644
--- a/src/icon.c
+++ b/src/icon.c
@@ -359,10 +359,14 @@ RImage *wIconValidateIconSize(RImage *icon, int max_size)
                return NULL;
 
        /* We should hold "ICON_BORDER" (~2) pixels to include the icon border 
*/
-       if ((icon->width - max_size) > -ICON_BORDER ||
-           (icon->height - max_size) > -ICON_BORDER) {
-               nimage = RScaleImage(icon, max_size - ICON_BORDER,
-                                    (icon->height * (max_size - ICON_BORDER) / 
icon->width));
+       if (((max_size + ICON_BORDER) < icon->width) ||
+           ((max_size + ICON_BORDER) < icon->height)) {
+               if (icon->width > icon->height)
+                       nimage = RScaleImage(icon, max_size - ICON_BORDER,
+                                            (icon->height * (max_size - 
ICON_BORDER) / icon->width));
+               else
+                       nimage = RScaleImage(icon, (icon->width * (max_size - 
ICON_BORDER) / icon->height),
+                                            max_size - ICON_BORDER);
                RReleaseImage(icon);
                icon = nimage;
        }

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

commit 5956d71d77fcb76273c6eccaab2347276c04fbcd
Author: Rodolfo García Peñas (kix) <[email protected]>
Date:   Wed Nov 14 18:36:25 2012 +0100

    get_wwindow_image_from_wmhints scale image
    
    The function get_wwindow_image_from_wmhints returns a image from WM Hints,
    but the image could be larger than the desired.
    
    Then, the image can be resized using wIconValidateIconSize(). The resize
    should be done in get_rimage_icon_from_wm_hints(), not in the function
    get_wwindow_image_from_wmhints(). This is because the function
    get_wwindow_image_from_wmhints() is used in wIconStore() too. If we resize
    the image before save it to disk, then if we change the icon/dock size, then
    the image saved will have a different size than the curren icon size. Is
    better resize the image when is painted in the screen, not the image saved.

diff --git a/src/icon.c b/src/icon.c
index 5a18148..166c827 100644
--- a/src/icon.c
+++ b/src/icon.c
@@ -756,6 +756,9 @@ static int get_rimage_icon_from_wm_hints(WIcon *icon)
        if (!image)
                return 1;
 
+       /* Resize the icon to the wPreferences.icon_size size */
+       image = wIconValidateIconSize(image, wPreferences.icon_size);
+
        unset_icon_image(icon);
        icon->file_image = image;
 

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

commit ead0fb2e4bf14eadf22b23987fd41bc60c6635b1
Author: Rodolfo García Peñas (kix) <[email protected]>
Date:   Wed Nov 14 20:06:14 2012 +0100

    Remove dup set icon file to NULL
    
    Remove the icon->file = NULL because was set in unset_icon_image().

diff --git a/src/icon.c b/src/icon.c
index 04767d8..5a18148 100644
--- a/src/icon.c
+++ b/src/icon.c
@@ -656,7 +656,6 @@ static void get_rimage_icon_from_x11(WIcon *icon)
        unset_icon_image(icon);
 
        /* Set the new icon image */
-       icon->file = NULL;
        icon->file_image = RRetainImage(icon->owner->net_icon_image);
 }
 
@@ -680,7 +679,6 @@ static void get_rimage_icon_from_default_icon(WIcon *icon)
        unset_icon_image(icon);
 
        /* Set the new icon image */
-       icon->file = NULL;
        icon->file_image = RRetainImage(scr->def_icon_rimage);
 }
 
@@ -696,7 +694,6 @@ static void get_rimage_icon_from_icon_win(WIcon *icon)
        unset_icon_image(icon);
 
        /* Set the new info */
-       icon->file = NULL;
        icon->file_image = image;
 }
 

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

commit 7746fe7c5a46a58eb5a2e5393487de8213bb0a42
Author: Christophe CURIS <[email protected]>
Date:   Wed Nov 14 21:23:32 2012 +0100

    Added reset of pointer after memory free to avoid double-free crash
    
    As reported by Rodolfo, there are some cases when working with icons
    where a crash can occur, which is related to trying to re-release
    some memory that have been already freed previously.
    
    This patch adds a reset-to-NULL of the corresponding pointers so that
    on next usage wmaker will know there's no more memory associated with
    these pointers.

diff --git a/src/icon.c b/src/icon.c
index ba059ad..04767d8 100644
--- a/src/icon.c
+++ b/src/icon.c
@@ -584,11 +584,15 @@ void wIconSelect(WIcon * icon)
 
 static void unset_icon_image(WIcon *icon)
 {
-       if (icon->file)
+       if (icon->file) {
                wfree(icon->file);
+               icon->file = NULL;
+       }
 
-       if (icon->file_image)
+       if (icon->file_image) {
                RReleaseImage(icon->file_image);
+               icon->file_image = NULL;
+       }
 }
 
 void wIconUpdate(WIcon *icon)
@@ -755,8 +759,7 @@ static int get_rimage_icon_from_wm_hints(WIcon *icon)
        if (!image)
                return 1;
 
-       /* FIXME: If unset_icon_image, pointer double free then crash 
-       unset_icon_image(icon); */
+       unset_icon_image(icon);
        icon->file_image = image;
 
        return 0;

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

Summary of changes:
 src/icon.c      |   32 ++++++++++++++++++--------------
 src/wdefaults.c |    4 ++++
 2 files changed, 22 insertions(+), 14 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