From b15bee6dd5c540fc6a15c7e76ecadcd6efffc42a Mon Sep 17 00:00:00 2001 From: rubidium Date: Sat, 28 Jul 2007 20:59:30 +0000 Subject: (svn r10716) -Codechange: not all windows' minimum size is actually their minimum size, so take the size of the window after WE_CREATE has been called as bare minimum size. --- src/window.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'src/window.cpp') diff --git a/src/window.cpp b/src/window.cpp index 3ba38a03a..9d400dd83 100644 --- a/src/window.cpp +++ b/src/window.cpp @@ -656,8 +656,12 @@ static Window *LocalAllocateWindow( CallWindowEventNP(w, WE_CREATE); - /* Try to make windows smaller when our window is too small */ - if (min_width != def_width || min_height != def_height) { + /* Try to make windows smaller when our window is too small. + * w->(width|height) is normally the same as min_(width|height), + * but this way the GUIs can be made a little more dynamic; + * one can use the same spec for multiple windows and those + * can then determine the real minimum size of the window. */ + if (w->width != def_width || w->height != def_height) { /* Think about the overlapping toolbars when determining the minimum window size */ int free_height = _screen.height; const Window *wt = FindWindowById(WC_STATUS_BAR, 0); @@ -665,8 +669,8 @@ static Window *LocalAllocateWindow( wt = FindWindowById(WC_MAIN_TOOLBAR, 0); if (wt != NULL) free_height -= wt->height; - int enlarge_x = max(min(def_width - min_width, _screen.width - min_width), 0); - int enlarge_y = max(min(def_height - min_height, free_height - min_height), 0); + int enlarge_x = max(min(def_width - w->width, _screen.width - w->width), 0); + int enlarge_y = max(min(def_height - w->height, free_height - w->height), 0); /* X and Y has to go by step.. calculate it. * The cast to int is necessary else x/y are implicitly casted to -- cgit v1.2.3-54-g00ecf