83322e0
--- WindowMaker-0.91.0/src/window.c.vns	2005-05-18 15:51:45 +0400
83322e0
+++ WindowMaker-0.91.0/src/window.c	2005-05-18 15:55:55 +0400
83322e0
@@ -1293,7 +1293,10 @@
83322e0
 
83322e0
     wwin->frame = wFrameWindowCreate(scr, window_level,
83322e0
                                      x, y, width, height,
83322e0
-                                     &wPreferences.window_title_clearance, foo,
83322e0
+				     &wPreferences.window_title_clearance,
83322e0
+				     &wPreferences.window_title_min_height,
83322e0
+				     &wPreferences.window_title_max_height,
83322e0
+				     foo,
83322e0
                                      scr->window_title_texture,
83322e0
                                      scr->resizebar_texture,
83322e0
                                      scr->window_title_color,
83322e0
@@ -1630,7 +1633,10 @@
83322e0
     wwin->frame = wFrameWindowCreate(scr, WMFloatingLevel,
83322e0
                                      wwin->frame_x, wwin->frame_y,
83322e0
                                      width, height,
83322e0
-                                     &wPreferences.window_title_clearance, foo,
83322e0
+                                     &wPreferences.window_title_clearance,
83322e0
+                                     &wPreferences.window_title_min_height,
83322e0
+                                     &wPreferences.window_title_max_height,
83322e0
+		                     foo,
83322e0
                                      scr->window_title_texture,
83322e0
                                      scr->resizebar_texture,
83322e0
                                      scr->window_title_color,
83322e0
--- WindowMaker-0.91.0/src/defaults.c.vns	2005-05-18 15:51:45 +0400
83322e0
+++ WindowMaker-0.91.0/src/defaults.c	2005-05-18 15:51:45 +0400
83322e0
@@ -376,6 +376,8 @@
83322e0
 };
83322e0
 
83322e0
 
83322e0
+#define NUM2STRING_(x) #x
83322e0
+#define NUM2STRING(x) NUM2STRING_(x)
83322e0
 
83322e0
 WDefaultEntry optionList[] = {
83322e0
     /* dynamic options */
83322e0
@@ -601,9 +603,21 @@
83322e0
     {"WindowTitleExtendSpace",	DEF_WINDOW_TITLE_EXTEND_SPACE,	       	NULL,
83322e0
     &wPreferences.window_title_clearance,	getInt,		setClearance
83322e0
     },
83322e0
+    {"WindowTitleMinHeight",	"0",	       	NULL,
83322e0
+    &wPreferences.window_title_min_height,	getInt,		setClearance
83322e0
+    },
83322e0
+    {"WindowTitleMaxHeight",	NUM2STRING(INT_MAX),	NULL,
83322e0
+    &wPreferences.window_title_max_height,	getInt,		setClearance
83322e0
+    },
83322e0
     {"MenuTitleExtendSpace",	DEF_MENU_TITLE_EXTEND_SPACE,	       	NULL,
83322e0
     &wPreferences.menu_title_clearance,	getInt,		setClearance
83322e0
     },
83322e0
+    {"MenuTitleMinHeight",	"0",	       	NULL,
83322e0
+    &wPreferences.menu_title_min_height,	getInt,		setClearance
83322e0
+    },
83322e0
+    {"MenuTitleMaxHeight",	NUM2STRING(INT_MAX),	NULL,
83322e0
+    &wPreferences.menu_title_max_height,	getInt,		setClearance
83322e0
+    },
83322e0
     {"MenuTextExtendSpace",	DEF_MENU_TEXT_EXTEND_SPACE,	       	NULL,
83322e0
     &wPreferences.menu_text_clearance,	getInt,		setClearance
83322e0
     },
83322e0
--- WindowMaker-0.91.0/src/WindowMaker.h.vns	2005-05-18 15:51:45 +0400
83322e0
+++ WindowMaker-0.91.0/src/WindowMaker.h	2005-05-18 15:51:45 +0400
83322e0
@@ -371,7 +371,11 @@
83322e0
     signed char title_justification;	       /* titlebar text alignment */
83322e0
 
83322e0
     int window_title_clearance;
83322e0
+    int window_title_min_height;
83322e0
+    int window_title_max_height;
83322e0
     int menu_title_clearance;
83322e0
+    int menu_title_min_height;
83322e0
+    int menu_title_max_height;
83322e0
     int menu_text_clearance;
83322e0
 
83322e0
     char multi_byte_text;
83322e0
--- WindowMaker-0.91.0/src/framewin.c.vns	2005-05-18 15:51:45 +0400
83322e0
+++ WindowMaker-0.91.0/src/framewin.c	2005-05-18 15:54:16 +0400
83322e0
@@ -63,7 +63,8 @@
83322e0
 
83322e0
 WFrameWindow*
83322e0
 wFrameWindowCreate(WScreen *scr, int wlevel, int x, int y,
83322e0
-                   int width, int height, int *clearance, int flags,
83322e0
+		   int width, int height, int *clearance,
83322e0
+		   int *title_min, int *title_max, int flags,
83322e0
                    WTexture **title_texture, WTexture **resize_texture,
83322e0
                    WMColor **color, WMFont **font)
83322e0
 {
83322e0
@@ -80,6 +81,8 @@
83322e0
     fwin->resizebar_texture = resize_texture;
83322e0
     fwin->title_color = color;
83322e0
     fwin->title_clearance = clearance;
83322e0
+    fwin->title_min_height = title_min;
83322e0
+    fwin->title_max_height = title_max;
83322e0
     fwin->font = font;
83322e0
 #ifdef KEEP_XKB_LOCK_STATUS
83322e0
     fwin->languagemode = XkbGroup1Index;
83322e0
@@ -130,7 +133,11 @@
83322e0
         height = fwin->core->height - fwin->top_width - fwin->bottom_width;
83322e0
 
83322e0
     if (flags & WFF_TITLEBAR)
83322e0
-        theight = WMFontHeight(*fwin->font) + (*fwin->title_clearance + TITLEBAR_EXTEND_SPACE) * 2;
83322e0
+    {
83322e0
+	theight = WMFontHeight(*fwin->font) + (*fwin->title_clearance + TITLEBAR_EXTEND_SPACE) * 2;
83322e0
+	if(theight > *fwin->title_max_height) theight = *fwin->title_max_height;
83322e0
+	if(theight < *fwin->title_min_height) theight = *fwin->title_min_height;
83322e0
+    }
83322e0
     else
83322e0
         theight = 0;
83322e0
 
83322e0
@@ -490,6 +497,8 @@
83322e0
     int theight;
83322e0
 
83322e0
     theight = WMFontHeight(*fwin->font) + (*fwin->title_clearance + TITLEBAR_EXTEND_SPACE) * 2;
83322e0
+    if(theight > *fwin->title_max_height) theight = *fwin->title_max_height;
83322e0
+    if(theight < *fwin->title_min_height) theight = *fwin->title_min_height;
83322e0
 
83322e0
     x = 0;
83322e0
     w = fwin->core->width + 1;
83322e0
@@ -1097,8 +1106,11 @@
83322e0
                 break;
83322e0
             }
83322e0
 
83322e0
+
83322e0
             y = *fwin->title_clearance + TITLEBAR_EXTEND_SPACE;
83322e0
             h = WMFontHeight(*fwin->font);
83322e0
+            if(y*2 + h > *fwin->title_max_height) y = (*fwin->title_max_height - h)/2;
83322e0
+            if(y*2 + h < *fwin->title_min_height) y = (*fwin->title_min_height - h)/2;
83322e0
 
83322e0
             /* We use a w+2 buffer to have an extra pixel on the left and
83322e0
              * another one on the right. This is because for some odd reason,
83322e0
--- WindowMaker-0.91.0/src/menu.c.vns	2005-05-18 15:51:45 +0400
83322e0
+++ WindowMaker-0.91.0/src/menu.c	2005-05-18 15:51:45 +0400
83322e0
@@ -180,7 +180,10 @@
83322e0
         menu->flags.titled = 1;
83322e0
     }
83322e0
     menu->frame =
83322e0
-        wFrameWindowCreate(screen, tmp, 8, 2, 1, 1, &wPreferences.menu_title_clearance, flags,
83322e0
+        wFrameWindowCreate(screen, tmp, 8, 2, 1, 1, &wPreferences.menu_title_clearance,
83322e0
+		           &wPreferences.menu_title_min_height,
83322e0
+			   &wPreferences.menu_title_max_height,
83322e0
+			   flags,
83322e0
                            screen->menu_title_texture, NULL,
83322e0
                            screen->menu_title_color,
83322e0
                            &screen->menu_title_font);
83322e0
--- WindowMaker-0.91.0/src/framewin.h.vns	2004-10-15 01:24:06 +0400
83322e0
+++ WindowMaker-0.91.0/src/framewin.h	2005-05-18 15:56:27 +0400
83322e0
@@ -59,6 +59,8 @@
83322e0
 
83322e0
     short top_width;
83322e0
     int *title_clearance;
83322e0
+    int *title_min_height;
83322e0
+    int *title_max_height;
83322e0
     short bottom_width;
83322e0
 
83322e0
     short resizebar_corner_width;
83322e0
@@ -149,7 +151,8 @@
83322e0
 
83322e0
 WFrameWindow*
83322e0
 wFrameWindowCreate(WScreen *scr, int wlevel, int x, int y,
83322e0
-                   int width, int height, int *clearance, int flags,
83322e0
+		   int width, int height, int *clearance,
83322e0
+		   int *title_min, int *title_max, int flags,
83322e0
                    union WTexture **title_texture,
83322e0
                    union WTexture **resize_texture,
83322e0
                    WMColor **color, WMFont **font);
83322e0
--- WindowMaker-0.91.0/src/moveres.c.vns	2004-10-24 23:36:09 +0400
83322e0
+++ WindowMaker-0.91.0/src/moveres.c	2005-05-18 15:51:45 +0400
83322e0
@@ -497,6 +497,8 @@
83322e0
 
83322e0
     if (HAS_TITLEBAR(wwin) && !wwin->flags.shaded) {
83322e0
         h = WMFontHeight(wwin->screen_ptr->title_font) + (wPreferences.window_title_clearance + TITLEBAR_EXTEND_SPACE) * 2;
83322e0
+	if(h > wPreferences.window_title_max_height) h = wPreferences.window_title_max_height;
83322e0
+	if(h < wPreferences.window_title_min_height) h = wPreferences.window_title_min_height;
83322e0
     }
83322e0
     if (HAS_RESIZEBAR(wwin) && !wwin->flags.shaded) {
83322e0
         /* Can't use wwin-frame->bottom_width because, in some cases
83322e0
--- WindowMaker-0.91.0/src/placement.c.vns	2004-10-23 03:58:59 +0400
83322e0
+++ WindowMaker-0.91.0/src/placement.c	2005-05-18 15:57:35 +0400
83322e0
@@ -594,6 +594,9 @@
83322e0
 {
83322e0
     WScreen *scr = wwin->screen_ptr;
83322e0
     int h = WMFontHeight(scr->title_font) + (wPreferences.window_title_clearance + TITLEBAR_EXTEND_SPACE) * 2;
83322e0
+    if(h > wPreferences.window_title_max_height) h = wPreferences.window_title_max_height;
83322e0
+    if(h < wPreferences.window_title_min_height) h = wPreferences.window_title_min_height;
83322e0
+
83322e0
     WArea usableArea = wGetUsableAreaForHead(scr,
83322e0
                                              wGetHeadForPointerLocation(scr),
83322e0
                                              NULL, True);