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  70c9208e4056121ad9e020a2bbbfd236c080d5fa (commit)
       via  97d7c32184724cde799b14c1f3ddc7dab651d1f3 (commit)
       via  d7fe9a5bcd9e4f1946692f5c9c9fd4de0fac5a31 (commit)
       via  74aa65abebd6f35480f92f6d6d6d43a574975f18 (commit)
      from  b9caaa8729fe39848308ce13e5a140f18f0b9102 (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/70c9208e4056121ad9e020a2bbbfd236c080d5fa

commit 70c9208e4056121ad9e020a2bbbfd236c080d5fa
Author: Rodolfo García Peñas (kix) <[email protected]>
Date:   Tue Jan 22 21:18:15 2013 +0100

    Simplify the application appicon creation
    
    This patch removes all the appicon stuff from the application creation
    to the appicon creation. Now, the application only calls one function
    (create_appicon_for_application()) and this function do all the work.
    
    The function do the same code than the code before this patch, but the
    only change is that the "if" test to check if the appicon was found in
    the docks now is negated, removing the return and doing the appicon_save
    inside the function.
    
    Finally, the old makeAppIconFor is now create_appicon_for_application().

diff --git a/src/appicon.c b/src/appicon.c
index c70d4df..573344c 100644
--- a/src/appicon.c
+++ b/src/appicon.c
@@ -71,6 +71,7 @@ static void wApplicationSaveIconPathFor(char *iconPath, char 
*wm_instance, char
 static WAppIcon *wAppIconCreate(WWindow * leader_win);
 static void add_to_appicon_list(WScreen *scr, WAppIcon *appicon);
 static void remove_from_appicon_list(WScreen *scr, WAppIcon *appicon);
+static void create_appicon_from_dock(WWindow *wwin, WApplication *wapp, Window 
main_window);
 
 /* This function is used if the application is a .app. It checks if it has an 
icon in it
  * like for example /usr/local/GNUstep/Applications/WPrefs.app/WPrefs.tiff
@@ -143,19 +144,24 @@ WAppIcon *wAppIconCreateForDock(WScreen *scr, char 
*command, char *wm_instance,
        return aicon;
 }
 
-void makeAppIconFor(WApplication *wapp)
+void create_appicon_for_application(WApplication *wapp, WWindow *wwin)
 {
-       /* If app_icon, work is done, return */
-       if (wapp->app_icon)
-               return;
+       /* Try to create an icon from the dock or clip */
+       create_appicon_from_dock(wwin, wapp, wapp->main_window);
 
-       /* Create the icon */
-       wapp->app_icon = wAppIconCreate(wapp->main_window_desc);
-       wIconUpdate(wapp->app_icon->icon, NULL);
+       /* If app_icon was not found, create it */
+       if (!wapp->app_icon) {
+               /* Create the icon */
+               wapp->app_icon = wAppIconCreate(wapp->main_window_desc);
+               wIconUpdate(wapp->app_icon->icon, NULL);
+
+               /* Now, paint the icon */
+               if (!WFLAGP(wapp->main_window_desc, no_appicon))
+                       paint_app_icon(wapp);
+       }
 
-       /* Now, paint the icon */
-       if (!WFLAGP(wapp->main_window_desc, no_appicon))
-               paint_app_icon(wapp);
+       /* Save the app_icon in a file */
+       save_appicon(wapp->app_icon, False);
 }
 
 void unpaint_app_icon(WApplication *wapp)
@@ -958,7 +964,7 @@ static WAppIcon *findDockIconFor(WDock *dock, Window 
main_window)
        return aicon;
 }
 
