diff -ur WindowMaker-0.92.0.orig/src/defaults.c WindowMaker-0.92.0/src/defaults.c --- WindowMaker-0.92.0.orig/src/defaults.c 2009-10-28 13:11:59.544812000 +0100 +++ WindowMaker-0.92.0/src/defaults.c 2009-10-28 13:35:29.344762516 +0100 @@ -562,6 +562,9 @@ {"TranslateMenu", "YES", NULL, &wPreferences.translate_menu, getBool, NULL }, + {"DCMaximize", "NO", NULL, + &wPreferences.dc_maximize, getBool, NULL + }, /* style options */ {"MenuStyle", "normal", seMenuStyles, &wPreferences.menu_style, getEnum, setMenuStyle diff -ur WindowMaker-0.92.0.orig/src/window.c WindowMaker-0.92.0/src/window.c --- WindowMaker-0.92.0.orig/src/window.c 2009-10-28 13:11:59.364429000 +0100 +++ WindowMaker-0.92.0/src/window.c 2009-10-28 13:18:44.219635690 +0100 @@ -3096,13 +3096,29 @@ if (event->xbutton.button==Button1) { if (event->xbutton.state == 0) { - if (!WFLAGP(wwin, no_shadeable)) { + /* check preferences, maximize or shade */ + if (wPreferences.dc_maximize) { + if (!WFLAGP(wwin, no_resizable)) { + /* maximize window */ + if (wwin->flags.maximized != 0) { + wUnmaximizeWindow(wwin); + wwin->flags.maximized = 0; + } + else { + wMaximizeWindow(wwin, MAX_VERTICAL|MAX_HORIZONTAL); + wwin->flags.maximized = MAX_VERTICAL|MAX_HORIZONTAL; + } + } + } + else { + if (!WFLAGP(wwin, no_shadeable)) { /* shade window */ if (wwin->flags.shaded) - wUnshadeWindow(wwin); + wUnshadeWindow(wwin); else - wShadeWindow(wwin); - } + wShadeWindow(wwin); + } + } } else { int dir = 0; diff -ur WindowMaker-0.92.0.orig/src/WindowMaker.h WindowMaker-0.92.0/src/WindowMaker.h --- WindowMaker-0.92.0.orig/src/WindowMaker.h 2009-10-28 13:11:59.547716000 +0100 +++ WindowMaker-0.92.0/src/WindowMaker.h 2009-10-28 13:28:11.599489347 +0100 @@ -478,6 +478,9 @@ unsigned int workspace_border_size; /* Size in pixels of the workspace border */ char workspace_border_position; /* Where to leave a workspace border */ + /* double click on title bar maximize */ + char dc_maximize; + /* single click to lauch applications */ char single_click; diff -ur WindowMaker-0.92.0.orig/WPrefs.app/Expert.c WindowMaker-0.92.0/WPrefs.app/Expert.c --- WindowMaker-0.92.0.orig/WPrefs.app/Expert.c 2009-10-28 13:11:57.555080000 +0100 +++ WindowMaker-0.92.0/WPrefs.app/Expert.c 2009-10-28 13:26:00.864274985 +0100 @@ -55,6 +55,7 @@ WMSetButtonSelected(panel->swi[5], GetBoolForKey("DisableBlinking")); WMSetButtonSelected(panel->swi[6], GetBoolForKey("AntialiasedText")); WMSetButtonSelected(panel->swi[7], GetBoolForKey("SingleClickLaunch")); + WMSetButtonSelected(panel->swi[8], GetBoolForKey("DCMaximize")); } @@ -67,10 +68,10 @@ panel->box = WMCreateBox(panel->parent); WMSetViewExpandsToParent(WMWidgetView(panel->box), 2, 2, 2, 2); - for (i=0; i<8; i++) { + for (i=0; i<9; i++) { panel->swi[i] = WMCreateSwitchButton(panel->box); WMResizeWidget(panel->swi[i], FRAME_WIDTH-40, 25); - WMMoveWidget(panel->swi[i], 20, 20+i*25); + WMMoveWidget(panel->swi[i], 20, 20+i*23); } WMSetButtonText(panel->swi[0], _("Disable miniwindows (icons for minimized windows). For use with KDE/GNOME.")); @@ -81,6 +82,7 @@ WMSetButtonText(panel->swi[5], _("Disable selection animation for selected icons.")); WMSetButtonText(panel->swi[6], _("Smooth font edges (needs restart).")); WMSetButtonText(panel->swi[7], _("Launch applications and restore windows with a single click.")); + WMSetButtonText(panel->swi[8], _("Double click on title bar maximize")); WMSetButtonEnabled(panel->swi[6], True); @@ -106,6 +108,7 @@ SetBoolForKey(WMGetButtonSelected(panel->swi[5]), "DisableBlinking"); SetBoolForKey(WMGetButtonSelected(panel->swi[6]), "AntialiasedText"); SetBoolForKey(WMGetButtonSelected(panel->swi[7]), "SingleClickLaunch"); + SetBoolForKey(WMGetButtonSelected(panel->swi[8]), "DCMaximize"); }