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  0f26c43371e5e7af43c99ecd941d6624b30ff9a7 (commit)
      from  6ae01b9d9045a4f8489ecd0dc4ee3bd847b6e736 (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/0f26c43371e5e7af43c99ecd941d6624b30ff9a7

commit 0f26c43371e5e7af43c99ecd941d6624b30ff9a7
Author: David Couzelis <[email protected]>
Date:   Thu Jan 12 20:36:52 2012 -0500

    Prevent removal of dock icons due to resolution changes
    
    I use xrandr to decrease the resolution of my display when I connect
    it to my TV. When I change the resolution back to my monitor, a few
    of the icons at the bottom of my dock are deleted.
    
    This happens because wmaker computes the maximum number of dockapps
    which the dock can hold based on the screen resolution:
    
            icon_count = scr->scr_height / wPreferences.icon_size;
    
    and drops the dockapps above that number (in wDockRestoreState()).
    
    But now the resolution can change via xrandr, so the above computation
    can lead to dockapps being dropped when the new resolution is smaller
    than it used to be.
    
    To fix this it's enough to have a resolution-invariant number of allowed
    dockapps.

diff --git a/src/dock.c b/src/dock.c
index 9d74b49..96d8c61 100644
--- a/src/dock.c
+++ b/src/dock.c
@@ -1080,22 +1080,16 @@ WDock *wDockCreate(WScreen * scr, int type)
 {
        WDock *dock;
        WAppIcon *btn;
-       int icon_count;
 
        make_keys();
 
        dock = wmalloc(sizeof(WDock));
        memset(dock, 0, sizeof(WDock));
 
-       if (type == WM_CLIP)
-               icon_count = CLIP_MAX_ICONS;
-       else
-               icon_count = scr->scr_height / wPreferences.icon_size;
-
-       dock->icon_array = wmalloc(sizeof(WAppIcon *) * icon_count);
-       memset(dock->icon_array, 0, sizeof(WAppIcon *) * icon_count);
+       dock->max_icons = DOCK_MAX_ICONS;
 
-       dock->max_icons = icon_count;
+       dock->icon_array = wmalloc(sizeof(WAppIcon *) * dock->max_icons);
+       memset(dock->icon_array, 0, sizeof(WAppIcon *) * dock->max_icons);
 
        btn = mainIconCreate(scr, type);
 
diff --git a/src/wconfig.h.in b/src/wconfig.h.in
index 5008ac6..5b70e53 100644
--- a/src/wconfig.h.in
+++ b/src/wconfig.h.in
@@ -325,8 +325,8 @@
  * Set this to zero if you want instant raise. */
 #define AUTO_RAISE_DELAY        600
 
-/* Max. number of icons the clip can have */
-#define CLIP_MAX_ICONS         32
+/* Max. number of icons the dock and clip can have */
+#define DOCK_MAX_ICONS         32
 
 /* blink interval when invoking a menu item */
 #define MENU_BLINK_DELAY       60000

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

Summary of changes:
 src/dock.c       |   12 +++---------
 src/wconfig.h.in |    4 ++--
 2 files changed, 5 insertions(+), 11 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 ("Fork from the last available CVS version of Window Maker")


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

Reply via email to