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  46c8d6d2bf2d8a90cd3db6f461fee8461651678e (commit)
       via  6aa43d356ca3c7ee44748212d9318f7005d2d140 (commit)
       via  fa27215fcc3a1d11c0e95135a1c586980c01ca5f (commit)
       via  8cb744739c60441959973695c05c07fa56686430 (commit)
       via  dee9c457cf16a52d6f27534e774959987a215ec1 (commit)
       via  3d0ed99043615dd9fd0550107075cba895e56f97 (commit)
       via  88d16d03b9e89667c4b8ea25796d8a5716ff7ca3 (commit)
       via  256c8a498e06c1a44acb0ba0bbf1a4aab9177ba4 (commit)
       via  544bc8e7a79fc47a82a1c829c29937913bc086e0 (commit)
       via  883ed8ac9a20854f566b03cf735ec4955b298b88 (commit)
       via  ca86f5594d3f474d1995e271622278209fc0ff06 (commit)
       via  2c0a449f00fc4f377605067bec2112d82beb4ae3 (commit)
       via  b3ca57674d0ee8e8b83117ea47d991396a2d1b74 (commit)
       via  4093d24625b339246a0597b743eec912a9ab6474 (commit)
       via  c24499f6add64a233e13288d43327833b38fd12e (commit)
       via  c088aba057f9f094ed77201e69ba579540f69044 (commit)
      from  389a0a252cb88ddb4692480adcf261f670bd1597 (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/46c8d6d2bf2d8a90cd3db6f461fee8461651678e

commit 46c8d6d2bf2d8a90cd3db6f461fee8461651678e
Author: Christophe CURIS <[email protected]>
Date:   Tue Apr 9 08:54:48 2013 +0200

    configure: Add detection of library kvm that is used under OpenBSD
    
    As proposed by Christian Schulte, when compiling WindowMaker on BSD
    it uses the kvm library to gather information on processes (in the
    os-dependant file), so we must properly link against the corresponding
    library, which this patch adds.

diff --git a/configure.ac b/configure.ac
index 6820f15..734851a 100644
--- a/configure.ac
+++ b/configure.ac
@@ -228,6 +228,11 @@ AS_IF([test "x$ac_cv_search_strlcat" = "x-lbsd" -o 
"x$ac_cv_search_strlcpy" = "x
 )
 AC_SUBST(LIBBSD)
 
+dnl Check for OpenBSD kernel memory interface - kvm(3)
+dnl ==================================================
+AS_IF([test "x$WM_OSDEP" = "xbsd"],
+  AC_SEARCH_LIBS([kvm_openfiles], [kvm]) )
+
 dnl Check for inotify
 dnl =================
 AC_CHECK_HEADERS(sys/inotify.h, AC_DEFINE(HAVE_INOTIFY, 1, Check for inotify))

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

commit 6aa43d356ca3c7ee44748212d9318f7005d2d140
Author: Rodolfo García Peñas (kix) <[email protected]>
Date:   Mon Apr 8 19:40:58 2013 +0200

    wIconChangeTitle rewritten
    
    The function wIconChangeTitle() now changes the icon title name
    doing the full work (except painting it).
    
    The function receives now the icon to change the name and the
    wwindow with the new name. The function checks if icon and the
    window exists.
    
    Then, try to get the name using wNETWMGetIconName(), if not found
    then try to read it from wGetIconName(). Then the icon has the new
    name and the function returns.
    
    This is better because:
    
    1. We don't need a flag to know if the window got the name
       using the wNETWMGetIconName function. Now call this function
       always.
    
    2. We do the same work in all calls to the wIconChangeTitle()
       function.
    
    The functions that uses wIconChangeTitle (at client.c, icon.c and
    wmspec.c) uses always the value set by wNETWMGetIconName() first,
    else, the value set by wGetIconName(). This is the reason for the
    flag net_has_icon_title. Now the flag can be removed.

diff --git a/src/client.c b/src/client.c
index 9e7eb6a..cfe5181 100644
--- a/src/client.c
+++ b/src/client.c
@@ -322,16 +322,10 @@ void wClientCheckProperty(WWindow * wwin, XPropertyEvent 
* event)
                break;
 
        case XA_WM_ICON_NAME:
-               if (!wwin->flags.net_has_icon_title) {
-                       if (!wwin->icon)
-                               break;
-                       else {
-                               char *new_title;
-
-                               /* icon title was changed */
-                               wGetIconName(dpy, wwin->client_win, &new_title);
-                               wIconChangeTitle(wwin->icon, new_title);
-                       }
+               /* Title has changed, update the icon title */
+               if (wwin->icon) {
+                       wIconChangeTitle(wwin->icon, wwin);
+                       wIconPaint(wwin->icon);
                }
                break;
 
diff --git a/src/icon.c b/src/icon.c
index 166b8be..7b71ab7 100644
--- a/src/icon.c
+++ b/src/icon.c
@@ -134,12 +134,7 @@ WIcon *icon_create_for_wwindow(WWindow *wwin)
        icon->show_title = 1;
 #endif
 
-       icon->icon_name = wNETWMGetIconName(wwin->client_win);
-       if (icon->icon_name)
-               wwin->flags.net_has_icon_title = 1;
-       else
-               wGetIconName(dpy, wwin->client_win, &icon->icon_name);
-
+       wIconChangeTitle(icon, wwin);
        icon->tile_type = TILE_NORMAL;
 
        set_icon_image_from_database(icon, wwin->wm_instance, wwin->wm_class, 
NULL);
@@ -305,13 +300,19 @@ static void icon_update_pixmap(WIcon *icon, RImage *image)
        icon->pixmap = pixmap;
 }
 
-void wIconChangeTitle(WIcon *icon, char *new_title)
+void wIconChangeTitle(WIcon *icon, WWindow *wwin)
 {
+       if (!icon || !wwin)
+               return;
+
+       /* Remove the previous icon title */
        if (icon->icon_name != NULL)
                XFree(icon->icon_name);
 
-       icon->icon_name = new_title;
-       wIconPaint(icon);
+       /* Set the new one, using two methods */
+       icon->icon_name = wNETWMGetIconName(wwin->client_win);
+       if (!icon->icon_name)
+               wGetIconName(dpy, wwin->client_win, &icon->icon_name);
 }
 
 RImage *wIconValidateIconSize(RImage *icon, int max_size)
diff --git a/src/icon.h b/src/icon.h
index 22e81f3..2c81ae7 100644
--- a/src/icon.h
+++ b/src/icon.h
@@ -61,7 +61,7 @@ void wIconDestroy(WIcon *icon);
 void wIconPaint(WIcon *icon);
 void wIconUpdate(WIcon *icon);
 void wIconSelect(WIcon *icon);
-void wIconChangeTitle(WIcon *icon, char *new_title);
+void wIconChangeTitle(WIcon *icon, WWindow *wwin);
 void update_icon_pixmap(WIcon *icon);
 
 Bool wIconChangeImageFile(WIcon *icon, char *file);
diff --git a/src/window.h b/src/window.h
index 2e24f49..a95b9f7 100644
--- a/src/window.h
+++ b/src/window.h
@@ -282,7 +282,6 @@ typedef struct WWindow {
                unsigned int net_handle_icon:1;
                unsigned int net_show_desktop:1;
                unsigned int net_has_title:1;   /* use netwm version of WM_NAME 
*/
-               unsigned int net_has_icon_title:1;
        } flags;                                /* state of the window */
 
        struct WIcon *icon;                     /* Window icon when miminized
diff --git a/src/wmspec.c b/src/wmspec.c
index c894fab..255982e 100644
--- a/src/wmspec.c
+++ b/src/wmspec.c
@@ -1470,8 +1470,8 @@ void wNETWMCheckClientHintChange(WWindow *wwin, 
XPropertyEvent *event)
                        wfree(name);
        } else if (event->atom == net_wm_icon_name) {
                if (wwin->icon) {
-                       char *name = wNETWMGetIconName(wwin->client_win);
-                       wIconChangeTitle(wwin->icon, name);
+                       wIconChangeTitle(wwin->icon, wwin);
+                       wIconPaint(wwin->icon);
                }
        } else if (event->atom == net_wm_icon) {
                updateIconImage(wwin);

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

commit fa27215fcc3a1d11c0e95135a1c586980c01ca5f
Author: Rodolfo García Peñas (kix) <[email protected]>
Date:   Mon Apr 8 19:40:57 2013 +0200

    wIconPaint: avoid crashing if icon is NULL
    
    This patch checks that the icon exists before painting it.

diff --git a/src/icon.c b/src/icon.c
index 94da694..166b8be 100644
--- a/src/icon.c
+++ b/src/icon.c
@@ -755,6 +755,9 @@ static void update_icon_title(WIcon *icon)
 
 void wIconPaint(WIcon *icon)
 {
+       if (!icon || !icon->core || !icon->core->screen_ptr)
+               return;
+
        WScreen *scr = icon->core->screen_ptr;
 
        XClearWindow(dpy, icon->core->window);

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

commit 8cb744739c60441959973695c05c07fa56686430
Author: Rodolfo García Peñas (kix) <[email protected]>
Date:   Mon Apr 8 19:40:56 2013 +0200

    Remove wIconUpdate in tileObserver
    
    The call to wIconUpdate() can be changed by call to update_icon_pixmap(),
    because the icon doesn't need to be changed.
    
    Now, the icon pixmap is updated faster.
    
    This change is more difficult to see, this is the explanation:
    
    1. wIconUpdate() updates the icon for the applications, then call
       update_icon_pixmap() to re-create the pixmap.
    2. tileObserver() is used if the event WNIconTileSettingsChanged() is
       launched. This event is used in the Notification for docks and wwindows:
    
    WMAddNotificationObserver(tileObserver, icon, WNIconTileSettingsChanged, 
icon);
    
    3. The function WNIconTileSettingsChanged() is used if the icon need 
refresh,
       used in the wReadDefaults() function. See code below. This function is 
used
       in the wmaker startup.
    
       if (needs_refresh & REFRESH_ICON_TILE)
         WMPostNotificationName(WNIconTileSettingsChanged, NULL, NULL);
    
    4. Finally, the flag to refresh the icon tile is throw by setIconTile():
    
       return (reset ? REFRESH_ICON_TILE : 0);
    
       And this function only changes the the icon tile if reset is "1", that
       happend if src->icon_tile:
    
            if (scr->icon_tile) {
              reset = 1;
              RReleaseImage(scr->icon_tile);
              XFreePixmap(dpy, scr->icon_tile_pixmap);
            }
    
    5. Then, we can drop the function wIconUpdate(), because the change is in 
the
       icon_tile variable, used only in icon_update_pixmap(). This function is
       only used in update_icon_pixmap() (not in wIconUpdate):
    
    kix@kentin:~/src/wmaker/git/wmaker-crm/src$ grep icon_tile icon.c
                    tile = RCloneImage(scr->icon_tile);
            XSetWindowBackgroundPixmap(dpy, icon->core->window, 
scr->icon_tile_pixmap);
    kix@kentin:~/src/wmaker/git/wmaker-crm/src$
    
    static void icon_update_pixmap(WIcon *icon, RImage *image)
    {
    [snip]
      if (icon->tile_type == TILE_NORMAL) {
        tile = RCloneImage(scr->icon_tile);
      } else {
        assert(scr->clip_tile);
        tile = RCloneImage(scr->clip_tile);
      }
    [snip]
    
    The XSetWindowBackgroundPixmap() call doesn't matter here.

diff --git a/src/icon.c b/src/icon.c
index d5f857c..94da694 100644
--- a/src/icon.c
+++ b/src/icon.c
@@ -93,7 +93,7 @@ static void tileObserver(void *self, WMNotification *notif)
 {
        WIcon *icon = (WIcon *) self;
 
-       wIconUpdate(icon);
+       update_icon_pixmap(icon);
 
        XClearArea(dpy, icon->core->window, 0, 0, 1, 1, True);
 }

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

commit dee9c457cf16a52d6f27534e774959987a215ec1
Author: Rodolfo García Peñas (kix) <[email protected]>
Date:   Mon Apr 8 19:40:55 2013 +0200

    Remove wIconUpdate in wDockAttachIcon
    
    The call to wIconUpdate() can be changed by call to update_icon_pixmap(),
    because the icon doesn't need to be changed. This update is only for change
    the icon pixmap to un-shadowed.
    
    Now, the icon pixmap is updated faster.

diff --git a/src/dock.c b/src/dock.c
index b99e16b..60f87b5 100644
--- a/src/dock.c
+++ b/src/dock.c
@@ -1943,9 +1943,12 @@ Bool wDockAttachIcon(WDock *dock, WAppIcon *icon, int x, 
int y, Bool update_icon
        MoveInStackListUnder(dock->icon_array[index - 1]->icon->core, 
icon->icon->core);
        wAppIconMove(icon, icon->x_pos, icon->y_pos);
 
-       /* Update the icon images */
+       /*
+        * Update icon pixmap, RImage doesn't change,
+        * so call wIconUpdate is not needed
+        */
        if (lupdate_icon)
-               wIconUpdate(icon->icon);
+               update_icon_pixmap(icon->icon);
 
        /* Paint it */
        wAppIconPaint(icon);

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

commit 3d0ed99043615dd9fd0550107075cba895e56f97
Author: Rodolfo García Peñas (kix) <[email protected]>
Date:   Mon Apr 8 19:40:54 2013 +0200

    Remove wIconUpdate in wDockDetach
    
    The call to wIconUpdate() can be changed by call to update_icon_pixmap(),
    because the icon doesn't need to be changed. This update is only for change
    the icon pixmap to un-shadowed.
    
    Now, the icon pixmap is updated faster.

diff --git a/src/dock.c b/src/dock.c
index 68c7968..b99e16b 100644
--- a/src/dock.c
+++ b/src/dock.c
@@ -2177,9 +2177,12 @@ void wDockDetach(WDock *dock, WAppIcon *icon)
 
                ChangeStackingLevel(icon->icon->core, NORMAL_ICON_LEVEL);
 
-               /* Update the icon images */
+               /*
+                * Update icon pixmap, RImage doesn't change,
+                * so call wIconUpdate is not needed
+                */
                if (update_icon)
-                       wIconUpdate(icon->icon);
+                       update_icon_pixmap(icon->icon);
 
                /* Paint it */
                wAppIconPaint(icon);

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

commit 88d16d03b9e89667c4b8ea25796d8a5716ff7ca3
Author: Rodolfo García Peñas (kix) <[email protected]>
Date:   Mon Apr 8 19:40:53 2013 +0200

    Remove wIconUpdate in moveIconBetweenDocks
    
    The call to wIconUpdate() can be changed by call to update_icon_pixmap(),
    because the icon doesn't need to be changed. This update is only for change
    the icon pixmap to shadowed.
    
    Now, the icon pixmap is updated faster.

diff --git a/src/dock.c b/src/dock.c
index e749fe9..68c7968 100644
--- a/src/dock.c
+++ b/src/dock.c
@@ -2097,9 +2097,12 @@ static Bool moveIconBetweenDocks(WDock *src, WDock 
*dest, WAppIcon *icon, int x,
 
        MoveInStackListUnder(dest->icon_array[index - 1]->icon->core, 
icon->icon->core);
 
-       /* Update the icon images */
+       /*
+        * Update icon pixmap, RImage doesn't change,
+        * so call wIconUpdate is not needed
+        */
        if (update_icon)
-               wIconUpdate(icon->icon);
+               update_icon_pixmap(icon->icon);
 
        /* Paint it */
        wAppIconPaint(icon);

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

commit 256c8a498e06c1a44acb0ba0bbf1a4aab9177ba4
Author: Rodolfo García Peñas (kix) <[email protected]>
Date:   Mon Apr 8 19:40:52 2013 +0200

    Remove wIconUpdate in keepIconsCallback
    
    The call to wIconUpdate() can be changed by call to update_icon_pixmap(),
    because the icon doesn't need to be changed. This update is only for change
    the icon pixmap to shadowed.
    
    Now, the icon pixmap is updated faster.

diff --git a/src/dock.c b/src/dock.c
index 7b5d08d..e749fe9 100644
--- a/src/dock.c
+++ b/src/dock.c
@@ -541,8 +541,11 @@ static void keepIconsCallback(WMenu *menu, WMenuEntry 
*entry)
                        if (aicon->icon->shadowed) {
                                aicon->icon->shadowed = 0;
 
-                               /* Update the icon images */
-                               wIconUpdate(aicon->icon);
+                               /*
+                                * Update icon pixmap, RImage doesn't change,
+                                * so call wIconUpdate is not needed
+                                */
+                               update_icon_pixmap(aicon->icon);
 
                                /* Paint it */
                                wAppIconPaint(aicon);

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

commit 544bc8e7a79fc47a82a1c829c29937913bc086e0
Author: Rodolfo García Peñas (kix) <[email protected]>
Date:   Mon Apr 8 19:40:51 2013 +0200

    Move out wIconUpdate from set_icon_image_from_database
    
    The function set_icon_image_from_database() set the icon from the
    database, but wIconUpdate() update the icon using different methods
    , like for example get the image from X11. So, is better move the
    wIconUpdate() to the function who call set_icon_image_from_database(),
    to avoid understanding problems.

diff --git a/src/appicon.c b/src/appicon.c
index 117fddb..b196931 100644
--- a/src/appicon.c
+++ b/src/appicon.c
@@ -266,6 +266,9 @@ void removeAppIconFor(WApplication *wapp)
                set_icon_image_from_database(wapp->app_icon->icon, 
wapp->app_icon->wm_instance,
                                             wapp->app_icon->wm_class, 
wapp->app_icon->command);
 
+               /* Update the icon, because wapp->app_icon->icon could be NULL 
*/
+               wIconUpdate(wapp->app_icon->icon);
+
                /* Paint it */
                wAppIconPaint(wapp->app_icon);
        } else if (wapp->app_icon->docked) {
diff --git a/src/icon.c b/src/icon.c
index c6d744c..d5f857c 100644
--- a/src/icon.c
+++ b/src/icon.c
@@ -143,6 +143,8 @@ WIcon *icon_create_for_wwindow(WWindow *wwin)
        icon->tile_type = TILE_NORMAL;
 
        set_icon_image_from_database(icon, wwin->wm_instance, wwin->wm_class, 
NULL);
+       /* Update the icon, because icon could be NULL */
+       wIconUpdate(icon);
 
        WMAddNotificationObserver(appearanceObserver, icon, 
WNIconAppearanceSettingsChanged, icon);
        WMAddNotificationObserver(tileObserver, icon, 
WNIconTileSettingsChanged, icon);
@@ -158,6 +160,8 @@ WIcon *icon_create_for_dock(WScreen *scr, char *command, 
char *wm_instance, char
        icon->tile_type = tile;
 
        set_icon_image_from_database(icon, wm_instance, wm_class, command);
+       /* Update the icon, because icon could be NULL */
+       wIconUpdate(icon);
 
        WMAddNotificationObserver(appearanceObserver, icon, 
WNIconAppearanceSettingsChanged, icon);
        WMAddNotificationObserver(tileObserver, icon, 
WNIconTileSettingsChanged, icon);
@@ -885,6 +889,4 @@ void set_icon_image_from_database(WIcon *icon, char 
*wm_instance, char *wm_class
                icon->file_image = get_rimage_from_file(icon->core->screen_ptr, 
icon->file, wPreferences.icon_size);
                wfree(file);
        }
-
-       wIconUpdate(icon);
 }

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

commit 883ed8ac9a20854f566b03cf735ec4955b298b88
Author: Rodolfo García Peñas (kix) <[email protected]>
Date:   Mon Apr 8 19:40:50 2013 +0200

    wIconChangeTitle rewrited
    
    The function wIconChangeTitle() function calls wIconUpdate() or
    wIconPaint() depending of changed. In both cases the icon->file_image
    doesn't change, only the icon title, so we can use the same image
    and we don't need update it. Because the variable changed is removed,
    we can use wIconPaint() here.
    
    Then the variable changed is not used, and these lines can be removed.

diff --git a/src/icon.c b/src/icon.c
index e9e9c89..c6d744c 100644
--- a/src/icon.c
+++ b/src/icon.c
@@ -303,20 +303,11 @@ static void icon_update_pixmap(WIcon *icon, RImage *image)
 
 void wIconChangeTitle(WIcon *icon, char *new_title)
 {
-       int changed;
-
-       changed = (new_title == NULL && icon->icon_name != NULL) ||
-                 (new_title != NULL && icon->icon_name == NULL);
-
        if (icon->icon_name != NULL)
                XFree(icon->icon_name);
 
        icon->icon_name = new_title;
-
-       if (changed)
-               wIconUpdate(icon);
-       else
-               wIconPaint(icon);
+       wIconPaint(icon);
 }
 
 RImage *wIconValidateIconSize(RImage *icon, int max_size)

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

commit ca86f5594d3f474d1995e271622278209fc0ff06
Author: Rodolfo García Peñas (kix) <[email protected]>
Date:   Mon Apr 8 19:40:49 2013 +0200

    New function update_icon_title
    
    The function update_icon_title() updates the icon title.
    
    The code comes from the function wIconPaint().

diff --git a/src/icon.c b/src/icon.c
index a6bba71..e9e9c89 100644
--- a/src/icon.c
+++ b/src/icon.c
@@ -734,14 +734,13 @@ RImage *get_rimage_icon_from_wm_hints(WIcon *icon)
        return image;
 }
 
-void wIconPaint(WIcon *icon)
+/* This function updates in the screen the icon title */
+static void update_icon_title(WIcon *icon)
 {
        WScreen *scr = icon->core->screen_ptr;
        int x, l, w;
        char *tmp;
 
-       XClearWindow(dpy, icon->core->window);
-
        /* draw the icon title */
        if (icon->show_title && icon->icon_name != NULL) {
                tmp = ShrinkString(scr->icon_title_font, icon->icon_name, 
wPreferences.icon_size - 4);
@@ -756,6 +755,16 @@ void wIconPaint(WIcon *icon)
                             scr->icon_title_font, x, 1, tmp, l);
                wfree(tmp);
        }
+}
+
+
+void wIconPaint(WIcon *icon)
+{
+       WScreen *scr = icon->core->screen_ptr;
+
+       XClearWindow(dpy, icon->core->window);
+
+       update_icon_title(icon);
 
        if (icon->selected)
                XDrawRectangle(dpy, icon->core->window, scr->icon_select_gc, 0, 
0,

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

commit 2c0a449f00fc4f377605067bec2112d82beb4ae3
Author: Rodolfo García Peñas (kix) <[email protected]>
Date:   Mon Apr 8 19:40:48 2013 +0200

    drawIconTitle renamed
    
    The function drawIconTitle() only draw the icon title square, without
    the title. The title must be set later, because yet is not initialized,
    so is NULL.
    
    Then, the right function name should be drawIconTitleBackground.
    
    This patch also removes the variable titled.

diff --git a/src/icon.c b/src/icon.c
index 1de08db..a6bba71 100644
--- a/src/icon.c
+++ b/src/icon.c
@@ -229,7 +229,7 @@ void wIconDestroy(WIcon * icon)
        wfree(icon);
 }
 
-static void drawIconTitle(WScreen * scr, Pixmap pixmap, int height)
+static void drawIconTitleBackground(WScreen *scr, Pixmap pixmap, int height)
 {
        XFillRectangle(dpy, pixmap, scr->icon_title_texture->normal_gc, 0, 0, 
wPreferences.icon_size, height + 1);
        XDrawLine(dpy, pixmap, scr->icon_title_texture->light_gc, 0, 0, 
wPreferences.icon_size, 0);
@@ -246,7 +246,6 @@ static void icon_update_pixmap(WIcon *icon, RImage *image)
        unsigned w, h;
        int theight = 0;
        WScreen *scr = icon->core->screen_ptr;
-       int titled = icon->show_title;
 
        if (icon->tile_type == TILE_NORMAL) {
                tile = RCloneImage(scr->icon_tile);
@@ -261,7 +260,7 @@ static void icon_update_pixmap(WIcon *icon, RImage *image)
                x = (wPreferences.icon_size - w) / 2;
                sx = (image->width - w) / 2;
 
-               if (titled)
+               if (icon->show_title)
                        theight = WMFontHeight(scr->icon_title_font);
 
                h = (image->height + theight > wPreferences.icon_size
@@ -295,8 +294,9 @@ static void icon_update_pixmap(WIcon *icon, RImage *image)
 
        RReleaseImage(tile);
 
-       if (titled)
-               drawIconTitle(scr, pixmap, theight);
+       /* Draw the icon's title background (without text) */
+       if (icon->show_title)
+               drawIconTitleBackground(scr, pixmap, theight);
 
        icon->pixmap = pixmap;
 }

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

commit b3ca57674d0ee8e8b83117ea47d991396a2d1b74
Author: Rodolfo García Peñas (kix) <[email protected]>
Date:   Mon Apr 8 19:40:47 2013 +0200

    Dockapps don't have title
    
    The dockapps don't have title, so this code must be removed.
    The title height is 0 then and the variable title_height can
    be removed.

diff --git a/src/icon.c b/src/icon.c
index 32d3fd5..1de08db 100644
--- a/src/icon.c
+++ b/src/icon.c
@@ -681,9 +681,7 @@ static void set_dockapp_in_icon(WIcon *icon)
 {
        XWindowAttributes attr;
        WScreen *scr = icon->core->screen_ptr;
-       int title_height = WMFontHeight(scr->icon_title_font);
        unsigned int w, h, d;
-       int theight = 0;
 
        /* Reparent the dock application to the icon */
 
@@ -691,13 +689,8 @@ static void set_dockapp_in_icon(WIcon *icon)
         * and show in the correct position */
        getSize(icon->icon_win, &w, &h, &d);
 
-       /* Set extra space for title */
-       if (icon->show_title && (h + title_height < wPreferences.icon_size)) {
-               theight = title_height;
-               drawIconTitle(scr, icon->pixmap, theight);
-       } else {
-                XSetWindowBackgroundPixmap(dpy, icon->core->window, 
scr->icon_tile_pixmap);
-        }
+       /* Set the background pixmap */
+       XSetWindowBackgroundPixmap(dpy, icon->core->window, 
scr->icon_tile_pixmap);
 
        /* Set the icon border */
        XSetWindowBorderWidth(dpy, icon->icon_win, 0);
@@ -705,7 +698,7 @@ static void set_dockapp_in_icon(WIcon *icon)
        /* Put the dock application in the icon */
        XReparentWindow(dpy, icon->icon_win, icon->core->window,
                        (wPreferences.icon_size - w) / 2,
-                       theight + (wPreferences.icon_size - h - theight) / 2);
+                       (wPreferences.icon_size - h) / 2);
 
        /* Show it and save */
        XMapWindow(dpy, icon->icon_win);

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

commit 4093d24625b339246a0597b743eec912a9ab6474
Author: Rodolfo García Peñas (kix) <[email protected]>
Date:   Mon Apr 8 19:40:46 2013 +0200

    wIconUpdate removed image argument
    
    The argument image is not used in any call, so can be removed.

diff --git a/src/appicon.c b/src/appicon.c
index 322ee61..117fddb 100644
--- a/src/appicon.c
+++ b/src/appicon.c
@@ -154,7 +154,7 @@ void create_appicon_for_application(WApplication *wapp, 
WWindow *wwin)
        if (!wapp->app_icon) {
                /* Create the icon */
                wapp->app_icon = wAppIconCreate(wapp->main_window_desc);
-               wIconUpdate(wapp->app_icon->icon, NULL);
+               wIconUpdate(wapp->app_icon->icon);
 
                /* Now, paint the icon */
                if (!WFLAGP(wapp->main_window_desc, no_appicon))
@@ -999,7 +999,7 @@ static void create_appicon_from_dock(WWindow *wwin, 
WApplication *wapp, Window m
                        wapp->app_icon->icon->icon_win = 
mainw->wm_hints->icon_window;
 
                /* Update the icon images */
-               wIconUpdate(wapp->app_icon->icon, NULL);
+               wIconUpdate(wapp->app_icon->icon);
 
                /* Paint it */
                wAppIconPaint(wapp->app_icon);
diff --git a/src/client.c b/src/client.c
index ab87ecb..9e7eb6a 100644
--- a/src/client.c
+++ b/src/client.c
@@ -472,12 +472,12 @@ void wClientCheckProperty(WWindow * wwin, XPropertyEvent 
* event)
                            || (wwin->wm_hints->flags & IconWindowHint)) {
                                WApplication *wapp;
 
-                               if (wwin->flags.miniaturized && wwin->icon) {
-                                       wIconUpdate(wwin->icon, NULL);
-                               }
+                               if (wwin->flags.miniaturized && wwin->icon)
+                                       wIconUpdate(wwin->icon);
+
                                wapp = wApplicationOf(wwin->main_window);
                                if (wapp && wapp->app_icon) {
-                                       wIconUpdate(wapp->app_icon->icon, NULL);
+                                       wIconUpdate(wapp->app_icon->icon);
                                        wAppIconPaint(wapp->app_icon);
                                }
                        }
diff --git a/src/dock.c b/src/dock.c
index 0140bd1..7b5d08d 100644
--- a/src/dock.c
+++ b/src/dock.c
@@ -542,7 +542,7 @@ static void keepIconsCallback(WMenu *menu, WMenuEntry 
*entry)
                                aicon->icon->shadowed = 0;
 
                                /* Update the icon images */
-                               wIconUpdate(aicon->icon, NULL);
+                               wIconUpdate(aicon->icon);
 
                                /* Paint it */
                                wAppIconPaint(aicon);
@@ -1942,7 +1942,7 @@ Bool wDockAttachIcon(WDock *dock, WAppIcon *icon, int x, 
int y, Bool update_icon
 
        /* Update the icon images */
        if (lupdate_icon)
-               wIconUpdate(icon->icon, NULL);
+               wIconUpdate(icon->icon);
 
        /* Paint it */
        wAppIconPaint(icon);
@@ -2096,7 +2096,7 @@ static Bool moveIconBetweenDocks(WDock *src, WDock *dest, 
WAppIcon *icon, int x,
 
        /* Update the icon images */
        if (update_icon)
-               wIconUpdate(icon->icon, NULL);
+               wIconUpdate(icon->icon);
 
        /* Paint it */
        wAppIconPaint(icon);
@@ -2173,7 +2173,7 @@ void wDockDetach(WDock *dock, WAppIcon *icon)
 
                /* Update the icon images */
                if (update_icon)
-                       wIconUpdate(icon->icon, NULL);
+                       wIconUpdate(icon->icon);
 
                /* Paint it */
                wAppIconPaint(icon);
diff --git a/src/icon.c b/src/icon.c
index a2cb835..32d3fd5 100644
--- a/src/icon.c
+++ b/src/icon.c
@@ -93,7 +93,7 @@ static void tileObserver(void *self, WMNotification *notif)
 {
        WIcon *icon = (WIcon *) self;
 
-       wIconUpdate(icon, NULL);
+       wIconUpdate(icon);
 
        XClearArea(dpy, icon->core->window, 0, 0, 1, 1, True);
 }
@@ -314,7 +314,7 @@ void wIconChangeTitle(WIcon *icon, char *new_title)
        icon->icon_name = new_title;
 
        if (changed)
-               wIconUpdate(icon, NULL);
+               wIconUpdate(icon);
        else
                wIconPaint(icon);
 }
@@ -573,35 +573,31 @@ void set_icon_image_from_image(WIcon *icon, RImage *image)
        icon->file_image = image;
 }
 
-void wIconUpdate(WIcon *icon, RImage *image)
+void wIconUpdate(WIcon *icon)
 {
        WWindow *wwin = NULL;
 
-       if (image) {
-               icon->file_image = image;
-       } else {
-               if (icon && icon->owner)
-                       wwin = icon->owner;
-
-               if (wwin && WFLAGP(wwin, always_user_icon)) {
-                       /* Forced use user_icon */
+       if (icon && icon->owner)
+               wwin = icon->owner;
+
+       if (wwin && WFLAGP(wwin, always_user_icon)) {
+               /* Forced use user_icon */
+               get_rimage_icon_from_user_icon(icon);
+       } else if (icon->icon_win != None) {
+               /* Get the Pixmap from the WIcon */
+               get_rimage_icon_from_icon_win(icon);
+       } else if (wwin && wwin->net_icon_image) {
+               /* Use _NET_WM_ICON icon */
+               get_rimage_icon_from_x11(icon);
+       } else if (wwin && wwin->wm_hints && (wwin->wm_hints->flags & 
IconPixmapHint)) {
+               /* Get the Pixmap from the wm_hints, else, from the user */
+               unset_icon_image(icon);
+               icon->file_image = get_rimage_icon_from_wm_hints(icon);
+               if (!icon->file_image)
                        get_rimage_icon_from_user_icon(icon);
-               } else if (icon->icon_win != None) {
-                       /* Get the Pixmap from the WIcon */
-                       get_rimage_icon_from_icon_win(icon);
-               } else if (wwin && wwin->net_icon_image) {
-                       /* Use _NET_WM_ICON icon */
-                       get_rimage_icon_from_x11(icon);
-               } else if (wwin && wwin->wm_hints && (wwin->wm_hints->flags & 
IconPixmapHint)) {
-                       /* Get the Pixmap from the wm_hints, else, from the 
user */
-                       unset_icon_image(icon);
-                       icon->file_image = get_rimage_icon_from_wm_hints(icon);
-                       if (!icon->file_image)
-                               get_rimage_icon_from_user_icon(icon);
-               } else {
-                       /* Get the Pixmap from the user */
-                       get_rimage_icon_from_user_icon(icon);
-               }
+       } else {
+               /* Get the Pixmap from the user */
+               get_rimage_icon_from_user_icon(icon);
        }
 
        update_icon_pixmap(icon);
@@ -897,5 +893,5 @@ void set_icon_image_from_database(WIcon *icon, char 
*wm_instance, char *wm_class
                wfree(file);
        }
 
-       wIconUpdate(icon, NULL);
+       wIconUpdate(icon);
 }
diff --git a/src/icon.h b/src/icon.h
index 93b8145..22e81f3 100644
--- a/src/icon.h
+++ b/src/icon.h
@@ -59,7 +59,7 @@ WIcon *icon_create_for_wwindow(WWindow *wwin);
 void set_icon_image_from_database(WIcon *icon, char *wm_instance, char 
*wm_class, char *command);
 void wIconDestroy(WIcon *icon);
 void wIconPaint(WIcon *icon);
-void wIconUpdate(WIcon *icon, RImage *image);
+void wIconUpdate(WIcon *icon);
 void wIconSelect(WIcon *icon);
 void wIconChangeTitle(WIcon *icon, char *new_title);
 void update_icon_pixmap(WIcon *icon);
diff --git a/src/winspector.c b/src/winspector.c
index acd2057..08066da 100644
--- a/src/winspector.c
+++ b/src/winspector.c
@@ -769,7 +769,7 @@ static void applySettings(WMButton *button, InspectorPanel 
*panel)
                                        
set_icon_image_from_image(wapp->app_icon->icon, image);
                                        
update_icon_pixmap(wapp->app_icon->icon);
                                } else {
-                                       wIconUpdate(wapp->app_icon->icon, NULL);
+                                       wIconUpdate(wapp->app_icon->icon);
                                }
                        }
 
@@ -781,7 +781,7 @@ static void applySettings(WMButton *button, InspectorPanel 
*panel)
                                        set_icon_image_from_image(wwin->icon, 
image);
                                        update_icon_pixmap(wwin->icon);
                                } else {
-                                       wIconUpdate(wwin->icon, NULL);
+                                       wIconUpdate(wwin->icon);
                                }
                        }
                } else {
diff --git a/src/wmspec.c b/src/wmspec.c
index 515b66c..c894fab 100644
--- a/src/wmspec.c
+++ b/src/wmspec.c
@@ -468,12 +468,12 @@ static void updateIconImage(WWindow *wwin)
 
        /* Refresh the Window Icon */
        if (wwin->icon)
-               wIconUpdate(wwin->icon, NULL);
+               wIconUpdate(wwin->icon);
 
        /* Refresh the application icon */
        WApplication *app = wApplicationOf(wwin->main_window);
        if (app && app->app_icon) {
-               wIconUpdate(app->app_icon->icon, NULL);
+               wIconUpdate(app->app_icon->icon);
                wAppIconPaint(app->app_icon);
        }
 }

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

commit c24499f6add64a233e13288d43327833b38fd12e
Author: Rodolfo García Peñas (kix) <[email protected]>
Date:   Mon Apr 8 19:40:45 2013 +0200

    wIconChangeImageFile use set_icon_image_from_image
    
    The function wIconChangeImageFile() now use set_icon_image_from_image()
    then:
    
    1. Don't need call unset_icon_image() because the memory is free in the
       function set_icon_image_from_image().
    2. After update the icon info, it must set the file name.
    3. The pixmap image could be updated.

diff --git a/src/icon.c b/src/icon.c
index eaca466..a2cb835 100644
--- a/src/icon.c
+++ b/src/icon.c
@@ -362,12 +362,10 @@ Bool wIconChangeImageFile(WIcon *icon, char *file)
 
        /* New image! */
        if (!error && image) {
-               /* Remove the old one */
-               unset_icon_image(icon);
-
                /* Set the new image */
+               set_icon_image_from_image(icon, image);
                icon->file = wstrdup(path);
-               wIconUpdate(icon, image);
+               update_icon_pixmap(icon);
        } else {
                error = 1;
        }

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

commit c088aba057f9f094ed77201e69ba579540f69044
Author: Rodolfo García Peñas (kix) <[email protected]>
Date:   Mon Apr 8 19:40:44 2013 +0200

    New function set_icon_image_from_image
    
    The new function set_icon_image_from_image() sets the icon image using
    a image provided as argument.
    
    This function will be used to avoid call wIconUpdate() with the image
    argument, doing the code easier and faster.
    
    This patch calls unset_icon_image(), to free the icon image, to avoid
    lost memory. After this patch, in winspector.c, the wIconUpdate() call
    don't free the memory before update it.

diff --git a/src/icon.c b/src/icon.c
index 2c9b27d..eaca466 100644
--- a/src/icon.c
+++ b/src/icon.c
@@ -564,6 +564,17 @@ static void unset_icon_image(WIcon *icon)
        }
 }
 
