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
  discards  d6a021ddf6521aa9514c8bd84977fe98dec49378 (commit)
  discards  a32bfddafb21b94e69c7dbad898600643e7d581c (commit)
  discards  f87997542a1e93d30a62dfc3dcd50a17ce457d22 (commit)
  discards  14d06ba1e168141e81e6303d72564913beea795b (commit)
       via  cc30444dda23f40881e29ff3f7bb4414b824513f (commit)
       via  aee0ad45f27d7af9b270692aa35d8ad734c8213e (commit)
       via  e6e3e1aa49f9c069372cd6bc4e792f9570448959 (commit)
       via  753f44c4b703b7451b7c79299bb80e074a51e534 (commit)
       via  2755b1e45d9d1217f337e5c6a36794c6095d099c (commit)
       via  975d4becf16bb62372cc6e7918c49e8cd33c6053 (commit)

This update added new revisions after undoing existing revisions.  That is
to say, the old revision is not a strict subset of the new revision.  This
situation occurs when you --force push a change and generate a repository
containing something like this:

 * -- * -- B -- O -- O -- O (d6a021ddf6521aa9514c8bd84977fe98dec49378)
                         N -- N -- N (cc30444dda23f40881e29ff3f7bb4414b824513f)

When this happens we assume that you've already had alert emails for all
of the O revisions, and so we here report only the revisions in the N
branch from the common base, B.

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/cc30444dda23f40881e29ff3f7bb4414b824513f

commit cc30444dda23f40881e29ff3f7bb4414b824513f
Author: Tobias Stoeckmann <tob...@openbsd.org>
Date:   Fri May 4 22:53:04 2012 +0200

    No need to call memset after wmalloc
    
    memset is the last function call in wmalloc, just before it returns the
    newly allocated memory.  Therefore it is not needed to call it again
    after wmalloc call.  Although I would prefer to switch wmalloc to a
    calloc-based wcalloc function, the compatibility of WINGs for old apps
    should be kept.

diff --git a/WINGs/data.c b/WINGs/data.c
index ab0454e..2133b80 100644
--- a/WINGs/data.c
+++ b/WINGs/data.c
@@ -60,7 +60,6 @@ WMData *WMCreateDataWithLength(unsigned length)
 
        aData = WMCreateDataWithCapacity(length);
        if (length > 0) {
-               memset(aData->bytes, 0, length);
                aData->length = length;
        }
 
diff --git a/WINGs/hashtable.c b/WINGs/hashtable.c
index 9822c4e..27e71e4 100644
--- a/WINGs/hashtable.c
+++ b/WINGs/hashtable.c
@@ -98,14 +98,12 @@ WMHashTable *WMCreateHashTable(WMHashTableCallbacks 
callbacks)
        HashTable *table;
 
        table = wmalloc(sizeof(HashTable));
-       memset(table, 0, sizeof(HashTable));
 
        table->callbacks = callbacks;
 
        table->size = INITIAL_CAPACITY;
 
        table->table = wmalloc(sizeof(HashItem *) * table->size);
-       memset(table->table, 0, sizeof(HashItem *) * table->size);
 
        return table;
 }
@@ -131,8 +129,9 @@ void WMResetHashTable(WMHashTable * table)
                wfree(table->table);
                table->size = INITIAL_CAPACITY;
                table->table = wmalloc(sizeof(HashItem *) * table->size);
+       } else {
+               memset(table->table, 0, sizeof(HashItem *) * table->size);
        }
-       memset(table->table, 0, sizeof(HashItem *) * table->size);
 }
 
 void WMFreeHashTable(WMHashTable * table)
diff --git a/WINGs/proplist.c b/WINGs/proplist.c
index 4121494..7b0f49d 100644
--- a/WINGs/proplist.c
+++ b/WINGs/proplist.c
@@ -1458,7 +1458,6 @@ WMPropList *WMCreatePropListFromDescription(char *desc)
        PLData *pldata;
 
        pldata = (PLData *) wmalloc(sizeof(PLData));
-       memset(pldata, 0, sizeof(PLData));
        pldata->ptr = desc;
        pldata->lineNumber = 1;
 
@@ -1510,7 +1509,6 @@ WMPropList *WMReadPropListFromFile(char *file)
        }
 
        pldata = (PLData *) wmalloc(sizeof(PLData));
-       memset(pldata, 0, sizeof(PLData));
        pldata->ptr = (char *)wmalloc(length + 1);
        pldata->filename = file;
        pldata->lineNumber = 1;
diff --git a/WINGs/wbutton.c b/WINGs/wbutton.c
index ae4ed4e..3771684 100644
--- a/WINGs/wbutton.c
+++ b/WINGs/wbutton.c
@@ -105,7 +105,6 @@ WMButton *WMCreateCustomButton(WMWidget * parent, int 
behaviourMask)
        Button *bPtr;
 
        bPtr = wmalloc(sizeof(Button));
-       memset(bPtr, 0, sizeof(Button));
 
        bPtr->widgetClass = WC_Button;
 
diff --git a/WINGs/wfontpanel.c b/WINGs/wfontpanel.c
index 3cf14c8..55b5a1d 100644
--- a/WINGs/wfontpanel.c
+++ b/WINGs/wfontpanel.c
@@ -492,7 +492,6 @@ static void addFontToXftFamily(WMHashTable * families, char 
*name, char *style)
        array = WMCreateArray(8);
 
        fam = wmalloc(sizeof(Family));
-       memset(fam, 0, sizeof(Family));
 
        fam->name = wstrdup(name);
 
diff --git a/WPrefs.app/Appearance.c b/WPrefs.app/Appearance.c
index 47eafd4..3dfe891 100644
--- a/WPrefs.app/Appearance.c
+++ b/WPrefs.app/Appearance.c
@@ -895,7 +895,6 @@ static void okNewTexture(void *data)
        WMScreen *scr = WMWidgetScreen(panel->parent);
 
        titem = wmalloc(sizeof(TextureListItem));
-       memset(titem, 0, sizeof(TextureListItem));
 
        HideTexturePanel(panel->texturePanel);
 
@@ -1275,7 +1274,6 @@ static void fillTextureList(WMList * lPtr)
                texture = WMGetFromPLArray(textureList, i);
 
                titem = wmalloc(sizeof(TextureListItem));
-               memset(titem, 0, sizeof(TextureListItem));
 
                titem->title = 
wstrdup(WMGetFromPLString(WMGetFromPLArray(texture, 0)));
                titem->prop = WMRetainPropList(WMGetFromPLArray(texture, 1));
