2 * Copyright 1989 Massachusetts Institute of Technology
4 * Permission to use, copy, modify, and distribute this software and its
5 * documentation for any purpose and without fee is hereby granted, provided
6 * that the above copyright notice appear in all copies and that both that
7 * copyright notice and this permission notice appear in supporting
8 * documentation, and that the name of M.I.T. not be used in advertising
9 * or publicity pertaining to distribution of the software without specific,
10 * written prior permission. M.I.T. makes no representations about the
11 * suitability of this software for any purpose. It is provided "as is"
12 * without express or implied warranty.
14 * M.I.T. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL
15 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL M.I.T.
16 * BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
17 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
18 * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
19 * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
22 /***********************************************************************
24 * $XConsortium: iconmgr.c,v 1.48 91/09/10 15:27:07 dave Exp $
26 * Icon Manager routines
28 * 09-Mar-89 Tom LaStrange File Created
30 ***********************************************************************/
40 #include "add_window.h"
42 #include <X11/Xmu/CharSet.h>
45 int strcmp(); /* missing from string.h in AUX 2.0 */
48 #define strdup Strdup /* avoid conflict with system header files */
49 extern char *strdup(char *);
52 static int ComputeIconMgrWindowHeight();
54 /* see AddIconManager() - djhjr - 5/5/98
55 int iconmgr_textx = siconify_width+11;
57 int iconmgr_iconx = 0, iconmgr_textx = 0;
60 WList *DownIconManager = NULL;
62 /* was an external file - djhjr - 10/30/02 */
63 #define siconify_width 11
64 #define siconify_height 11
66 static unsigned char siconify_bits[] = {
67 0xff, 0x07, 0x01, 0x04, 0x0d, 0x05, 0x9d, 0x05, 0xb9, 0x04, 0x51, 0x04,
68 0xe9, 0x04, 0xcd, 0x05, 0x85, 0x05, 0x01, 0x04, 0xff, 0x07};
71 int iconifybox_width = siconify_width;
72 int iconifybox_height = siconify_height;
74 /* djhjr - 10/30/02 */
75 void SetIconMgrPixmap(filename)
78 Scr->iconMgrIconName = filename;
81 /***********************************************************************
84 * CreateIconManagers - creat all the icon manager windows
93 ***********************************************************************
103 Pixmap Create3DIconManagerIcon (cp)
108 static struct Colori *colori = NULL;
110 w = (unsigned int) siconify_width;
111 h = (unsigned int) siconify_height;
113 for (col = colori; col; col = col->next) {
114 if (col->color == cp.back) break;
116 if (col != NULL) return (col->pix);
117 col = (struct Colori*) malloc (sizeof (struct Colori));
118 col->color = cp.back;
119 col->pix = XCreatePixmap (dpy, Scr->Root, w, h, Scr->d_depth);
120 #ifdef ORIGINAL_ICONMGRPIXMAP
121 Draw3DBorder (col->pix, 0, 0, w, h, 4, cp, off, True, False);
123 Draw3DBorder (col->pix, 0, 0, w, h, 1, cp, off, True, False);
125 Draw3DBorder (col->pix, (w / 2) - 1, (h / 2) - 1, 3, 3, 1, cp, off, True, False);
131 return (colori->pix);
135 void CreateIconManagers()
137 XClassHint *class; /* djhjr - 2/28/99 */
145 if (Scr->NoIconManagers)
149 if (Scr->siconifyPm == None)
151 Scr->siconifyPm->pixmap = XCreatePixmapFromBitmapData(dpy, Scr->Root,
152 (char *)siconify_bits, siconify_width, siconify_height, 1, 0, 1);
156 for (p = &Scr->iconmgr; p != NULL; p = p->next)
158 mask = XParseGeometry(p->geometry, &JunkX, &JunkY,
159 (unsigned int *) &p->width, (unsigned int *)&p->height);
162 if (p->width > Scr->MyDisplayWidth) p->width = Scr->MyDisplayWidth;
164 if (mask & XNegative)
166 JunkX = Scr->MyDisplayWidth - p->width -
167 (2 * Scr->BorderWidth) + JunkX;
170 JunkX += Scr->MyDisplayWidth - p->width -
171 (2 * (Scr->ThreeDBorderWidth ? Scr->ThreeDBorderWidth : Scr->BorderWidth));
173 JunkX += Scr->MyDisplayWidth - p->width -
174 (2 * Scr->BorderWidth);
176 if (mask & YNegative)
178 JunkY = Scr->MyDisplayHeight - p->height -
179 (2 * Scr->BorderWidth) + JunkY;
182 JunkY += Scr->MyDisplayHeight - p->height -
183 (2 * (Scr->ThreeDBorderWidth ? Scr->ThreeDBorderWidth : Scr->BorderWidth));
185 JunkY += Scr->MyDisplayHeight - p->height -
186 (2 * Scr->BorderWidth);
188 /* djhjr - 9/10/98 */
189 if (p->width < 1) p->width = 1;
190 if (p->height < 1) p->height = 1;
192 background = Scr->IconManagerC.back;
193 GetColorFromList(Scr->IconManagerBL, p->name, (XClassHint *)NULL,
196 p->w = XCreateSimpleWindow(dpy, Scr->Root,
197 JunkX, JunkY, p->width, p->height,
199 0, /* was '1' - submitted by Rolf Neugebauer */
201 Scr->Black, background);
203 sprintf(str, "%s Icon Manager", p->name);
204 sprintf(str1, "%s Icons", p->name);
206 icon_name = p->icon_name;
210 /* djhjr - 5/19/98 */
211 /* was setting for the TwmWindow after AddWindow() - djhjr - 2/28/99 */
212 class = XAllocClassHint();
213 class->res_name = strdup(str);
214 class->res_class = strdup(VTWM_ICONMGR_CLASS);
215 XSetClassHint(dpy, p->w, class);
217 XSetStandardProperties(dpy, p->w, str, icon_name, None, NULL, 0, NULL);
219 p->twm_win = AddWindow(p->w, TRUE, p);
221 SetMapStateProp (p->twm_win, WithdrawnState);
223 for (p = &Scr->iconmgr; p != NULL; p = p->next)
225 GrabButtons(p->twm_win);
226 GrabKeys(p->twm_win);
230 /***********************************************************************
233 * AllocateIconManager - allocate a new icon manager
236 * name - the name of this icon manager
237 * icon_name - the name of the associated icon
238 * geom - a geometry string to eventually parse
239 * columns - the number of columns this icon manager has
241 ***********************************************************************
244 IconMgr *AllocateIconManager(name, icon_name, geom, columns)
253 fprintf(stderr, "AllocateIconManager\n");
254 fprintf(stderr, " name=\"%s\" icon_name=\"%s\", geom=\"%s\", col=%d\n",
255 name, icon_name, geom, columns);
258 if (Scr->NoIconManagers)
261 p = (IconMgr *)malloc(sizeof(IconMgr));
263 p->icon_name = icon_name;
265 p->columns = columns;
276 Scr->iconmgr.lasti->next = p;
277 p->prev = Scr->iconmgr.lasti;
278 Scr->iconmgr.lasti = p;
284 /***********************************************************************
287 * MoveIconManager - move the pointer around in an icon manager
290 * dir - one of the following:
291 * F_FORWICONMGR - forward in the window list
292 * F_BACKICONMGR - backward in the window list
293 * F_UPICONMGR - up one row
294 * F_DOWNICONMGR - down one row
295 * F_LEFTICONMGR - left one column
296 * F_RIGHTICONMGR - right one column
298 * Special Considerations:
301 ***********************************************************************
304 void MoveIconManager(dir)
309 int cur_row, cur_col, new_row, new_col;
310 int row_inc, col_inc;
315 cur_row = Active->row;
316 cur_col = Active->col;
317 ip = Active->iconmgr;
326 if ((tmp = Active->next) == NULL)
332 if ((tmp = Active->prev) == NULL)
354 /* If got_it is FALSE ast this point then we got a left, right,
355 * up, or down, command. We will enter this loop until we find
356 * a window to warp to.
366 new_row = ip->cur_rows - 1;
368 new_col = ip->cur_columns - 1;
369 if (new_row >= ip->cur_rows)
371 if (new_col >= ip->cur_columns)
374 /* Now let's go through the list to see if there is an entry with this
377 for (tmp = ip->first; tmp != NULL; tmp = tmp->next)
379 if (tmp->row == new_row && tmp->col == new_col)
390 "%s: unable to find window (%d, %d) in icon manager\n",
391 ProgramName, new_row, new_col);
398 /* raise the frame so the icon manager is visible */
399 if (ip->twm_win->mapped) {
400 XRaiseWindow(dpy, ip->twm_win->frame);
406 XWarpPointer(dpy, None, tmp->icon, 0,0,0,0, 5, 5);
408 WarpInIconMgr(tmp, ip->twm_win);
411 if (tmp->twm->title_height) {
412 int tbx = Scr->TBInfo.titlex;
413 int x = tmp->twm->highlightx;
414 XWarpPointer (dpy, None, tmp->twm->title_w, 0, 0, 0, 0,
416 Scr->TitleHeight / 4);
418 XWarpPointer (dpy, None, tmp->twm->w, 0, 0, 0, 0, 5, 5);
421 RaiseStickyAbove(); /* DSE */
424 WarpToWindow(tmp->twm);
428 /***********************************************************************
431 * JumpIconManager - jump from one icon manager to another,
432 * possibly even on another screen
435 * dir - one of the following:
436 * F_NEXTICONMGR - go to the next icon manager
437 * F_PREVICONMGR - go to the previous one
439 ***********************************************************************
442 void JumpIconManager(dir)
445 IconMgr *ip, *tmp_ip = NULL;
453 #define ITER(i) (dir == F_NEXTICONMGR ? (i)->next : (i)->prev)
454 #define IPOFSP(sp) (dir == F_NEXTICONMGR ? &(sp->iconmgr) : sp->iconmgr.lasti)
455 #define TEST(ip) if ((ip)->count != 0 && (ip)->twm_win->mapped) \
456 { got_it = TRUE; break; }
458 ip = Active->iconmgr;
459 for (tmp_ip = ITER(ip); tmp_ip; tmp_ip = ITER(tmp_ip)) {
464 int origscreen = ip->scr->screen;
465 int inc = (dir == F_NEXTICONMGR ? 1 : -1);
467 for (screen = origscreen + inc; ; screen += inc) {
468 if (screen >= NumScreens)
471 screen = NumScreens - 1;
473 sp = ScreenList[screen];
475 for (tmp_ip = IPOFSP (sp); tmp_ip; tmp_ip = ITER(tmp_ip)) {
479 if (got_it || screen == origscreen) break;
488 DoAudible(); /* was 'XBell()' - djhjr - 6/22/01 */
492 /* raise the frame so it is visible */
493 XRaiseWindow(dpy, tmp_ip->twm_win->frame);
496 RaiseStickyAbove(); * DSE *
502 XWarpPointer(dpy, None, tmp_ip->active->icon, 0,0,0,0, 5, 5);
504 WarpInIconMgr(tmp_ip->active, tmp_ip->twm_win);
507 XWarpPointer(dpy, None, tmp_ip->w, 0,0,0,0, 5, 5);
510 RaiseStickyAbove(); /* DSE */
513 WarpToWindow(tmp_ip->twm_win);
517 /***********************************************************************
520 * AddIconManager - add a window to an icon manager
523 * tmp_win - the TwmWindow structure
525 ***********************************************************************
528 WList *AddIconManager(tmp_win)
533 unsigned long valuemask; /* mask for create windows */
534 XSetWindowAttributes attributes; /* attributes for create windows */
537 tmp_win->list = NULL;
539 /* djhjr - 10/2/01 */
540 if (Scr->StrictIconManager)
542 if (tmp_win->icon || (!tmp_win->iconified &&
544 (tmp_win->wmhints->flags & StateHint) &&
545 tmp_win->wmhints->initial_state == IconicState)))
551 if (tmp_win->iconmgr || tmp_win->transient || Scr->NoIconManagers)
554 if (LookInList(Scr->IconMgrNoShow, tmp_win->full_name, &tmp_win->class))
556 if (Scr->IconManagerDontShow &&
557 !LookInList(Scr->IconMgrShow, tmp_win->full_name, &tmp_win->class))
559 if ((ip = (IconMgr *)LookInList(Scr->IconMgrs, tmp_win->full_name,
560 &tmp_win->class)) == NULL)
563 tmp = (WList *) malloc(sizeof(WList));
569 InsertInIconManager(ip, tmp, tmp_win);
574 tmp->fore = Scr->IconManagerC.fore;
575 tmp->back = Scr->IconManagerC.back;
577 tmp->cp.fore = Scr->IconManagerC.fore;
578 tmp->cp.back = Scr->IconManagerC.back;
580 tmp->highlight = Scr->IconManagerHighlight;
583 GetColorFromList(Scr->IconManagerFL, tmp_win->full_name, &tmp_win->class,
585 GetColorFromList(Scr->IconManagerBL, tmp_win->full_name, &tmp_win->class,
588 GetColorFromList(Scr->IconManagerFL, tmp_win->full_name, &tmp_win->class,
590 GetColorFromList(Scr->IconManagerBL, tmp_win->full_name, &tmp_win->class,
593 GetColorFromList(Scr->IconManagerHighlightL, tmp_win->full_name,
594 &tmp_win->class, &tmp->highlight);
596 /* djhjr - 4/19/96 */
597 /* was 'Scr->use3Diconmanagers' - djhjr - 8/11/98 */
599 if (Scr->IconMgrBevelWidth > 0)
602 if (!Scr->BeNiceToColormap) GetShadeColors (&tmp->cp);
604 tmp->iconifypm = Create3DIconManagerIcon (tmp->cp);
606 tmp->iconifypm = GetImage(Scr->iconMgrIconName,
607 iconifybox_width, iconifybox_height,
612 h = ComputeIconMgrWindowHeight();
614 ip->height = h * ip->count;
619 valuemask = (CWBackPixel | CWBorderPixel | CWEventMask | CWCursor);
622 attributes.background_pixel = tmp->back;
623 attributes.border_pixel = tmp->back;
625 attributes.background_pixel = tmp->cp.back;
626 attributes.border_pixel = tmp->cp.back;
628 attributes.event_mask = (KeyPressMask | ButtonPressMask |
629 ButtonReleaseMask | ExposureMask |
630 EnterWindowMask | LeaveWindowMask);
631 attributes.cursor = Scr->IconMgrCursor;
633 /* djhjr - 9/17/96 */
634 if (Scr->BackingStore)
636 attributes.backing_store = WhenMapped;
637 valuemask |= CWBackingStore;
640 tmp->w = XCreateWindow (dpy, ip->w, 0, 0, (unsigned int) 1,
641 (unsigned int) h, (unsigned int) 0,
642 CopyFromParent, (unsigned int) CopyFromParent,
643 (Visual *) CopyFromParent, valuemask, &attributes);
646 valuemask = (CWBackPixel | CWBorderPixel | CWEventMask | CWCursor);
649 attributes.background_pixel = tmp->back;
651 attributes.background_pixel = tmp->cp.back;
653 attributes.border_pixel = Scr->Black;
654 attributes.event_mask = (ButtonReleaseMask| ButtonPressMask |
656 attributes.cursor = Scr->ButtonCursor;
661 /* was 'Scr->use3Diconmanagers' - djhjr - 8/11/98 */
662 if (Scr->IconMgrBevelWidth > 0)
663 iconmgr_iconx = Scr->IconMgrBevelWidth + 5;
665 iconmgr_iconx = Scr->BorderWidth + 5;
666 iconmgr_textx = iconmgr_iconx + siconify_width + 5;
669 /* 'iconmgr_iconx' was '5' - djhjr - 5/5/98 */
670 tmp->icon = XCreateWindow (dpy, tmp->w, iconmgr_iconx, (int) (h - siconify_height)/2,
671 (unsigned int) siconify_width,
672 (unsigned int) siconify_height,
673 (unsigned int) 0, CopyFromParent,
674 (unsigned int) CopyFromParent,
675 (Visual *) CopyFromParent,
676 valuemask, &attributes);
680 XMapWindow(dpy, tmp->w);
682 XSaveContext(dpy, tmp->w, IconManagerContext, (caddr_t) tmp);
683 XSaveContext(dpy, tmp->w, TwmContext, (caddr_t) tmp_win);
684 XSaveContext(dpy, tmp->w, ScreenContext, (caddr_t) Scr);
685 XSaveContext(dpy, tmp->icon, TwmContext, (caddr_t) tmp_win);
686 XSaveContext(dpy, tmp->icon, ScreenContext, (caddr_t) Scr);
689 if (!ip->twm_win->icon)
691 XMapWindow(dpy, ip->w);
692 XMapWindow(dpy, ip->twm_win->frame);
695 /* djhjr - 9/21/99 */
697 XMapWindow(dpy, ip->twm_win->icon_w);
702 /***********************************************************************
705 * InsertInIconManager - put an allocated entry into an icon
709 * ip - the icon manager pointer
710 * tmp - the entry to insert
712 ***********************************************************************
715 void InsertInIconManager(ip, tmp, tmp_win)
722 int (*compar)() = (Scr->CaseSensitive ? strcmp : XmuCompareISOLatin1);
725 if (ip->first == NULL)
732 else if (Scr->SortIconMgr)
734 for (tmp1 = ip->first; tmp1 != NULL; tmp1 = tmp1->next)
736 if ((*compar)(tmp_win->icon_name, tmp1->twm->icon_name) < 0)
739 tmp->prev = tmp1->prev;
741 if (tmp->prev == NULL)
744 tmp->prev->next = tmp;
753 ip->last->next = tmp;
754 tmp->prev = ip->last;
759 void RemoveFromIconManager(ip, tmp)
763 if (tmp->prev == NULL)
764 ip->first = tmp->next;
766 tmp->prev->next = tmp->next;
768 if (tmp->next == NULL)
769 ip->last = tmp->prev;
771 tmp->next->prev = tmp->prev;
774 /***********************************************************************
777 * RemoveIconManager - remove a window from the icon manager
780 * tmp_win - the TwmWindow structure
782 ***********************************************************************
785 void RemoveIconManager(tmp_win)
791 if (tmp_win->list == NULL)
796 /* submitted by Jonathan Paisley - 11/11/02 */
801 * Believe it or not, the kludge in events.c:HandleKeyPress() needs
802 * this, or a window that's been destroyed still registers there,
803 * even though the whole mess gets freed in just a few microseconds!
808 * Somehwere alone the line, whatever it was got fixed, and this is
809 * needed again - djhjr - 5/27/03
811 /*#ifdef NEVER*/ /* warps to icon managers uniquely handled in menus.c:WarpToWindow() */
813 tmp->iconmgr->active = NULL;
816 tmp_win->list = NULL;
819 RemoveFromIconManager(ip, tmp);
821 XDeleteContext(dpy, tmp->icon, TwmContext);
822 XDeleteContext(dpy, tmp->icon, ScreenContext);
823 XDestroyWindow(dpy, tmp->icon);
824 XDeleteContext(dpy, tmp->w, IconManagerContext);
825 XDeleteContext(dpy, tmp->w, TwmContext);
826 XDeleteContext(dpy, tmp->w, ScreenContext);
827 XDestroyWindow(dpy, tmp->w);
830 #ifdef NEVER /* can't do this, else we lose the button entirely! */
831 /* about damn time I did this! - djhjr - 6/5/98 */
832 XFreePixmap(dpy, tmp->iconifypm);
841 /* djhjr - 9/21/99 */
842 if (ip->twm_win->icon)
843 XUnmapWindow(dpy, ip->twm_win->icon_w);
846 XUnmapWindow(dpy, ip->twm_win->frame);
851 void ActiveIconManager(active)
854 active->active = TRUE;
856 Active->iconmgr->active = active;
859 DrawIconManagerBorder(active);
861 DrawIconManagerBorder(active, False);
864 void NotActiveIconManager(active)
867 active->active = FALSE;
870 DrawIconManagerBorder(active);
872 DrawIconManagerBorder(active, False);
876 void DrawIconManagerBorder(tmp)
879 void DrawIconManagerBorder(tmp, fill)
883 /* was 'Scr->use3Diconmanagers' - djhjr - 8/11/98 */
884 if (Scr->IconMgrBevelWidth > 0) {
890 shadow_width = Scr->IconMgrBevelWidth;
893 if (tmp->active && Scr->Highlight)
895 if (tmp->active && Scr->IconMgrHighlight)
896 Draw3DBorder (tmp->w, 0, 0, tmp->width, tmp->height, shadow_width,
897 tmp->cp, on, fill, False);
899 Draw3DBorder (tmp->w, 0, 0, tmp->width, tmp->height, shadow_width,
900 tmp->cp, off, fill, False);
904 XSetForeground(dpy, Scr->NormalGC, tmp->fore);
906 XSetForeground(dpy, Scr->NormalGC, tmp->cp.fore);
907 XDrawRectangle(dpy, tmp->w, Scr->NormalGC, 2, 2,
908 tmp->width-5, tmp->height-5);
911 if (tmp->active && Scr->Highlight)
913 if (tmp->active && Scr->IconMgrHighlight)
914 XSetForeground(dpy, Scr->NormalGC, tmp->highlight);
917 XSetForeground(dpy, Scr->NormalGC, tmp->back);
919 XSetForeground(dpy, Scr->NormalGC, tmp->cp.back);
921 XDrawRectangle(dpy, tmp->w, Scr->NormalGC, 0, 0,
922 tmp->width-1, tmp->height-1);
923 XDrawRectangle(dpy, tmp->w, Scr->NormalGC, 1, 1,
924 tmp->width-3, tmp->height-3);
928 /***********************************************************************
931 * SortIconManager - sort the dude
934 * ip - a pointer to the icon manager struture
936 ***********************************************************************
939 void SortIconManager(ip)
944 int (*compar)() = (Scr->CaseSensitive ? strcmp : XmuCompareISOLatin1);
947 ip = Active->iconmgr;
952 for (tmp1 = ip->first; tmp1 != NULL; tmp1 = tmp1->next)
954 if ((tmp2 = tmp1->next) == NULL)
959 if ((*compar)(tmp1->twm->icon_name, tmp2->twm->icon_name) > 0)
961 /* take it out and put it back in */
962 RemoveFromIconManager(ip, tmp2);
963 InsertInIconManager(ip, tmp2, tmp2->twm);
972 /***********************************************************************
975 * PackIconManager - pack the icon manager windows following
976 * an addition or deletion
979 * ip - a pointer to the icon manager struture
981 ***********************************************************************
984 void PackIconManager(ip)
987 int newwidth, i, row, col, maxcol, colinc, rowinc, wheight, wwidth;
993 wheight = ComputeIconMgrWindowHeight();
995 wwidth = ip->width / ip->columns;
1003 for (i = 0, tmp = ip->first; tmp != NULL; i++, tmp = tmp->next)
1006 if (++col >= ip->columns)
1014 new_x = col * colinc;
1015 new_y = (row-1) * rowinc;
1017 /* if the position or size has not changed, don't touch it */
1018 if (tmp->x != new_x || tmp->y != new_y ||
1019 tmp->width != wwidth || tmp->height != wheight)
1021 XMoveResizeWindow(dpy, tmp->w, new_x, new_y, wwidth, wheight);
1027 tmp->width = wwidth;
1028 tmp->height = wheight;
1034 ip->cur_columns = maxcol;
1035 ip->height = row * rowinc;
1036 if (ip->height == 0)
1037 ip->height = rowinc;
1038 newwidth = maxcol * colinc;
1042 XResizeWindow(dpy, ip->w, newwidth, ip->height);
1044 savewidth = ip->width;
1048 /* limit the min and max sizes of an icon manager - djhjr - 3/1/99 */
1049 ip->twm_win->hints.flags |= (PMinSize | PMaxSize);
1050 ip->twm_win->hints.min_width = maxcol * (2 * iconmgr_iconx + siconify_width);
1051 ip->twm_win->hints.min_height = ip->height;
1052 ip->twm_win->hints.max_width = Scr->MyDisplayWidth;
1053 ip->twm_win->hints.max_height = ip->height;
1056 SetupWindow (ip->twm_win,
1057 ip->twm_win->frame_x, ip->twm_win->frame_y,
1058 newwidth, ip->height + ip->twm_win->title_height, -1);
1060 SetupWindow (ip->twm_win,
1061 ip->twm_win->frame_x, ip->twm_win->frame_y,
1062 newwidth + 2 * ip->twm_win->frame_bw3D,
1063 ip->height + ip->twm_win->title_height + 2 * ip->twm_win->frame_bw3D, -1);
1066 ip->width = savewidth;
1070 * ComputeIconMgrWindowHeight()
1071 * scale the icon manager window height to the font used
1075 static int ComputeIconMgrWindowHeight()
1079 /* was 'Scr->use3Diconmanagers' - djhjr - 8/11/98 */
1080 if (Scr->IconMgrBevelWidth > 0)
1082 h = Scr->IconManagerFont.height + 2 * Scr->IconMgrBevelWidth + 4;
1083 if (h < (siconify_height + 2 * Scr->IconMgrBevelWidth + 4))
1084 h = siconify_height + 2 * Scr->IconMgrBevelWidth + 4;
1088 h = Scr->IconManagerFont.height + 10;
1089 if (h < (siconify_height + 4))
1090 h = siconify_height + 4;
1093 /* make height be odd so buttons look nice and centered */