+void set_icon_image_from_image(WIcon *icon, RImage *image)
+{
+       if (!icon)
+               return;
+
+       unset_icon_image(icon);
+
+       icon->file_image = NULL;
+       icon->file_image = image;
+}
+
 void wIconUpdate(WIcon *icon, RImage *image)
 {
        WWindow *wwin = NULL;
diff --git a/src/icon.h b/src/icon.h
index 4e030a8..93b8145 100644
--- a/src/icon.h
+++ b/src/icon.h
@@ -73,5 +73,6 @@ char *wIconStore(WIcon *icon);
 char *get_name_for_instance_class(char *wm_instance, char *wm_class);
 
 void wIconSetHighlited(WIcon *icon, Bool flag);
+void set_icon_image_from_image(WIcon *icon, RImage *image);
 
 #endif /* WMICON_H_ */
diff --git a/src/winspector.c b/src/winspector.c
index 8d5923a..acd2057 100644
--- a/src/winspector.c
+++ b/src/winspector.c
@@ -763,14 +763,27 @@ static void applySettings(WMButton *button, 
InspectorPanel *panel)
                 * the icon text box has an icon path */
                if (!WFLAGP(wwin, always_user_icon)) {
                        /* Change App Icon image, using the icon provided by 
the client */
-                       if (wapp->app_icon)
-                               wIconUpdate(wapp->app_icon->icon,
-                                           
get_rimage_icon_from_wm_hints(wapp->app_icon->icon));
+                       if (wapp->app_icon) {
+                               RImage *image = 
get_rimage_icon_from_wm_hints(wapp->app_icon->icon);
+                               if (image) {
+                                       
set_icon_image_from_image(wapp->app_icon->icon, image);
+                                       
update_icon_pixmap(wapp->app_icon->icon);
+                               } else {
+                                       wIconUpdate(wapp->app_icon->icon, NULL);
+                               }
+                       }
 
                        /* Change icon image if the app is minimized,
                         * using the icon provided by the client */
-                       if (wwin->icon)
-                               wIconUpdate(wwin->icon, 
get_rimage_icon_from_wm_hints(wwin->icon));
+                       if (wwin->icon) {
+                               RImage *image = 
get_rimage_icon_from_wm_hints(wwin->icon);
+                               if (image) {
+                                       set_icon_image_from_image(wwin->icon, 
image);
+                                       update_icon_pixmap(wwin->icon);
+                               } else {
+                                       wIconUpdate(wwin->icon, NULL);
+                               }
+                       }
                } else {
                        /* Change App Icon image */
                        if (wapp->app_icon)

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

Summary of changes:
 configure.ac     |    5 ++
 src/appicon.c    |    7 ++-
 src/client.c     |   22 +++------
 src/dock.c       |   28 ++++++++---
 src/icon.c       |  138 ++++++++++++++++++++++++++++--------------------------
 src/icon.h       |    5 +-
 src/window.h     |    1 -
 src/winspector.c |   23 +++++++--
 src/wmspec.c     |    8 ++--
 9 files changed, 134 insertions(+), 103 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