@@ -1876,7 +1874,6 @@ static void setupTextureFor(WMList * list, char *key, 
char *defValue, char *titl
        TextureListItem *titem;
 
        titem = wmalloc(sizeof(TextureListItem));
-       memset(titem, 0, sizeof(TextureListItem));
 
        titem->title = wstrdup(title);
        titem->prop = GetObjectForKey(key);
@@ -2044,7 +2041,6 @@ Panel *InitAppearance(WMScreen * scr, WMWindow * win)
        _Panel *panel;
 
        panel = wmalloc(sizeof(_Panel));
-       memset(panel, 0, sizeof(_Panel));
 
        panel->sectionName = _("Appearance Preferences");
 
diff --git a/WPrefs.app/Configurations.c b/WPrefs.app/Configurations.c
index a19e947..952fd26 100644
--- a/WPrefs.app/Configurations.c
+++ b/WPrefs.app/Configurations.c
@@ -467,7 +467,6 @@ Panel *InitConfigurations(WMScreen *scr, WMWidget *parent)
        _Panel *panel;
 
        panel = wmalloc(sizeof(_Panel));
-       memset(panel, 0, sizeof(_Panel));
 
        panel->sectionName = _("Other Configurations");
        panel->description = _("Animation speeds, titlebar styles, various 
optionn"
diff --git a/WPrefs.app/Expert.c b/WPrefs.app/Expert.c
index 04b1648..b14f549 100644
--- a/WPrefs.app/Expert.c
+++ b/WPrefs.app/Expert.c
@@ -139,7 +139,6 @@ Panel *InitExpert(WMScreen * scr, WMWidget * parent)
        _Panel *panel;
 
        panel = wmalloc(sizeof(_Panel));
-       memset(panel, 0, sizeof(_Panel));
 
        panel->sectionName = _("Expert User Preferences");
 
diff --git a/WPrefs.app/Focus.c b/WPrefs.app/Focus.c
index 99a49ea..8a37af5 100644
--- a/WPrefs.app/Focus.c
+++ b/WPrefs.app/Focus.c
@@ -327,7 +327,6 @@ Panel *InitFocus(WMScreen * scr, WMWindow * win)
        _Panel *panel;
 
        panel = wmalloc(sizeof(_Panel));
-       memset(panel, 0, sizeof(_Panel));
 
        panel->sectionName = _("Window Focus Preferences");
        panel->description = _("Keyboard focus switching policy and related 
options.");
diff --git a/WPrefs.app/FontSimple.c b/WPrefs.app/FontSimple.c
index 715b343..cde17b0 100644
--- a/WPrefs.app/FontSimple.c
+++ b/WPrefs.app/FontSimple.c
@@ -712,7 +712,6 @@ Panel *InitFontSimple(WMScreen * scr, WMWidget * parent)
        _Panel *panel;
 
        panel = wmalloc(sizeof(_Panel));
-       memset(panel, 0, sizeof(_Panel));
 
        panel->sectionName = _("Font Configuration");
 
diff --git a/WPrefs.app/Icons.c b/WPrefs.app/Icons.c
index b70caa4..599dfb0 100644
--- a/WPrefs.app/Icons.c
+++ b/WPrefs.app/Icons.c
@@ -316,7 +316,6 @@ Panel *InitIcons(WMScreen * scr, WMWidget * parent)
        _Panel *panel;
 
        panel = wmalloc(sizeof(_Panel));
-       memset(panel, 0, sizeof(_Panel));
 
        panel->sectionName = _("Icon Preferences");
 
diff --git a/WPrefs.app/KeyboardSettings.c b/WPrefs.app/KeyboardSettings.c
index 5a67a7f..3dc27eb 100644
--- a/WPrefs.app/KeyboardSettings.c
+++ b/WPrefs.app/KeyboardSettings.c
@@ -160,7 +160,6 @@ Panel *InitKeyboardSettings(WMScreen * scr, WMWidget * 
parent)
        _Panel *panel;
 
        panel = wmalloc(sizeof(_Panel));
-       memset(panel, 0, sizeof(_Panel));
 
        panel->sectionName = _("Keyboard Preferences");
 
diff --git a/WPrefs.app/KeyboardShortcuts.c b/WPrefs.app/KeyboardShortcuts.c
index aad8f33..5718653 100644
--- a/WPrefs.app/KeyboardShortcuts.c
+++ b/WPrefs.app/KeyboardShortcuts.c
@@ -512,7 +512,6 @@ static void createPanel(Panel * p)
 
        panel->actionCount = WMGetListNumberOfRows(panel->actLs);
        panel->shortcuts = wmalloc(sizeof(char *) * panel->actionCount);
-       memset(panel->shortcuts, 0, sizeof(char *) * panel->actionCount);
 
     /***************** Shortcut ****************/
 
@@ -583,7 +582,6 @@ Panel *InitKeyboardShortcuts(WMScreen * scr, WMWidget * 
parent)
        _Panel *panel;
 
        panel = wmalloc(sizeof(_Panel));
-       memset(panel, 0, sizeof(_Panel));
 
        panel->sectionName = _("Keyboard Shortcut Preferences");
 
diff --git a/WPrefs.app/Menu.c b/WPrefs.app/Menu.c
index 342e7f0..e9eaa9b 100644
--- a/WPrefs.app/Menu.c
+++ b/WPrefs.app/Menu.c
@@ -155,7 +155,7 @@ static char *commandNames[] = {
        "LEGAL_PANEL"
 };
 
-#define NEW(type) memset(wmalloc(sizeof(type)), 0, sizeof(type))
+#define NEW(type) wmalloc(sizeof(type))
 
 #define ICON_FILE      "menus"
 
@@ -1656,7 +1656,6 @@ Panel *InitMenu(WMScreen * scr, WMWidget * parent)
        _Panel *panel;
 
        panel = wmalloc(sizeof(_Panel));
-       memset(panel, 0, sizeof(_Panel));
 
        panel->sectionName = _("Applications Menu Definition");
 
diff --git a/WPrefs.app/MenuPreferences.c b/WPrefs.app/MenuPreferences.c
index a579858..b56e8e2 100644
--- a/WPrefs.app/MenuPreferences.c
+++ b/WPrefs.app/MenuPreferences.c
@@ -220,7 +220,6 @@ Panel *InitMenuPreferences(WMScreen * scr, WMWidget * 
parent)
        _Panel *panel;
 
        panel = wmalloc(sizeof(_Panel));
-       memset(panel, 0, sizeof(_Panel));
 
        panel->sectionName = _("Menu Preferences");
 
diff --git a/WPrefs.app/MouseSettings.c b/WPrefs.app/MouseSettings.c
index ba6801d..b1ed9fc 100644
--- a/WPrefs.app/MouseSettings.c
+++ b/WPrefs.app/MouseSettings.c
@@ -790,7 +790,6 @@ Panel *InitMouseSettings(WMScreen * scr, WMWidget * parent)
        wheelActions[1] = wstrdup(_("Switch Workspaces"));
 
        panel = wmalloc(sizeof(_Panel));
-       memset(panel, 0, sizeof(_Panel));
 
        panel->sectionName = _("Mouse Preferences");
 
diff --git a/WPrefs.app/Paths.c b/WPrefs.app/Paths.c
index b886e2e..ed515e5 100644
--- a/WPrefs.app/Paths.c
+++ b/WPrefs.app/Paths.c
@@ -307,7 +307,6 @@ Panel *InitPaths(WMScreen * scr, WMWidget * parent)
        _Panel *panel;
 
        panel = wmalloc(sizeof(_Panel));
-       memset(panel, 0, sizeof(_Panel));
 
        panel->sectionName = _("Search Path Configuration");
 
diff --git a/WPrefs.app/Preferences.c b/WPrefs.app/Preferences.c
index 2c60f05..6d0217d 100644
--- a/WPrefs.app/Preferences.c
+++ b/WPrefs.app/Preferences.c
@@ -325,7 +325,6 @@ Panel *InitPreferences(WMScreen * scr, WMWidget * parent)
        _Panel *panel;
 
        panel = wmalloc(sizeof(_Panel));
-       memset(panel, 0, sizeof(_Panel));
 
        panel->sectionName = _("Miscellaneous Ergonomic Preferences");
        panel->description = _("Various settings like balloon text, geometryn" 
"displays etc.");
diff --git a/WPrefs.app/TexturePanel.c b/WPrefs.app/TexturePanel.c
index ae3ee64..ad78b20 100644
--- a/WPrefs.app/TexturePanel.c
+++ b/WPrefs.app/TexturePanel.c
@@ -463,7 +463,6 @@ static void gradAddCallback(WMWidget * w, void *data)
        row = WMGetListSelectedItemRow(panel->gcolL) + 1;
        item = WMInsertListItem(panel->gcolL, row, "00,00,00");
        rgb = wmalloc(sizeof(RColor));
-       memset(rgb, 0, sizeof(RColor));
        item->clientData = rgb;
 
        WMSelectListItem(panel->gcolL, row);
@@ -1120,7 +1119,6 @@ TexturePanel *CreateTexturePanel(WMWindow * keyWindow)
        WMScreen *scr = WMWidgetScreen(keyWindow);
 
        panel = wmalloc(sizeof(TexturePanel));
-       memset(panel, 0, sizeof(TexturePanel));
 
        panel->listFont = WMSystemFontOfSize(scr, 12);
 
diff --git a/WPrefs.app/Themes.c b/WPrefs.app/Themes.c
index 0416808..453dd5c 100644
--- a/WPrefs.app/Themes.c
+++ b/WPrefs.app/Themes.c
@@ -207,7 +207,6 @@ Panel *InitThemes(WMScreen * scr, WMWidget * parent)
        _Panel *panel;
 
        panel = wmalloc(sizeof(_Panel));
-       memset(panel, 0, sizeof(_Panel));
 
        panel->sectionName = _("Themes");
 
diff --git a/WPrefs.app/WindowHandling.c b/WPrefs.app/WindowHandling.c
index 88b5fef..0770ed5 100644
--- a/WPrefs.app/WindowHandling.c
+++ b/WPrefs.app/WindowHandling.c
@@ -500,7 +500,6 @@ Panel *InitWindowHandling(WMScreen * scr, WMWidget * parent)
        _Panel *panel;
 
        panel = wmalloc(sizeof(_Panel));
-       memset(panel, 0, sizeof(_Panel));
 
        panel->sectionName = _("Window Handling Preferences");
 
diff --git a/WPrefs.app/Workspace.c b/WPrefs.app/Workspace.c
index cdc0727..6ba26fc 100644
--- a/WPrefs.app/Workspace.c
+++ b/WPrefs.app/Workspace.c
@@ -327,7 +327,6 @@ Panel *InitWorkspace(WMScreen * scr, WMWidget * parent)
        _Panel *panel;
 
        panel = wmalloc(sizeof(_Panel));
-       memset(panel, 0, sizeof(_Panel));
 
        panel->sectionName = _("Workspace Preferences");
 
diff --git a/WPrefs.app/double.c b/WPrefs.app/double.c
index 92bcee2..d708b0d 100644
--- a/WPrefs.app/double.c
+++ b/WPrefs.app/double.c
@@ -55,8 +55,6 @@ DoubleTest *CreateDoubleTest(WMWidget * parent, char *text)
 
        /* allocate some storage for our new widget instance */
        dPtr = wmalloc(sizeof(DoubleTest));
-       /* initialize it */
-       memset(dPtr, 0, sizeof(DoubleTest));
 
        /* set the class ID */
        dPtr->widgetClass = DoubleTestClass;
diff --git a/WPrefs.app/editmenu.c b/WPrefs.app/editmenu.c
index c5c3f41..244a5be 100644
--- a/WPrefs.app/editmenu.c
+++ b/WPrefs.app/editmenu.c
@@ -125,8 +125,6 @@ WEditMenuItem *WCreateEditMenuItem(WMWidget * parent, char 
*title, Bool isTitle)
 
        iPtr = wmalloc(sizeof(WEditMenuItem));
 
-       memset(iPtr, 0, sizeof(WEditMenuItem));
-
        iPtr->widgetClass = EditMenuItemClass;
 
        iPtr->view = W_CreateView(W_VIEW(parent));
@@ -373,7 +371,6 @@ static WEditMenu *makeEditMenu(WMScreen * scr, WMWidget * 
parent, char *title)
                InitEditMenu(scr);
 
        mPtr = wmalloc(sizeof(WEditMenu));
-       memset(mPtr, 0, sizeof(WEditMenu));
 
        mPtr->widgetClass = EditMenuClass;
 
diff --git a/src/appicon.c b/src/appicon.c
index 80f08f4..198fe53 100644
--- a/src/appicon.c
+++ b/src/appicon.c
@@ -69,7 +69,6 @@ WAppIcon *wAppIconCreateForDock(WScreen * scr, char *command, 
char *wm_instance,
 
        dicon = wmalloc(sizeof(WAppIcon));
        wretain(dicon);
-       memset(dicon, 0, sizeof(WAppIcon));
        dicon->yindex = -1;
        dicon->xindex = -1;
 
@@ -122,7 +121,6 @@ WAppIcon *wAppIconCreate(WWindow * leader_win)
 
        aicon = wmalloc(sizeof(WAppIcon));
        wretain(aicon);
-       memset(aicon, 0, sizeof(WAppIcon));
 
        aicon->yindex = -1;
        aicon->xindex = -1;
diff --git a/src/application.c b/src/application.c
index 584c0aa..18ff57b 100644
--- a/src/application.c
+++ b/src/application.c
@@ -246,7 +246,6 @@ WApplication *wApplicationCreate(WWindow * wwin)
        }
 
        wapp = wmalloc(sizeof(WApplication));
-       memset(wapp, 0, sizeof(WApplication));
 
        wapp->refcount = 1;
        wapp->last_focused = NULL;
diff --git a/src/balloon.c b/src/balloon.c
index 517dc92..c00375a 100644
--- a/src/balloon.c
+++ b/src/balloon.c
@@ -479,7 +479,6 @@ void wBalloonInitialize(WScreen * scr)
        unsigned long vmask;
 
        bal = wmalloc(sizeof(WBalloon));
-       memset(bal, 0, sizeof(WBalloon));
 
        scr->balloon = bal;
 
diff --git a/src/defaults.c b/src/defaults.c
index 1f6b6eb..40c4122 100644
--- a/src/defaults.c
+++ b/src/defaults.c
@@ -813,7 +813,6 @@ WDDomain *wDefaultsInitDomain(char *domain, Bool 
requireDictionary)
        }
 
        db = wmalloc(sizeof(WDDomain));
-       memset(db, 0, sizeof(WDDomain));
        db->domain_name = domain;
        db->path = wdefaultspathfordomain(domain);
        the_path = db->path;
diff --git a/src/dialog.c b/src/dialog.c
index e4c8f34..f2ec900 100644
--- a/src/dialog.c
+++ b/src/dialog.c
@@ -885,7 +885,6 @@ Bool wIconChooserDialog(WScreen * scr, char **file, char 
*instance, char *class)
        Bool result;
 
        panel = wmalloc(sizeof(IconPanel));
-       memset(panel, 0, sizeof(IconPanel));
 
        panel->scr = scr;
 
@@ -1128,7 +1127,6 @@ void wShowInfoPanel(WScreen * scr)
        }
 
        panel = wmalloc(sizeof(InfoPanel));
-       memset(panel, 0, sizeof(InfoPanel));
 
        panel->scr = scr;
 
@@ -1521,7 +1519,6 @@ int wShowCrashingDialogPanel(int whatSig)
        char buf[256];
 
        panel = wmalloc(sizeof(CrashPanel));
-       memset(panel, 0, sizeof(CrashPanel));
 
        screen_no = DefaultScreen(dpy);
        scr_width = WidthOfScreen(ScreenOfDisplay(dpy, screen_no));
diff --git a/src/dock.c b/src/dock.c
index 61d70f0..9d12814 100644
--- a/src/dock.c
+++ b/src/dock.c
@@ -1057,12 +1057,10 @@ WDock *wDockCreate(WScreen *scr, int type)
        make_keys();
 
        dock = wmalloc(sizeof(WDock));
-       memset(dock, 0, sizeof(WDock));
 
        dock->max_icons = DOCK_MAX_ICONS;
 
        dock->icon_array = wmalloc(sizeof(WAppIcon *) * dock->max_icons);
-       memset(dock->icon_array, 0, sizeof(WAppIcon *) * dock->max_icons);
 
        btn = mainIconCreate(scr, type);
 
@@ -1788,7 +1786,6 @@ void wDockDoAutoLaunch(WDock *dock, int workspace)
                        continue;
 
                state = wmalloc(sizeof(WSavedState));
-               memset(state, 0, sizeof(WSavedState));
                state->workspace = workspace;
                /* TODO: this is klugy and is very difficult to understand
                 * what's going on. Try to clean up */
@@ -2448,9 +2445,7 @@ Bool wDockFindFreeSlot(WDock *dock, int *x_pos, int 
*y_pos)
                hcount = WMIN(dock->max_icons, scr->scr_width / ICON_SIZE);
                vcount = WMIN(dock->max_icons, scr->scr_height / ICON_SIZE);
                hmap = wmalloc(hcount + 1);
-               memset(hmap, 0, hcount + 1);
                vmap = wmalloc(vcount + 1);
-               memset(vmap, 0, vcount + 1);
 
                /* mark used positions */
                switch (corner) {
@@ -2582,7 +2577,6 @@ Bool wDockFindFreeSlot(WDock *dock, int *x_pos, int 
*y_pos)
        r = (mwidth - 1) / 2;
 
        slot_map = wmalloc(mwidth * mwidth);
-       memset(slot_map, 0, mwidth * mwidth);
 
 #define XY2OFS(x,y) (WMAX(abs(x),abs(y)) > r) ? 0 : (((y)+r)*(mwidth)+(x)+r)
 
@@ -2744,7 +2738,6 @@ static pid_t execCommand(WAppIcon *btn, char *command, 
WSavedState *state)
        if (pid > 0) {
                if (!state) {
                        state = wmalloc(sizeof(WSavedState));
-                       memset(state, 0, sizeof(WSavedState));
                        state->hidden = -1;
                        state->miniaturized = -1;
                        state->shaded = -1;
diff --git a/src/dockedapp.c b/src/dockedapp.c
index 944e025..5ef64f6 100644
--- a/src/dockedapp.c
+++ b/src/dockedapp.c
@@ -264,7 +264,6 @@ void ShowDockAppSettingsPanel(WAppIcon * aicon)
        WMBox *vbox;
 
        panel = wmalloc(sizeof(AppSettingsPanel));
-       memset(panel, 0, sizeof(AppSettingsPanel));
 
        panel->editedIcon = aicon;
 
diff --git a/src/event.c b/src/event.c
index 8e950a2..d31ba35 100644
--- a/src/event.c
+++ b/src/event.c
@@ -966,7 +966,6 @@ static void handleClientMessage(XEvent * event)
 
                len = sizeof(event->xclient.data.b) + 1;
                command = wmalloc(len);
-               memset(command, 0, len);
                strncpy(command, event->xclient.data.b, 
sizeof(event->xclient.data.b));
 
                if (strncmp(command, "Reconfigure", sizeof("Reconfigure")) == 
0) {
diff --git a/src/framewin.c b/src/framewin.c
index 73f68b2..2d3c009 100644
--- a/src/framewin.c
+++ b/src/framewin.c
@@ -67,7 +67,6 @@ WFrameWindow *wFrameWindowCreate(WScreen * scr, int wlevel, 
int x, int y,
        WFrameWindow *fwin;
 
        fwin = wmalloc(sizeof(WFrameWindow));
-       memset(fwin, 0, sizeof(WFrameWindow));
 
        fwin->screen_ptr = scr;
 
diff --git a/src/icon.c b/src/icon.c
index 73dae74..2a6d774 100644
--- a/src/icon.c
+++ b/src/icon.c
@@ -189,7 +189,6 @@ static WIcon *wIconCreateCore(WScreen *scr, int coord_x, 
int coord_y)
        XSetWindowAttributes attribs;
 
        icon = wmalloc(sizeof(WIcon));
-       memset(icon, 0, sizeof(WIcon));
        icon->core = wCoreCreateTopLevel(scr,
                                         coord_x,
                                         coord_y,
diff --git a/src/menu.c b/src/menu.c
index 2d26ee7..f438385 100644
--- a/src/menu.c
+++ b/src/menu.c
@@ -146,8 +146,6 @@ WMenu *wMenuCreate(WScreen * screen, char *title, int 
main_menu)
 
        menu = wmalloc(sizeof(WMenu));
 
-       memset(menu, 0, sizeof(WMenu));
-
 #ifdef SINGLE_MENULEVEL
        tmp = WMSubmenuLevel;
 #else
@@ -274,7 +272,6 @@ WMenuEntry *wMenuInsertCallback(WMenu * menu, int index, 
char *text,
                menu->brother->alloced_entries = menu->alloced_entries;
        }
        entry = wmalloc(sizeof(WMenuEntry));
-       memset(entry, 0, sizeof(WMenuEntry));
        entry->flags.enabled = 1;
        entry->text = wstrdup(text);
        entry->cascade = -1;
diff --git a/src/pixmap.c b/src/pixmap.c
index 62c4ceb..d6b9431 100644
--- a/src/pixmap.c
+++ b/src/pixmap.c
@@ -53,7 +53,6 @@ WPixmap *wPixmapCreateFromXPMData(WScreen * scr, char **data)
                return NULL;
 
        pix = wmalloc(sizeof(WPixmap));
-       memset(pix, 0, sizeof(WPixmap));
 
        RConvertImageMask(scr->rcontext, image, &pix->image, &pix->mask, 128);
 
@@ -83,7 +82,6 @@ WPixmap *wPixmapCreateFromXBMData(WScreen * scr, char *data, 
char *mask,
        WPixmap *pix;
 
        pix = wmalloc(sizeof(WPixmap));
-       memset(pix, 0, sizeof(WPixmap));
        pix->image = XCreatePixmapFromBitmapData(dpy, scr->w_win, data, width, 
height, fg, bg, scr->w_depth);
        if (pix->image == None) {
                wfree(pix);
@@ -108,7 +106,6 @@ WPixmap *wPixmapCreate(WScreen * scr, Pixmap image, Pixmap 
mask)
        unsigned int width, height, depth, baz;
 
        pix = wmalloc(sizeof(WPixmap));
-       memset(pix, 0, sizeof(WPixmap));
        pix->image = image;
        pix->mask = mask;
        if (!XGetGeometry(dpy, image, &foo, &bar, &bar, &width, &height, &baz, 
&depth)) {
diff --git a/src/placement.c b/src/placement.c
index a3cdd23..93ba39a 100644
--- a/src/placement.c
+++ b/src/placement.c
@@ -169,7 +169,6 @@ void PlaceIcon(WScreen *scr, int *x_ret, int *y_ret, int 
head)
         * but complexity is much better (faster) than it.
         */
        map = wmalloc((sw + 2) * (sh + 2));
-       memset(map, 0, (sw + 2) * (sh + 2));
 
 #define INDEX(x,y)     (((y)+1)*(sw+2) + (x) + 1)
 
diff --git a/src/screen.c b/src/screen.c
index b0fb88e..4f279f0 100644
--- a/src/screen.c
+++ b/src/screen.c
@@ -519,7 +519,6 @@ WScreen *wScreenInit(int screen_number)
        int i;
 
        scr = wmalloc(sizeof(WScreen));
-       memset(scr, 0, sizeof(WScreen));
 
        scr->stacking_list = WMCreateTreeBag();
 
diff --git a/src/session.c b/src/session.c
index 9dba574..421150b 100644
--- a/src/session.c
+++ b/src/session.c
@@ -370,7 +370,6 @@ static WSavedState *getWindowState(WScreen * scr, 
WMPropList * win_state)
        unsigned mask;
        int i;
 
-       memset(state, 0, sizeof(WSavedState));
        state->workspace = -1;
        value = WMGetFromPLDictionary(win_state, sWorkspace);
        if (value && WMIsPLString(value)) {
diff --git a/src/switchpanel.c b/src/switchpanel.c
index 23972a1..8e9e9f6 100644
--- a/src/switchpanel.c
+++ b/src/switchpanel.c
@@ -435,8 +435,6 @@ WSwitchPanel *wInitSwitchPanel(WScreen * scr, WWindow * 
curwin, Bool class_only)
        WMRect rect;
        rect = wGetRectForHead(scr, wGetHeadForPointerLocation(scr));
 
-       memset(panel, 0, sizeof(WSwitchPanel));
-
        panel->scr = scr;
 
        panel->windows = makeWindowListArray(curwin, wPreferences.swtileImage 
!= NULL, class_only);
diff --git a/src/texture.c b/src/texture.c
index dca7b98..a29406a 100644
--- a/src/texture.c
+++ b/src/texture.c
@@ -180,7 +180,6 @@ WTexGradient *wTextureMakeGradient(WScreen * scr, int 
style, RColor * from, RCol
        XGCValues gcv;
 
        texture = wmalloc(sizeof(WTexture));
-       memset(texture, 0, sizeof(WTexture));
        texture->type = style;
        texture->subtype = 0;
 
@@ -207,7 +206,6 @@ WTexIGradient *wTextureMakeIGradient(WScreen * scr, int 
thickness1, RColor color
        int i;
 
        texture = wmalloc(sizeof(WTexture));
-       memset(texture, 0, sizeof(WTexture));
        texture->type = WTEX_IGRADIENT;
        for (i = 0; i < 2; i++) {
                texture->colors1[i] = colors1[i];
@@ -239,7 +237,6 @@ WTexMGradient *wTextureMakeMGradient(WScreen * scr, int 
style, RColor ** colors)
        int i;
 
        texture = wmalloc(sizeof(WTexture));
-       memset(texture, 0, sizeof(WTexture));
        texture->type = style;
        texture->subtype = 0;
 
@@ -272,7 +269,6 @@ WTexPixmap *wTextureMakePixmap(WScreen * scr, int style, 
char *pixmap_file, XCol
                return NULL;
 
        texture = wmalloc(sizeof(WTexture));
-       memset(texture, 0, sizeof(WTexture));
        texture->type = WTEX_PIXMAP;
        texture->subtype = style;
 
@@ -300,7 +296,6 @@ WTexTGradient *wTextureMakeTGradient(WScreen * scr, int 
style, RColor * from, RC
                return NULL;
 
        texture = wmalloc(sizeof(WTexture));
-       memset(texture, 0, sizeof(WTexture));
        texture->type = style;
 
        texture->opacity = opacity;
diff --git a/src/wcore.c b/src/wcore.c
index 854c573..ac896a5 100644
--- a/src/wcore.c
+++ b/src/wcore.c
@@ -53,7 +53,6 @@ WCoreWindow *wCoreCreateTopLevel(WScreen * screen, int x, int 
y, int width, int
        XSetWindowAttributes attribs;
 
        core = wmalloc(sizeof(WCoreWindow));
-       memset(core, 0, sizeof(WCoreWindow));
 
        /* don't set CWBackPixel so that transparent XRender windows
           are see-through */
@@ -109,7 +108,6 @@ WCoreWindow *wCoreCreate(WCoreWindow * parent, int x, int 
y, int width, int heig
        XSetWindowAttributes attribs;
 
        core = wmalloc(sizeof(WCoreWindow));
-       memset(core, 0, sizeof(WCoreWindow));
 
        vmask = /*CWBackPixmap|CWBackPixel| */ CWBorderPixel | CWCursor | 
CWEventMask;
        attribs.cursor = wCursor[WCUR_DEFAULT];
diff --git a/src/window.c b/src/window.c
index f05be9e..b3802eb 100644
--- a/src/window.c
+++ b/src/window.c
@@ -167,8 +167,6 @@ WWindow *wWindowCreate(void)
        wwin = wmalloc(sizeof(WWindow));
        wretain(wwin);
 
-       memset(wwin, 0, sizeof(WWindow));
-
        wwin->client_descriptor.handle_mousedown = frameMouseDown;
        wwin->client_descriptor.parent = wwin;
        wwin->client_descriptor.self = wwin;
diff --git a/util/wmagnify.c b/util/wmagnify.c
index 3bb7a37..91e2d2a 100644
--- a/util/wmagnify.c
+++ b/util/wmagnify.c
@@ -99,7 +99,6 @@ static BufferData *makeBufferData(WMWindow * win, WMLabel * 
label, int width, in
        width /= magfactor;
        height /= magfactor;
        data->buffer = wmalloc(sizeof(unsigned long) * width * height);
-       memset(data->buffer, 0, width * height * sizeof(unsigned long));
        data->width = width;
        data->height = height;
 
diff --git a/util/wmsetbg.c b/util/wmsetbg.c
index 17b0583..86d1f91 100644
--- a/util/wmsetbg.c
+++ b/util/wmsetbg.c
@@ -277,7 +277,6 @@ BackgroundTexture *parseTexture(RContext * rc, char *text)
        }
 
        texture = wmalloc(sizeof(BackgroundTexture));
-       memset(texture, 0, sizeof(BackgroundTexture));
 
        GETSTRORGOTO(val, type, 0, error);
 

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

commit aee0ad45f27d7af9b270692aa35d8ad734c8213e
Author: Iain Patterson <w...@iain.cx>
Date:   Fri May 4 17:30:01 2012 +0100

    More intuitive maximization handling.
    
    Avoid some pitfalls with window maximization and make it behave more
    intuitively.  We now treat a window's vertical and horizontal
    maximization as separate properties and only remember its original
    geometry in a particular direction when it actually changes.  We also
    deliberately do not remember a window's geometry when it changes from
    one maximized state to another.  As a result windows can be more
    reliably restored to their original size.
    
    For example the "Maximize active window" hotkey followed by the
    "Maximize active window vertically" hotkey will now result in the window
    being maximized horizontally only, whereas previously the second hotkey
    would have no effect because the window was already maximized
    vertically.  In addition selecting the Unmaximize window menu in the
    same example will now result in the window being restored to its
    original size.  Previously the unmaximize attempt would have no effect
    because the vertical maximization would have remembered the window's
    "original" geometry when it was fully maximized.
    
    Maximus is handled separately.  The "Maximus" hotkey will now toggle
    Maximus mode regardless of the window's current maximization state.  For
    example if two unmaximized windows are on screen and one is Maximusized
    it will fill the space left by the second window, as before.  But if the
    first window is maximized and the "Maximus" hotkey is pressed the window
    will now fill the same space as if it were Maximusized from its original
    size.  Previously the window would not change size from its fully
    maximized state because the Maximus algorithm would consider
    fully-maximized to be a valid Maximus size.

diff --git a/src/actions.c b/src/actions.c
index e730570..4cf1f3d 100644
--- a/src/actions.c
+++ b/src/actions.c
@@ -58,7 +58,7 @@ extern int calcIntersectionLength(int p1, int l1, int p2, int 
l2);
 
 static void find_Maximus_geometry(WWindow *wwin, WArea usableArea, int *new_x, 
int *new_y,
                                  unsigned int *new_width, unsigned int 
*new_height);
-static void save_old_geometry(WWindow *wwin);
+static void save_old_geometry(WWindow *wwin, int directions);
 
 /******* Local Variables *******/
 static struct {
@@ -284,20 +284,43 @@ void wUnshadeWindow(WWindow *wwin)
 }
 
 /* Set the old coordinates using the current values */
-static void save_old_geometry(WWindow *wwin)
+static void save_old_geometry(WWindow *wwin, int directions)
 {
-       wwin->old_geometry.width = wwin->client.width;
-       wwin->old_geometry.height = wwin->client.height;
-       wwin->old_geometry.x = wwin->frame_x;
-       wwin->old_geometry.y = wwin->frame_y;
+       if (directions & MAX_HORIZONTAL || ! wwin->old_geometry.width) {
+               wwin->old_geometry.width = wwin->client.width;
+               wwin->old_geometry.x = wwin->frame_x;
+       }
+       if (directions & MAX_VERTICAL || ! wwin->old_geometry.height) {
+               wwin->old_geometry.height = wwin->client.height;
+               wwin->old_geometry.y = wwin->frame_y;
+       }
+}
+
+static void remember_geometry(WWindow *wwin, int *x, int *y, int *w, int *h)
+{
+       WMRect old_geom_rect;
+       int old_head;
+       Bool same_head;
+
+       old_geom_rect = wmkrect(wwin->old_geometry.x, wwin->old_geometry.y, 
wwin->old_geometry.width, wwin->old_geometry.height);
+       old_head = wGetHeadForRect(wwin->screen_ptr, old_geom_rect);
+       same_head = (wGetHeadForWindow(wwin) == old_head);
+       *x = (wwin->old_geometry.x && same_head) ? wwin->old_geometry.x : 
wwin->frame_x;
+       *y = (wwin->old_geometry.y && same_head) ? wwin->old_geometry.y : 
wwin->frame_y;
+       *w = wwin->old_geometry.width ? wwin->old_geometry.width : 
wwin->client.width;
+       *h = wwin->old_geometry.height ? wwin->old_geometry.height : 
wwin->client.height;
 }
 
+#define IS_MAX_HORIZONTALLY(directions) ((directions & MAX_HORIZONTAL) | 
(directions & MAX_LEFTHALF) | (directions & MAX_RIGHTHALF))
 void wMaximizeWindow(WWindow *wwin, int directions)
 {
        int new_x, new_y;
        unsigned int new_width, new_height, half_scr_width;
+       int maximus_x, maximus_y;
+       unsigned int maximus_width, maximus_height;
        WArea usableArea, totalArea;
        Bool has_border = 1;
+       int save_directions = 0;
        int adj_size;
 
        if (!IS_RESIZABLE(wwin))
@@ -309,8 +332,19 @@ void wMaximizeWindow(WWindow *wwin, int directions)
        /* the size to adjust the geometry */
        adj_size = FRAME_BORDER_WIDTH * 2 * has_border;
 
-       /* save old coordinates before we change the current values */
-       save_old_geometry(wwin);
+       /* save old coordinates before we change the current values
+        * but never if the window has been Maximusized */
+       if (!(wwin->flags.old_maximized & MAX_MAXIMUS)) {
+               if ((directions & MAX_VERTICAL) &&
+                   !(wwin->flags.maximized & MAX_VERTICAL))
+                       save_directions |= MAX_VERTICAL;
+               if (IS_MAX_HORIZONTALLY(directions) &&
+                   !IS_MAX_HORIZONTALLY(wwin->flags.maximized))
+                       save_directions |= MAX_HORIZONTAL;
+       }
+       if ((directions & MAX_MAXIMUS) && !wwin->flags.maximized)
+               save_directions |= MAX_VERTICAL | MAX_HORIZONTAL;
+       save_old_geometry(wwin, save_directions);
 
        totalArea.x1 = 0;
        totalArea.y1 = 0;
@@ -330,6 +364,10 @@ void wMaximizeWindow(WWindow *wwin, int directions)
                usableArea = wGetUsableAreaForHead(scr, head, &totalArea, True);
        }
 
+       /* remember Maximus geometry if we'll need it later */
+       if ((wwin->flags.old_maximized & MAX_MAXIMUS) || (directions & 
MAX_MAXIMUS))
+               find_Maximus_geometry(wwin, usableArea, &maximus_x, &maximus_y, 
&maximus_width, &maximus_height);
+
        /* Only save directions, not kbd or xinerama hints */
        directions &= (MAX_HORIZONTAL | MAX_VERTICAL | MAX_LEFTHALF | 
MAX_RIGHTHALF | MAX_MAXIMUS);
 
@@ -349,10 +387,21 @@ void wMaximizeWindow(WWindow *wwin, int directions)
        } else if (directions & MAX_LEFTHALF) {
                new_width = half_scr_width - adj_size;
                new_x = usableArea.x1;
+               wwin->flags.old_maximized |= MAX_LEFTHALF;
+               wwin->flags.old_maximized &= ~MAX_RIGHTHALF;
        } else if (directions & MAX_RIGHTHALF) {
                new_width = half_scr_width - adj_size;
                new_x = usableArea.x1 + half_scr_width;
+               wwin->flags.old_maximized |= MAX_RIGHTHALF;
+               wwin->flags.old_maximized &= ~MAX_LEFTHALF;
+       } else if (wwin->flags.old_maximized & MAX_MAXIMUS) {
+               new_x = maximus_x;
+               new_width = maximus_width - adj_size;
+       } else if (IS_MAX_HORIZONTALLY(wwin->flags.maximized)) {
+               new_x = (wwin->old_geometry.x) ? wwin->old_geometry.x : 
wwin->frame_x;
+               new_width = (wwin->old_geometry.width) ? 
wwin->old_geometry.width : wwin->frame->core->width;
        } else {
+               wwin->flags.old_maximized &= ~(MAX_LEFTHALF | MAX_RIGHTHALF);
                new_x = wwin->frame_x;
                new_width = wwin->frame->core->width;
        }
@@ -364,6 +413,17 @@ void wMaximizeWindow(WWindow *wwin, int directions)
                        new_y -= wwin->frame->top_width;
                        new_height += wwin->frame->bottom_width - 1;
                }
+       } else if (wwin->flags.old_maximized & MAX_MAXIMUS) {
+               new_y = maximus_y;
+               new_height = maximus_height - adj_size;
+               /* HACK: this will be subtracted again below */
+               new_height += wwin->frame->top_width + 
wwin->frame->bottom_width;
+       } else if (wwin->flags.maximized & MAX_VERTICAL) {
+               new_y = (wwin->old_geometry.y) ? wwin->old_geometry.y : 
wwin->frame_y;
+               new_height = (wwin->old_geometry.height) ? 
wwin->old_geometry.height : wwin->frame->core->height;
+               /* HACK: this will be subtracted again below */
+               new_height += wwin->frame->top_width + 
wwin->frame->bottom_width;
+               wwin->flags.old_maximized &= ~(MAX_LEFTHALF | MAX_RIGHTHALF);
        } else {
                new_y = wwin->frame_y;
                new_height = wwin->frame->core->height;
@@ -374,13 +434,15 @@ void wMaximizeWindow(WWindow *wwin, int directions)
        }
 
        if (directions & MAX_MAXIMUS) {
-               find_Maximus_geometry(wwin, usableArea, &new_x, &new_y, 
&new_width, &new_height);
-               new_width -= adj_size;
-               new_height -= adj_size;
+               new_x = maximus_x;
+               new_y = maximus_y;
+               new_width = maximus_width - adj_size;
+               new_height = maximus_height - adj_size;
                if (WFLAGP(wwin, full_maximize) && new_y == 0) {
                        new_y -= wwin->frame->top_width;
                        new_height += wwin->frame->top_width - 1;
                }
+               wwin->flags.old_maximized |= MAX_MAXIMUS;
        }
 
        wWindowConstrainSize(wwin, &new_width, &new_height);
@@ -395,6 +457,79 @@ void wMaximizeWindow(WWindow *wwin, int directions)
 
        /* set maximization state */
        wwin->flags.maximized = directions;
+       if ((wwin->flags.old_maximized & MAX_MAXIMUS) && !wwin->flags.maximized)
+               wwin->flags.maximized = MAX_MAXIMUS;
+}
+
+/* generic (un)maximizer */
+void handleMaximize(WWindow *wwin, int directions)
+{
+       int current = wwin->flags.maximized;
+       int requested = directions & (MAX_HORIZONTAL | MAX_VERTICAL | 
MAX_LEFTHALF | MAX_RIGHTHALF | MAX_MAXIMUS);
+       int effective = requested ^ current;
+       int flags = directions & ~requested;
+
+       if (!effective) {
+               /* allow wMaximizeWindow to restore the Maximusized size */
+               if ((wwin->flags.old_maximized & MAX_MAXIMUS) &&
+                   !(requested & MAX_MAXIMUS))
+                       wMaximizeWindow(wwin, flags);
+               else
+                       wUnmaximizeWindow(wwin);
+       }
+       else {
+               /* MAX_MAXIMUS takes precedence */
+               effective &= ~MAX_MAXIMUS;
+               if (requested & MAX_MAXIMUS) {
+                       /* window was previously Maximusized then maximized */
+                       if ((wwin->flags.old_maximized & MAX_MAXIMUS) && 
!current) {
+                               wUnmaximizeWindow(wwin);
+                               return;
+                       }
+                       else
+                               effective = MAX_MAXIMUS;
+               }
+               else if (requested == (MAX_HORIZONTAL | MAX_VERTICAL))
+                       effective = requested;
+               else {
+                       /* handle MAX_HORIZONTAL -> MAX_(LEFT|RIGHT)HALF */
+                       if (IS_MAX_HORIZONTALLY(current)) {
+                               if (IS_MAX_HORIZONTALLY(requested)) {
+                                       effective &= ~(MAX_HORIZONTAL | 
MAX_LEFTHALF | MAX_RIGHTHALF);
+                                       effective |= (requested & 
(MAX_HORIZONTAL | MAX_LEFTHALF | MAX_RIGHTHALF));
+                                       if (requested & MAX_HORIZONTAL) {
+                                               /* restore to half maximization 
*/
+                                               if (wwin->flags.old_maximized & 
MAX_LEFTHALF)
+                                                       effective |= 
MAX_LEFTHALF;
+                                               else if 
(wwin->flags.old_maximized & MAX_RIGHTHALF)
+                                                       effective |= 
MAX_RIGHTHALF;
+                                       }
+                                       /* MAX_VERTICAL is implicit with 
MAX_(LEFT|RIGHT)HALF */
+                                       else
+                                               effective |= MAX_VERTICAL;
+                               } else {
+                                       /* toggling MAX_VERTICAL */
+                                       if ((requested & MAX_VERTICAL) &&
+                                           (current & MAX_VERTICAL)) {
+                                               effective &= ~(MAX_LEFTHALF | 
MAX_RIGHTHALF | MAX_VERTICAL);
+                                       }
+                               }
+                       }
+                       /* handle MAX_VERTICAL -> MAX_(LEFT|RIGHT)HALF */
+                       if (current & MAX_VERTICAL) {
+                               if ((requested & MAX_LEFTHALF) ||
+                                   (requested & MAX_RIGHTHALF)) {
+                                       effective |= MAX_VERTICAL;
+                               }
+                       }
+                       /* toggling MAX_HORIZONTAL */
+                       if ((requested & MAX_HORIZONTAL) &&
+                           (current & MAX_HORIZONTAL))
+                               effective &= ~MAX_HORIZONTAL;
+               }
+               wMaximizeWindow(wwin, effective | flags);
+       }
+       return;
 }
 
 /* the window boundary coordinates */
@@ -434,7 +569,14 @@ static void find_Maximus_geometry(WWindow *wwin, WArea 
usableArea, int *new_x, i
        win_coords obs, orig, new;
 
        /* set the original coordinate positions of the window to be 
Maximumized */
-       set_window_coords(wwin, &orig);
+       if (wwin->flags.maximized) {
+               /* window is already maximized; consider original geometry */
+               remember_geometry(wwin, &orig.left, &orig.top, &orig.width, 
&orig.height);
+               orig.bottom = orig.top + orig.height;
+               orig.right = orig.left + orig.width;
+       }
+       else
+               set_window_coords(wwin, &orig);
 
        /* Try to fully maximize first, then readjust later */
        new.left    = usableArea.x1;
@@ -520,9 +662,6 @@ static void find_Maximus_geometry(WWindow *wwin, WArea 
usableArea, int *new_x, i
 void wUnmaximizeWindow(WWindow *wwin)
 {
        int x, y, w, h;
-        WMRect old_geom_rect;
-        int old_head;
-       Bool same_head;
 
        if (!wwin->flags.maximized)
                return;
@@ -532,15 +671,10 @@ void wUnmaximizeWindow(WWindow *wwin)
                wUnshadeWindow(wwin);
        }
        /* Use old coordinates if they are set, current values otherwise */
-        old_geom_rect = wmkrect(wwin->old_geometry.x, wwin->old_geometry.y, 
wwin->old_geometry.width, wwin->old_geometry.height);
-       old_head = wGetHeadForRect(wwin->screen_ptr, old_geom_rect);
-       same_head = (wGetHeadForWindow(wwin) == old_head);
-       x = (wwin->old_geometry.x && same_head) ? wwin->old_geometry.x : 
wwin->frame_x;
-       y = (wwin->old_geometry.y && same_head) ? wwin->old_geometry.y : 
wwin->frame_y;
-       w = wwin->old_geometry.width ? wwin->old_geometry.width : 
wwin->client.width;
-       h = wwin->old_geometry.height ? wwin->old_geometry.height : 
wwin->client.height;
+       remember_geometry(wwin, &x, &y, &w, &h);
 
        wwin->flags.maximized = 0;
+       wwin->flags.old_maximized = 0;
        wWindowConfigure(wwin, x, y, w, h);
        wWindowSynthConfigureNotify(wwin);
 
diff --git a/src/actions.h b/src/actions.h
index da196ae..719df2e 100644
--- a/src/actions.h
+++ b/src/actions.h
@@ -51,6 +51,7 @@ void wUnselectWindows(WScreen *scr);
 
 void wMaximizeWindow(WWindow *wwin, int directions);
 void wUnmaximizeWindow(WWindow *wwin);
+void handleMaximize(WWindow *wwin, int directions);
 
 void wHideAll(WScreen *src);
 void wHideOtherApplications(WWindow *wwin);
diff --git a/src/event.c b/src/event.c
index 2eb0248..8e950a2 100644
--- a/src/event.c
+++ b/src/event.c
@@ -1444,60 +1444,42 @@ static void handleKeyPress(XEvent * event)
                if (ISMAPPED(wwin) && ISFOCUSED(wwin) && IS_RESIZABLE(wwin)) {
                        CloseWindowMenu(scr);
 
-                       if (wwin->flags.maximized == (MAX_VERTICAL | 
MAX_HORIZONTAL))
-                               wUnmaximizeWindow(wwin);
-                       else
-                               wMaximizeWindow(wwin, MAX_VERTICAL | 
MAX_HORIZONTAL | MAX_KEYBOARD);
+                       handleMaximize(wwin, MAX_VERTICAL | MAX_HORIZONTAL | 
MAX_KEYBOARD);
                }
                break;
        case WKBD_VMAXIMIZE:
                if (ISMAPPED(wwin) && ISFOCUSED(wwin) && IS_RESIZABLE(wwin)) {
                        CloseWindowMenu(scr);
 
-                       if (wwin->flags.maximized == MAX_VERTICAL)
-                               wUnmaximizeWindow(wwin);
-                       else
-                               wMaximizeWindow(wwin, MAX_VERTICAL | 
MAX_KEYBOARD);
+                       handleMaximize(wwin, MAX_VERTICAL | MAX_KEYBOARD);
                }
                break;
        case WKBD_HMAXIMIZE:
                if (ISMAPPED(wwin) && ISFOCUSED(wwin) && IS_RESIZABLE(wwin)) {
                        CloseWindowMenu(scr);
 
-                       if (wwin->flags.maximized == MAX_HORIZONTAL)
-                               wUnmaximizeWindow(wwin);
-                       else
-                               wMaximizeWindow(wwin, MAX_HORIZONTAL | 
MAX_KEYBOARD);
+                       handleMaximize(wwin, MAX_HORIZONTAL | MAX_KEYBOARD);
                }
                break;
        case WKBD_LHMAXIMIZE:
                if (ISMAPPED(wwin) && ISFOCUSED(wwin) && IS_RESIZABLE(wwin)) {
                        CloseWindowMenu(scr);
 
-                       if (wwin->flags.maximized == (MAX_VERTICAL | 
MAX_LEFTHALF))
-                               wUnmaximizeWindow(wwin);
-                       else
-                               wMaximizeWindow(wwin, MAX_VERTICAL | 
MAX_LEFTHALF | MAX_KEYBOARD);
+                       handleMaximize(wwin, MAX_VERTICAL | MAX_LEFTHALF | 
MAX_KEYBOARD);
                }
                break;
        case WKBD_RHMAXIMIZE:
                if (ISMAPPED(wwin) && ISFOCUSED(wwin) && IS_RESIZABLE(wwin)) {
                        CloseWindowMenu(scr);
 
-                       if (wwin->flags.maximized == (MAX_VERTICAL | 
MAX_RIGHTHALF))
-                               wUnmaximizeWindow(wwin);
-                       else
-                               wMaximizeWindow(wwin, MAX_VERTICAL | 
MAX_RIGHTHALF | MAX_KEYBOARD);
+                       handleMaximize(wwin, MAX_VERTICAL | MAX_RIGHTHALF | 
MAX_KEYBOARD);
                }
                break;
        case WKBD_MAXIMUS:
                if (ISMAPPED(wwin) && ISFOCUSED(wwin) && IS_RESIZABLE(wwin)) {
                        CloseWindowMenu(scr);
 
-                       if (wwin->flags.maximized == MAX_MAXIMUS)
-                               wUnmaximizeWindow(wwin);
-                       else
-                               wMaximizeWindow(wwin, MAX_MAXIMUS | 
MAX_KEYBOARD);
+                       handleMaximize(wwin, MAX_MAXIMUS | MAX_KEYBOARD);
                }
                break;
        case WKBD_RAISE:
diff --git a/src/window.h b/src/window.h
index edebe80..28adcc5 100644
--- a/src/window.h
+++ b/src/window.h
@@ -248,6 +248,7 @@ typedef struct WWindow {
         unsigned int hidden:1;
         unsigned int shaded:1;
        unsigned int maximized:5;
+       unsigned int old_maximized:5;
         unsigned int fullscreen:1;
         unsigned int omnipresent:1;
 

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

commit e6e3e1aa49f9c069372cd6bc4e792f9570448959
Author: Tobias Stoeckmann <tob...@openbsd.org>
Date:   Thu May 3 17:54:13 2012 +0200

    Avoid memory leak on error path in constructMenu.

diff --git a/src/rootmenu.c b/src/rootmenu.c
index c168279..f9b51ab 100644
--- a/src/rootmenu.c
+++ b/src/rootmenu.c
@@ -588,6 +588,8 @@ static void constructMenu(WMenu * menu, WMenuEntry * entry)
        separateCommand((char *)entry->clientdata, &path, &cmd);
        if (path == NULL || *path == NULL || **path == 0) {
                wwarning(_("invalid OPEN_MENU specification: %s"), (char 
*)entry->clientdata);
+               if (cmd)
+                       wfree(cmd);
                return;
        }
 

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

commit 753f44c4b703b7451b7c79299bb80e074a51e534
Author: Tobias Stoeckmann <tob...@openbsd.org>
Date:   Thu May 3 17:48:56 2012 +0200

    Fixed memory leak in wHideAll.

diff --git a/src/actions.c b/src/actions.c
index e0339c4..e730570 100644
--- a/src/actions.c
+++ b/src/actions.c
@@ -1227,13 +1227,13 @@ void wHideAll(WScreen *scr)
 
        menu = scr->switch_menu;
 
-       windows = malloc(sizeof(WWindow *));
+       windows = wmalloc(sizeof(WWindow *));
 
        if (menu != NULL) {
                for (i = 0; i < menu->entry_no; i++) {
                        windows[wcount] = (WWindow *) 
menu->entries[i]->clientdata;
                        wcount++;
-                       windows = realloc(windows, sizeof(WWindow *) * 
(wcount+1));
+                       windows = wrealloc(windows, sizeof(WWindow *) * (wcount 
+ 1));
                }
        } else {
                wwin = scr->focused_window;
@@ -1241,7 +1241,7 @@ void wHideAll(WScreen *scr)
                while (wwin) {
                        windows[wcount] = wwin;
                        wcount++;
-                       windows = realloc(windows, sizeof(WWindow *) * 
(wcount+1));
+                       windows = wrealloc(windows, sizeof(WWindow *) * (wcount 
+ 1));
                        wwin = wwin->prev;
 
                }
@@ -1258,6 +1258,8 @@ void wHideAll(WScreen *scr)
                        wIconifyWindow(wwin);
                }
        }
+
+       wfree(windows);
 }
 
 void wHideOtherApplications(WWindow *awin)

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

commit 2755b1e45d9d1217f337e5c6a36794c6095d099c
Author: Tobias Stoeckmann <tob...@openbsd.org>
Date:   Thu May 3 17:45:28 2012 +0200

    Use proper (w)free functions for (w)malloced data.

diff --git a/src/appmenu.c b/src/appmenu.c
index 7c6e6a3..6aac338 100644
--- a/src/appmenu.c
+++ b/src/appmenu.c
@@ -154,7 +154,7 @@ static WMenu *parseMenuCommand(WScreen * scr, Window win, 
char **slist, int coun
                        if (!entry) {
                                wMenuDestroy(menu, True);
                                wwarning("appmenu: out of memory creating menu 
for window %lx", win);
-                               wfree(data);
+                               free(data);
                                return NULL;
                        }
                        if (rtext[0] != 0)
diff --git a/src/event.c b/src/event.c
index 50c5a56..2eb0248 100644
--- a/src/event.c
+++ b/src/event.c
@@ -178,7 +178,7 @@ WMagicNumber wAddDeathHandler(pid_t pid, WDeathHandler * 
callback, void *cdata)
        handler->client_data = cdata;
 
        if (!deathHandlers)
-               deathHandlers = WMCreateArrayWithDestructor(8, wfree);
+               deathHandlers = WMCreateArrayWithDestructor(8, free);
 
        WMAddToArray(deathHandlers, handler);
 
@@ -192,7 +192,7 @@ static void wdelete_death_handler(WMagicNumber id)
        if (!handler || !deathHandlers)
                return;
 
-       /* array destructor will call wfree(handler) */
+       /* array destructor will call free(handler) */
        WMRemoveFromArray(deathHandlers, handler);
 }
 
diff --git a/src/rootmenu.c b/src/rootmenu.c
index cca29ae..c168279 100644
--- a/src/rootmenu.c
+++ b/src/rootmenu.c
@@ -783,7 +783,7 @@ static WMenuEntry *addMenuEntry(WMenu * menu, char *title, 
char *shortcut, char
                        dummy = wMenuCreate(scr, title, False);
                        dummy->on_destroy = removeShortcutsForMenu;
                        entry = wMenuAddCallback(menu, title, constructMenu, 
path);
-                       entry->free_cdata = free;
+                       entry->free_cdata = wfree;
                        wMenuEntrySetCascade(menu, entry, dummy);
                }
        } else if (strcmp(command, "EXEC") == 0) {
@@ -791,7 +791,7 @@ static WMenuEntry *addMenuEntry(WMenu * menu, char *title, 
char *shortcut, char
                        wwarning(_("%s:missing parameter for menu command 
"%s""), file_name, command);
                else {
                        entry = wMenuAddCallback(menu, title, execCommand, 
wstrconcat("exec ", params));
-                       entry->free_cdata = free;
+                       entry->free_cdata = wfree;
                        shortcutOk = True;
                }
        } else if (strcmp(command, "SHEXEC") == 0) {
@@ -799,7 +799,7 @@ static WMenuEntry *addMenuEntry(WMenu * menu, char *title, 
char *shortcut, char
                        wwarning(_("%s:missing parameter for menu command 
"%s""), file_name, command);
                else {
                        entry = wMenuAddCallback(menu, title, execCommand, 
wstrdup(params));
-                       entry->free_cdata = free;
+                       entry->free_cdata = wfree;
                        shortcutOk = True;
                }
        } else if (strcmp(command, "EXIT") == 0) {
@@ -844,7 +844,7 @@ static WMenuEntry *addMenuEntry(WMenu * menu, char *title, 
char *shortcut, char
                shortcutOk = True;
        } else if (strcmp(command, "RESTART") == 0) {
                entry = wMenuAddCallback(menu, title, restartCommand, params ? 
wstrdup(params) : NULL);
-               entry->free_cdata = free;
+               entry->free_cdata = wfree;
                shortcutOk = True;
        } else if (strcmp(command, "SAVE_SESSION") == 0) {
                entry = wMenuAddCallback(menu, title, saveSessionCommand, NULL);
@@ -1344,7 +1344,7 @@ static WMenu *readMenuDirectory(WScreen * scr, char 
*title, char **path, char *c
                                        }
                                }
                        }
-                       wfree(buffer);
+                       free(buffer);
                }
 
                closedir(dir);

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

commit 975d4becf16bb62372cc6e7918c49e8cd33c6053
Author: Tobias Stoeckmann <tob...@openbsd.org>
Date:   Thu May 3 18:01:23 2012 +0200

    Fixed some typos.

diff --git a/FAQ b/FAQ
index 37a30c5..4cca2aa 100644
--- a/FAQ
+++ b/FAQ
@@ -857,7 +857,7 @@ badly coded for not setting the instance.class hints.
     program for that matter?) 
 ----------------------------------
 Right Click on the title bar and choose "Attributes". Click on Panel 2 and
-click the the "Disable titlebar" and "Disable resizebar" options. Click
+click the "Disable titlebar" and "Disable resizebar" options. Click
 "Save", "Apply" and then close the Attributes panel. 
 
 By Default, to get back to the attributes menu once you've removed the
diff --git a/debian/changelog b/debian/changelog
index 56031d3..248ca31 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1507,7 +1507,7 @@ wmaker (0.20.2-2) frozen unstable; urgency=low
   * debian/rules: dockit is gone but manpage is still installed
   * debian/wmaker.postinst.tmpl: removed the code to add Window Maker to
     /etc/X11/window-managers and replaced with register-window-manager
-    (the interface provided by the the xbase package). This fixes #28841
+    (the interface provided by the xbase package). This fixes #28841
     partially (that's two bugs in one, this is the not-so-important part)
   * debian/wmaker.postrm: ditto for removal from /etc/X11/window-managers
   * On my system bug #26682 doesn't show up with this build and the new
diff --git a/email-clients.txt b/email-clients.txt
index 860c29a..e9f5dac 100644
--- a/email-clients.txt
+++ b/email-clients.txt
@@ -104,7 +104,7 @@ Then from the "Message" menu item, select insert file and 
choose your patch.
 As an added bonus you can customise the message creation toolbar menu
 and put the "insert file" icon there.
 
-Make the the composer window wide enough so that no lines wrap. As of
+Make the composer window wide enough so that no lines wrap. As of
 KMail 1.13.5 (KDE 4.5.4), KMail will apply word wrapping when sending
 the email if the lines wrap in the composer window. Having word wrapping
 disabled in the Options menu isn't enough. Thus, if your patch has very
diff --git a/src/client.c b/src/client.c
index 16a4f11..93245e0 100644
--- a/src/client.c
+++ b/src/client.c
@@ -74,7 +74,7 @@ void wClientRestore(WWindow * wwin)
        int gx, gy;
 
        wClientGetGravityOffsets(wwin, &gx, &gy);
-       /* set the positio of the frame on screen */
+       /* set the position of the frame on screen */
        wwin->frame_x -= gx * FRAME_BORDER_WIDTH;
        wwin->frame_y -= gy * FRAME_BORDER_WIDTH;
        /* if gravity is to the south, account for the border sizes */
diff --git a/src/dock.c b/src/dock.c
index 88ea6eb..61d70f0 100644
--- a/src/dock.c
+++ b/src/dock.c
@@ -2166,7 +2166,7 @@ void wDockDetach(WDock *dock, WAppIcon *icon)
        dock->icon_count--;
 
        /* if the dock is not attached to an application or
-        * the the application did not set the approriate hints yet,
+        * the application did not set the appropriate hints yet,
         * destroy the icon */
        if (!icon->running || !wApplicationOf(icon->main_window))
                wAppIconDestroy(icon);

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

Summary of changes:
 WINGs/data.c                   |    1 -
 WINGs/hashtable.c              |    5 +-
 WINGs/proplist.c               |    2 -
 WINGs/wbutton.c                |    1 -
 WINGs/wfontpanel.c             |    1 -
 WPrefs.app/Appearance.c        |    4 -
 WPrefs.app/Configurations.c    |    1 -
 WPrefs.app/Expert.c            |    1 -
 WPrefs.app/Focus.c             |    1 -
 WPrefs.app/FontSimple.c        |    1 -
 WPrefs.app/Icons.c             |    1 -
 WPrefs.app/KeyboardSettings.c  |    1 -
 WPrefs.app/KeyboardShortcuts.c |    2 -
 WPrefs.app/Menu.c              |    3 +-
 WPrefs.app/MenuPreferences.c   |    1 -
 WPrefs.app/MouseSettings.c     |    1 -
 WPrefs.app/Paths.c             |    1 -
 WPrefs.app/Preferences.c       |    1 -
 WPrefs.app/TexturePanel.c      |    2 -
 WPrefs.app/Themes.c            |    1 -
 WPrefs.app/WindowHandling.c    |    1 -
 WPrefs.app/Workspace.c         |    1 -
 WPrefs.app/double.c            |    2 -
 WPrefs.app/editmenu.c          |    3 -
 src/actions.c                  |  178 +++++++++++++++++++++++++++++++++++-----
 src/actions.h                  |    1 +
 src/appicon.c                  |    2 -
 src/application.c              |    1 -
 src/balloon.c                  |    1 -
 src/defaults.c                 |    1 -
 src/dialog.c                   |    3 -
 src/dock.c                     |    9 +--
 src/dockedapp.c                |    1 -
 src/event.c                    |   31 ++------
 src/framewin.c                 |    1 -
 src/icon.c                     |    1 -
 src/menu.c                     |    3 -
 src/pixmap.c                   |    3 -
 src/placement.c                |    1 -
 src/screen.c                   |    1 -
 src/session.c                  |    1 -
 src/switchpanel.c              |    2 -
 src/texture.c                  |    5 -
 src/wcore.c                    |    2 -
 src/window.c                   |    2 -
 src/window.h                   |    1 +
 util/wmagnify.c                |    1 -
 util/wmsetbg.c                 |    1 -
 48 files changed, 168 insertions(+), 124 deletions(-)


repo.or.cz automatic notification. Contact project admin crma...@gmail.com
if you want to unsubscribe, or site admin ad...@repo.or.cz if you receive
no reply.
-- 
wmaker-crm.git ("The Window Maker window manager")


-- 
To unsubscribe, send mail to wmaker-dev-unsubscr...@lists.windowmaker.org.

Reply via email to