-void create_appicon_from_dock(WWindow *wwin, WApplication *wapp, Window 
main_window)
+static void create_appicon_from_dock(WWindow *wwin, WApplication *wapp, Window 
main_window)
 {
        WScreen *scr = wwin->screen_ptr;
        wapp->app_icon = NULL;
diff --git a/src/appicon.h b/src/appicon.h
index 6f72c8e..d63d9a7 100644
--- a/src/appicon.h
+++ b/src/appicon.h
@@ -72,11 +72,10 @@ typedef struct WAppIcon {
 WAppIcon *wAppIconCreateForDock(WScreen *scr, char *command, char *wm_instance,
                                char *wm_class, int tile);
 
-void create_appicon_from_dock(WWindow *wwin, WApplication *wapp, Window 
main_window);
 void wAppIconDestroy(WAppIcon *aicon);
 void wAppIconPaint(WAppIcon *aicon);
 void wAppIconMove(WAppIcon *aicon, int x, int y);
-void makeAppIconFor(WApplication * wapp);
+void create_appicon_for_application(WApplication *wapp, WWindow *wwin);
 void removeAppIconFor(WApplication * wapp);
 void save_appicon(WAppIcon *aicon, Bool dock);
 void paint_app_icon(WApplication *wapp);
diff --git a/src/application.c b/src/application.c
index b52a35f..abe1d2d 100644
--- a/src/application.c
+++ b/src/application.c
@@ -141,17 +141,7 @@ WApplication *wApplicationCreate(WWindow * wwin)
        /* application descriptor */
        XSaveContext(dpy, main_window, wAppWinContext, (XPointer) wapp);
 
-       /* First try to create an icon from the dock or clip */
-       create_appicon_from_dock(wwin, wapp, main_window);
-
-       /*
-        * In case it was not found in the dock, make it from scratch.
-        * Note: makeAppIconFor() returns early if wapp->app_icon exists
-        */
-       makeAppIconFor(wapp);
-
-       /* Save the app_icon in a file */
-       save_appicon(wapp->app_icon, False);
+       create_appicon_for_application(wapp, wwin);
 
        return wapp;
 }

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

commit 97d7c32184724cde799b14c1f3ddc7dab651d1f3
Author: Rodolfo García Peñas (kix) <[email protected]>
Date:   Tue Jan 22 21:18:14 2013 +0100

    New function set_icon_image_from_database
    
    The new function set_icon_image_from_database() removes the dup code
    from these functions:
    
    icon.c:icon_create_for_dock()
    icon.c:icon_create_for_wwindow()
    appicon.c:removeAppIconFor()
    
    The only different change is that in the functions icon_create_for_dock()
    and icon_create_for_wwindow(), the icon->tile_type assignment is done
    before set the icon image filename and icon image, but this variable
    is not used in these functions (is used in wIconUpdate function) but in both
    functions the icon->tile_type assignment is done before wIconUpdate(), like
    the code previous to this patch, so there is no problem moving 
icon->tile_type.

diff --git a/src/appicon.c b/src/appicon.c
index 9f51dac..c70d4df 100644
--- a/src/appicon.c
+++ b/src/appicon.c
@@ -240,8 +240,6 @@ void paint_app_icon(WApplication *wapp)
 
 void removeAppIconFor(WApplication *wapp)
 {
-       char *file = NULL;
-
        if (!wapp->app_icon)
                return;
 
@@ -257,16 +255,9 @@ void removeAppIconFor(WApplication *wapp)
                wapp->app_icon->icon->owner = NULL;
                wapp->app_icon->icon->icon_win = None;
 
-               /* Update the icon images */
-               /* Search the icon using instance and class, without default 
icon */
-               file = 
get_icon_filename(wapp->app_icon->icon->core->screen_ptr, 
wapp->app_icon->wm_instance, wapp->app_icon->wm_class, wapp->app_icon->command, 
False);
-               if (file) {
-                       wapp->app_icon->icon->file = wstrdup(file);
-                       wapp->app_icon->icon->file_image = 
get_rimage_from_file(wapp->app_icon->icon->core->screen_ptr, 
wapp->app_icon->icon->file, wPreferences.icon_size);
-                       wfree(file);
-               }
-
-               wIconUpdate(wapp->app_icon->icon, NULL);
+               /* Set the icon image */
+               set_icon_image_from_database(wapp->app_icon->icon, 
wapp->app_icon->wm_instance,
+                                            wapp->app_icon->wm_class, 
wapp->app_icon->command);
 
                /* Paint it */
                wAppIconPaint(wapp->app_icon);
diff --git a/src/icon.c b/src/icon.c
index 13a0c94..e88ec30 100644
--- a/src/icon.c
+++ b/src/icon.c
@@ -113,7 +113,6 @@ WIcon *icon_create_for_wwindow(WWindow *wwin)
 {
        WScreen *scr = wwin->screen_ptr;
        WIcon *icon;
-       char *file;
 
        icon = icon_create_core(scr, wwin->icon_x, wwin->icon_y);
 
@@ -141,17 +140,9 @@ WIcon *icon_create_for_wwindow(WWindow *wwin)
        else
                wGetIconName(dpy, wwin->client_win, &icon->icon_name);
 
-       /* Get the application icon, default included */
-       file = get_icon_filename(scr, wwin->wm_instance, wwin->wm_class, NULL, 
True);
-       if (file) {
-               icon->file = wstrdup(file);
-               icon->file_image = get_rimage_from_file(scr, icon->file, 
wPreferences.icon_size);
-               wfree(file);
-       }
-
        icon->tile_type = TILE_NORMAL;
 
-       wIconUpdate(icon, NULL);
+       set_icon_image_from_database(icon, wwin->wm_instance, wwin->wm_class, 
NULL);
 
        WMAddNotificationObserver(appearanceObserver, icon, 
WNIconAppearanceSettingsChanged, icon);
        WMAddNotificationObserver(tileObserver, icon, 
WNIconTileSettingsChanged, icon);
@@ -162,21 +153,11 @@ WIcon *icon_create_for_wwindow(WWindow *wwin)
 WIcon *icon_create_for_dock(WScreen *scr, char *command, char *wm_instance, 
char *wm_class, int tile)
 {
        WIcon *icon;
-       char *file = NULL;
 
        icon = icon_create_core(scr, 0, 0);
-
-       /* Search the icon using instance and class, without default icon */
-       file = get_icon_filename(scr, wm_instance, wm_class, command, False);
-       if (file) {
-               icon->file = wstrdup(file);
-               icon->file_image = get_rimage_from_file(scr, icon->file, 
wPreferences.icon_size);
-               wfree(file);
-       }
-
        icon->tile_type = tile;
 
-       wIconUpdate(icon, NULL);
+       set_icon_image_from_database(icon, wm_instance, wm_class, command);
 
        WMAddNotificationObserver(appearanceObserver, icon, 
WNIconAppearanceSettingsChanged, icon);
        WMAddNotificationObserver(tileObserver, icon, 
WNIconTileSettingsChanged, icon);
@@ -908,3 +889,17 @@ static void miniwindowMouseDown(WObjDescriptor * desc, 
XEvent * event)
                }
        }
 }
+
+void set_icon_image_from_database(WIcon *icon, char *wm_instance, char 
*wm_class, char *command)
+{
+       char *file = NULL;
+
+       file = get_icon_filename(icon->core->screen_ptr, wm_instance, wm_class, 
command, False);
+       if (file) {
+               icon->file = wstrdup(file);
+               icon->file_image = get_rimage_from_file(icon->core->screen_ptr, 
icon->file, wPreferences.icon_size);
+               wfree(file);
+       }
+
+       wIconUpdate(icon, NULL);
+}
diff --git a/src/icon.h b/src/icon.h
index c2a6b09..4e030a8 100644
--- a/src/icon.h
+++ b/src/icon.h
@@ -56,6 +56,7 @@ typedef struct WIcon {
 WIcon *icon_create_for_dock(WScreen *scr, char *command, char *wm_instance, 
char *wm_class, int tile);
 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);

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

commit d7fe9a5bcd9e4f1946692f5c9c9fd4de0fac5a31
Author: Rodolfo García Peñas (kix) <[email protected]>
Date:   Tue Jan 22 21:18:13 2013 +0100

    Update docked icon after kill dockapp
    
    This patch sets the correct icon after kill a docked application.
    To reproduce the problem (as Carlos reported to me), follow these
    steps:
    
    1. With a docked application, not running, set the icon image.
    2. Launch the docked application.
    3. Kill the application, using for example the app dock menu.
    
    The icon is lost. But if wmaker is restarted, the icon backs again.
    
    The problem is because when the application is closed, the function
    removeAppIconFor() calls wIconUpdate(), but this function doesn't
    find the icon in the file system again. The icon is loaded from the
    filesystem only when the application is created.
    
    This patch creates the icon image again, then calls wIconUpdate() to
    set the icon image or the default icon image if the icon image was
    not found, then wPaint it.
    
    These lines comes from the create_appicon_from_* functions, used
    to set the icon image for docks and applications. Are copy/pasted.

diff --git a/src/appicon.c b/src/appicon.c
index 902559c..9f51dac 100644
--- a/src/appicon.c
+++ b/src/appicon.c
@@ -240,6 +240,8 @@ void paint_app_icon(WApplication *wapp)
 
 void removeAppIconFor(WApplication *wapp)
 {
+       char *file = NULL;
+
        if (!wapp->app_icon)
                return;
 
@@ -256,6 +258,14 @@ void removeAppIconFor(WApplication *wapp)
                wapp->app_icon->icon->icon_win = None;
 
                /* Update the icon images */
+               /* Search the icon using instance and class, without default 
icon */
+               file = 
get_icon_filename(wapp->app_icon->icon->core->screen_ptr, 
wapp->app_icon->wm_instance, wapp->app_icon->wm_class, wapp->app_icon->command, 
False);
+               if (file) {
+                       wapp->app_icon->icon->file = wstrdup(file);
+                       wapp->app_icon->icon->file_image = 
get_rimage_from_file(wapp->app_icon->icon->core->screen_ptr, 
wapp->app_icon->icon->file, wPreferences.icon_size);
+                       wfree(file);
+               }
+
                wIconUpdate(wapp->app_icon->icon, NULL);
 
                /* Paint it */

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

commit 74aa65abebd6f35480f92f6d6d6d43a574975f18
Author: Carlos R. Mafra <[email protected]>
Date:   Tue Dec 18 19:10:15 2012 +0000

    Window placement: Enforce center position
    
    When the "Center" choice for window position is chosen, really enforce
    the center position for all windows, instead of falling back to "Auto"
    when there are already windows on the workspace.
    
    Signed-off-by: Carlos R. Mafra <[email protected]>

diff --git a/src/placement.c b/src/placement.c
index b30e0af..f9667d2 100644
--- a/src/placement.c
+++ b/src/placement.c
@@ -364,10 +364,7 @@ static Bool
 center_place_window(WWindow *wwin, int *x_ret, int *y_ret,
                 unsigned int width, unsigned int height, WArea usableArea)
 {
-       WScreen *scr = wwin->screen_ptr;
-       int try_x, try_y;
        int swidth, sheight;
-       WWindow *win;
 
        set_width_height(wwin, &width, &height);
        swidth = usableArea.x2 - usableArea.x1;
@@ -376,26 +373,8 @@ center_place_window(WWindow *wwin, int *x_ret, int *y_ret,
        if (width > swidth || height > sheight)
                return False;
 
-       try_x = (usableArea.x1 + usableArea.x2 - width) / 2;
-       try_y = (usableArea.y1 + usableArea.y2 - height) / 2;
-
-       for (win = scr->focused_window; win != NULL; win = win->next) {
-               int w = win->frame->core->width;
-               int h = win->frame->core->height;
-               int x = win->frame_x;
-               int y = win->frame_y;
-
-               if ((x < (try_x + width)) && ((x + w) > try_x) &&
-                   (y < (try_y + height)) && ((y + h) > try_y) &&
-                   (win->flags.mapped ||
-                    (win->flags.shaded &&
-                     win->frame->workspace == scr->current_workspace &&
-                     !(win->flags.miniaturized || win->flags.hidden))))
-                       return False;
-       }
-
-       *x_ret = try_x;
-       *y_ret = try_y;
+       *x_ret = (usableArea.x1 + usableArea.x2 - width) / 2;
+       *y_ret = (usableArea.y1 + usableArea.y2 - height) / 2;
 
        return True;
 }
@@ -545,7 +524,6 @@ void PlaceWindow(WWindow *wwin, int *x_ret, int *y_ret, 
unsigned width, unsigned
        case WPM_CENTER:
                if (center_place_window(wwin, x_ret, y_ret, width, height, 
usableArea))
                        break;
-               /* fall through to auto placement */
 
        case WPM_AUTO:
                if (autoPlaceWindow(wwin, x_ret, y_ret, width, height, 0, 
usableArea)) {

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

Summary of changes:
 src/appicon.c     |   33 ++++++++++++++++++++-------------
 src/appicon.h     |    3 +--
 src/application.c |   12 +-----------
 src/icon.c        |   37 ++++++++++++++++---------------------
 src/icon.h        |    1 +
 src/placement.c   |   26 ++------------------------
 6 files changed, 41 insertions(+), 71 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