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 */
49 static int ComputeIconMgrWindowHeight();
51 /* see AddIconManager() - djhjr - 5/5/98
52 int iconmgr_textx = siconify_width+11;
54 int iconmgr_iconx = 0, iconmgr_textx = 0;
57 WList *DownIconManager = NULL;
59 /* was an external file - djhjr - 10/30/02 */
60 #define siconify_width 11
61 #define siconify_height 11
63 static unsigned char siconify_bits[] = {
64 0xff, 0x07, 0x01, 0x04, 0x0d, 0x05, 0x9d, 0x05, 0xb9, 0x04, 0x51, 0x04,
65 0xe9, 0x04, 0xcd, 0x05, 0x85, 0x05, 0x01, 0x04, 0xff, 0x07};
68 int iconifybox_width = siconify_width;
69 int iconifybox_height = siconify_height;
71 /* djhjr - 10/30/02 */
72 void SetIconMgrPixmap(filename)
75 Scr->iconMgrIconName = filename;
78 /***********************************************************************
81 * CreateIconManagers - creat all the icon manager windows
90 ***********************************************************************
100 Pixmap Create3DIconManagerIcon (cp)
105 static struct Colori *colori = NULL;
107 w = (unsigned int) siconify_width;
108 h = (unsigned int) siconify_height;
110 for (col = colori; col; col = col->next) {
111 if (col->color == cp.back) break;
113 if (col != NULL) return (col->pix);
114 col = (struct Colori*) malloc (sizeof (struct Colori));
115 col->color = cp.back;
116 col->pix = XCreatePixmap (dpy, Scr->Root, w, h, Scr->d_depth);
117 #ifdef ORIGINAL_ICONMGRPIXMAP
118 Draw3DBorder (col->pix, 0, 0, w, h, 4, cp, off, True, False);
120 Draw3DBorder (col->pix, 0, 0, w, h, 1, cp, off, True, False);
122 Draw3DBorder (col->pix, (w / 2) - 1, (h / 2) - 1, 3, 3, 1, cp, off, True, False);
128 return (colori->pix);
132 void CreateIconManagers()
134 XClassHint *class; /* djhjr - 2/28/99 */
142 if (Scr->NoIconManagers)
146 if (Scr->siconifyPm == None)
148 Scr->siconifyPm->pixmap = XCreatePixmapFromBitmapData(dpy, Scr->Root,
149 (char *)siconify_bits, siconify_width, siconify_height, 1, 0, 1);
153 for (p = &Scr->iconmgr; p != NULL; p = p->next)
155 mask = XParseGeometry(p->geometry, &JunkX, &JunkY,
156 (unsigned int *) &p->width, (unsigned int *)&p->height);
159 if (p->width > Scr->MyDisplayWidth) p->width = Scr->MyDisplayWidth;
161 if (mask & XNegative)
163 JunkX = Scr->MyDisplayWidth - p->width -
164 (2 * Scr->BorderWidth) + JunkX;
167 JunkX += Scr->MyDisplayWidth - p->width -
168 (2 * (Scr->ThreeDBorderWidth ? Scr->ThreeDBorderWidth : Scr->BorderWidth));
170 JunkX += Scr->MyDisplayWidth - p->width -
171 (2 * Scr->BorderWidth);
173 if (mask & YNegative)
175 JunkY = Scr->MyDisplayHeight - p->height -
176 (2 * Scr->BorderWidth) + JunkY;
179 JunkY += Scr->MyDisplayHeight - p->height -
180 (2 * (Scr->ThreeDBorderWidth ? Scr->ThreeDBorderWidth : Scr->BorderWidth));
182 JunkY += Scr->MyDisplayHeight - p->height -
183 (2 * Scr->BorderWidth);
185 /* djhjr - 9/10/98 */
186 if (p->width < 1) p->width = 1;
187 if (p->height < 1) p->height = 1;
189 background = Scr->IconManagerC.back;
190 GetColorFromList(Scr->IconManagerBL, p->name, (XClassHint *)NULL,
193 p->w = XCreateSimpleWindow(dpy, Scr->Root,
194 JunkX, JunkY, p->width, p->height,
196 0, /* was '1' - submitted by Rolf Neugebauer */
198 Scr->Black, background);
200 sprintf(str, "%s Icon Manager", p->name);
201 sprintf(str1, "%s Icons", p->name);
203 icon_name = p->icon_name;
207 /* djhjr - 5/19/98 */
208 /* was setting for the TwmWindow after AddWindow() - djhjr - 2/28/99 */
209 class = XAllocClassHint();
210 class->res_name = strdup(str);
211 class->res_class = strdup(VTWM_ICONMGR_CLASS);
212 XSetClassHint(dpy, p->w, class);
214 XSetStandardProperties(dpy, p->w, str, icon_name, None, NULL, 0, NULL);
216 p->twm_win = AddWindow(p->w, TRUE, p);
218 SetMapStateProp (p->twm_win, WithdrawnState);
220 for (p = &Scr->iconmgr; p != NULL; p = p->next)
222 GrabButtons(p->twm_win);
223 GrabKeys(p->twm_win);
227 /***********************************************************************
230 * AllocateIconManager - allocate a new icon manager
233 * name - the name of this icon manager
234 * icon_name - the name of the associated icon
235 * geom - a geometry string to eventually parse
236 * columns - the number of columns this icon manager has
238 ***********************************************************************
241 IconMgr *AllocateIconManager(name, icon_name, geom, columns)
250 fprintf(stderr, "AllocateIconManager\n");
251 fprintf(stderr, " name=\"%s\" icon_name=\"%s\", geom=\"%s\", col=%d\n",
252 name, icon_name, geom, columns);
255 if (Scr->NoIconManagers)
258 p = (IconMgr *)malloc(sizeof(IconMgr));
260 p->icon_name = icon_name;
262 p->columns = columns;
273 Scr->iconmgr.lasti->next = p;
274 p->prev = Scr->iconmgr.lasti;
275 Scr->iconmgr.lasti = p;
281 /***********************************************************************
284 * MoveIconManager - move the pointer around in an icon manager
287 * dir - one of the following:
288 * F_FORWICONMGR - forward in the window list
289 * F_BACKICONMGR - backward in the window list
290 * F_UPICONMGR - up one row
291 * F_DOWNICONMGR - down one row
292 * F_LEFTICONMGR - left one column
293 * F_RIGHTICONMGR - right one column
295 * Special Considerations:
298 ***********************************************************************
301 void MoveIconManager(dir)
306 int cur_row, cur_col, new_row, new_col;
307 int row_inc, col_inc;
312 cur_row = Active->row;
313 cur_col = Active->col;
314 ip = Active->iconmgr;
323 if ((tmp = Active->next) == NULL)
329 if ((tmp = Active->prev) == NULL)
351 /* If got_it is FALSE ast this point then we got a left, right,
352 * up, or down, command. We will enter this loop until we find
353 * a window to warp to.
363 new_row = ip->cur_rows - 1;
365 new_col = ip->cur_columns - 1;
366 if (new_row >= ip->cur_rows)
368 if (new_col >= ip->cur_columns)
371 /* Now let's go through the list to see if there is an entry with this
374 for (tmp = ip->first; tmp != NULL; tmp = tmp->next)
376 if (tmp->row == new_row && tmp->col == new_col)
387 "%s: unable to find window (%d, %d) in icon manager\n",
388 ProgramName, new_row, new_col);
395 /* raise the frame so the icon manager is visible */
396 if (ip->twm_win->mapped) {
397 XRaiseWindow(dpy, ip->twm_win->frame);
403 XWarpPointer(dpy, None, tmp->icon, 0,0,0,0, 5, 5);
405 WarpInIconMgr(tmp, ip->twm_win);
408 if (tmp->twm->title_height) {
409 int tbx = Scr->TBInfo.titlex;
410 int x = tmp->twm->highlightx;
411 XWarpPointer (dpy, None, tmp->twm->title_w, 0, 0, 0, 0,
413 Scr->TitleHeight / 4);
415 XWarpPointer (dpy, None, tmp->twm->w, 0, 0, 0, 0, 5, 5);
418 RaiseStickyAbove(); /* DSE */
421 WarpToWindow(tmp->twm);
425 /***********************************************************************
428 * JumpIconManager - jump from one icon manager to another,
429 * possibly even on another screen
432 * dir - one of the following:
433 * F_NEXTICONMGR - go to the next icon manager
434 * F_PREVICONMGR - go to the previous one
436 ***********************************************************************
439 void JumpIconManager(dir)
442 IconMgr *ip, *tmp_ip = NULL;
450 #define ITER(i) (dir == F_NEXTICONMGR ? (i)->next : (i)->prev)
451 #define IPOFSP(sp) (dir == F_NEXTICONMGR ? &(sp->iconmgr) : sp->iconmgr.lasti)
452 #define TEST(ip) if ((ip)->count != 0 && (ip)->twm_win->mapped) \
453 { got_it = TRUE; break; }
455 ip = Active->iconmgr;
456 for (tmp_ip = ITER(ip); tmp_ip; tmp_ip = ITER(tmp_ip)) {
461 int origscreen = ip->scr->screen;
462 int inc = (dir == F_NEXTICONMGR ? 1 : -1);
464 for (screen = origscreen + inc; ; screen += inc) {
465 if (screen >= NumScreens)
468 screen = NumScreens - 1;
470 sp = ScreenList[screen];
472 for (tmp_ip = IPOFSP (sp); tmp_ip; tmp_ip = ITER(tmp_ip)) {
476 if (got_it || screen == origscreen) break;
485 DoAudible(); /* was 'XBell()' - djhjr - 6/22/01 */
489 /* raise the frame so it is visible */
490 XRaiseWindow(dpy, tmp_ip->twm_win->frame);
493 RaiseStickyAbove(); * DSE *
499 XWarpPointer(dpy, None, tmp_ip->active->icon, 0,0,0,0, 5, 5);
501 WarpInIconMgr(tmp_ip->active, tmp_ip->twm_win);
504 XWarpPointer(dpy, None, tmp_ip->w, 0,0,0,0, 5, 5);
507 RaiseStickyAbove(); /* DSE */
510 WarpToWindow(tmp_ip->twm_win);
514 /***********************************************************************
517 * AddIconManager - add a window to an icon manager
520 * tmp_win - the TwmWindow structure
522 ***********************************************************************
525 WList *AddIconManager(tmp_win)
530 unsigned long valuemask; /* mask for create windows */
531 XSetWindowAttributes attributes; /* attributes for create windows */
534 tmp_win->list = NULL;
536 /* djhjr - 10/2/01 */
537 if (Scr->StrictIconManager)
539 if (tmp_win->icon || (!tmp_win->iconified &&
541 (tmp_win->wmhints->flags & StateHint) &&
542 tmp_win->wmhints->initial_state == IconicState)))
548 if (tmp_win->iconmgr || tmp_win->transient || Scr->NoIconManagers)
551 if (LookInList(Scr->IconMgrNoShow, tmp_win->full_name, &tmp_win->class))
553 if (Scr->IconManagerDontShow &&
554 !LookInList(Scr->IconMgrShow, tmp_win->full_name, &tmp_win->class))
556 if ((ip = (IconMgr *)LookInList(Scr->IconMgrs, tmp_win->full_name,
557 &tmp_win->class)) == NULL)
560 tmp = (WList *) malloc(sizeof(WList));
566 InsertInIconManager(ip, tmp, tmp_win);
571 tmp->fore = Scr->IconManagerC.fore;
572 tmp->back = Scr->IconManagerC.back;
574 tmp->cp.fore = Scr->IconManagerC.fore;
575 tmp->cp.back = Scr->IconManagerC.back;
577 tmp->highlight = Scr->IconManagerHighlight;
580 GetColorFromList(Scr->IconManagerFL, tmp_win->full_name, &tmp_win->class,
582 GetColorFromList(Scr->IconManagerBL, tmp_win->full_name, &tmp_win->class,
585 GetColorFromList(Scr->IconManagerFL, tmp_win->full_name, &tmp_win->class,
587 GetColorFromList(Scr->IconManagerBL, tmp_win->full_name, &tmp_win->class,
590 GetColorFromList(Scr->IconManagerHighlightL, tmp_win->full_name,
591 &tmp_win->class, &tmp->highlight);
593 /* djhjr - 4/19/96 */
594 /* was 'Scr->use3Diconmanagers' - djhjr - 8/11/98 */
596 if (Scr->IconMgrBevelWidth > 0)
599 if (!Scr->BeNiceToColormap) GetShadeColors (&tmp->cp);
601 tmp->iconifypm = Create3DIconManagerIcon (tmp->cp);
603 tmp->iconifypm = GetImage(Scr->iconMgrIconName,
604 iconifybox_width, iconifybox_height,
609 h = ComputeIconMgrWindowHeight();
611 ip->height = h * ip->count;
616 valuemask = (CWBackPixel | CWBorderPixel | CWEventMask | CWCursor);
619 attributes.background_pixel = tmp->back;
620 attributes.border_pixel = tmp->back;
622 attributes.background_pixel = tmp->cp.back;
623 attributes.border_pixel = tmp->cp.back;
625 attributes.event_mask = (KeyPressMask | ButtonPressMask |
626 ButtonReleaseMask | ExposureMask |
627 EnterWindowMask | LeaveWindowMask);
628 attributes.cursor = Scr->IconMgrCursor;
630 /* djhjr - 9/17/96 */
631 if (Scr->BackingStore)
633 attributes.backing_store = WhenMapped;
634 valuemask |= CWBackingStore;
637 tmp->w = XCreateWindow (dpy, ip->w, 0, 0, (unsigned int) 1,
638 (unsigned int) h, (unsigned int) 0,
639 CopyFromParent, (unsigned int) CopyFromParent,
640 (Visual *) CopyFromParent, valuemask, &attributes);
643 valuemask = (CWBackPixel | CWBorderPixel | CWEventMask | CWCursor);
646 attributes.background_pixel = tmp->back;
648 attributes.background_pixel = tmp->cp.back;
650 attributes.border_pixel = Scr->Black;
651 attributes.event_mask = (ButtonReleaseMask| ButtonPressMask |
653 attributes.cursor = Scr->ButtonCursor;
658 /* was 'Scr->use3Diconmanagers' - djhjr - 8/11/98 */
659 if (Scr->IconMgrBevelWidth > 0)
660 iconmgr_iconx = Scr->IconMgrBevelWidth + 5;
662 iconmgr_iconx = Scr->BorderWidth + 5;
663 iconmgr_textx = iconmgr_iconx + siconify_width + 5;
666 /* 'iconmgr_iconx' was '5' - djhjr - 5/5/98 */
667 tmp->icon = XCreateWindow (dpy, tmp->w, iconmgr_iconx, (int) (h - siconify_height)/2,
668 (unsigned int) siconify_width,
669 (unsigned int) siconify_height,
670 (unsigned int) 0, CopyFromParent,
671 (unsigned int) CopyFromParent,
672 (Visual *) CopyFromParent,
673 valuemask, &attributes);
677 XMapWindow(dpy, tmp->w);
679 XSaveContext(dpy, tmp->w, IconManagerContext, (caddr_t) tmp);
680 XSaveContext(dpy, tmp->w, TwmContext, (caddr_t) tmp_win);
681 XSaveContext(dpy, tmp->w, ScreenContext, (caddr_t) Scr);
682 XSaveContext(dpy, tmp->icon, TwmContext, (caddr_t) tmp_win);
683 XSaveContext(dpy, tmp->icon, ScreenContext, (caddr_t) Scr);
686 if (!ip->twm_win->icon)
688 XMapWindow(dpy, ip->w);
689 XMapWindow(dpy, ip->twm_win->frame);
692 /* djhjr - 9/21/99 */
694 XMapWindow(dpy, ip->twm_win->icon_w);
699 /***********************************************************************
702 * InsertInIconManager - put an allocated entry into an icon
706 * ip - the icon manager pointer
707 * tmp - the entry to insert
709 ***********************************************************************
712 void InsertInIconManager(ip, tmp, tmp_win)
719 int (*compar)() = (Scr->CaseSensitive ? strcmp : XmuCompareISOLatin1);
722 if (ip->first == NULL)
729 else if (Scr->SortIconMgr)
731 for (tmp1 = ip->first; tmp1 != NULL; tmp1 = tmp1->next)
733 if ((*compar)(tmp_win->icon_name, tmp1->twm->icon_name) < 0)
736 tmp->prev = tmp1->prev;
738 if (tmp->prev == NULL)
741 tmp->prev->next = tmp;
750 ip->last->next = tmp;
751 tmp->prev = ip->last;
756 void RemoveFromIconManager(ip, tmp)
760 if (tmp->prev == NULL)
761 ip->first = tmp->next;
763 tmp->prev->next = tmp->next;
765 if (tmp->next == NULL)
766 ip->last = tmp->prev;
768 tmp->next->prev = tmp->prev;
771 /***********************************************************************
774 * RemoveIconManager - remove a window from the icon manager
777 * tmp_win - the TwmWindow structure
779 ***********************************************************************
782 void RemoveIconManager(tmp_win)
788 if (tmp_win->list == NULL)
793 /* submitted by Jonathan Paisley - 11/11/02 */
798 * Believe it or not, the kludge in events.c:HandleKeyPress() needs
799 * this, or a window that's been destroyed still registers there,
800 * even though the whole mess gets freed in just a few microseconds!
805 * Somehwere alone the line, whatever it was got fixed, and this is
806 * needed again - djhjr - 5/27/03
808 /*#ifdef NEVER*/ /* warps to icon managers uniquely handled in menus.c:WarpToWindow() */
810 tmp->iconmgr->active = NULL;
813 tmp_win->list = NULL;
816 RemoveFromIconManager(ip, tmp);
818 XDeleteContext(dpy, tmp->icon, TwmContext);
819 XDeleteContext(dpy, tmp->icon, ScreenContext);
820 XDestroyWindow(dpy, tmp->icon);
821 XDeleteContext(dpy, tmp->w, IconManagerContext);
822 XDeleteContext(dpy, tmp->w, TwmContext);
823 XDeleteContext(dpy, tmp->w, ScreenContext);
824 XDestroyWindow(dpy, tmp->w);
827 #ifdef NEVER /* can't do this, else we lose the button entirely! */
828 /* about damn time I did this! - djhjr - 6/5/98 */
829 XFreePixmap(dpy, tmp->iconifypm);
838 /* djhjr - 9/21/99 */
839 if (ip->twm_win->icon)
840 XUnmapWindow(dpy, ip->twm_win->icon_w);
843 XUnmapWindow(dpy, ip->twm_win->frame);
848 void ActiveIconManager(active)
851 active->active = TRUE;
853 Active->iconmgr->active = active;
856 DrawIconManagerBorder(active);
858 DrawIconManagerBorder(active, False);
861 void NotActiveIconManager(active)
864 active->active = FALSE;
867 DrawIconManagerBorder(active);
869 DrawIconManagerBorder(active, False);
873 void DrawIconManagerBorder(tmp)
876 void DrawIconManagerBorder(tmp, fill)
880 /* was 'Scr->use3Diconmanagers' - djhjr - 8/11/98 */
881 if (Scr->IconMgrBevelWidth > 0) {
887 shadow_width = Scr->IconMgrBevelWidth;
890 if (tmp->active && Scr->Highlight)
892 if (tmp->active && Scr->IconMgrHighlight)
893 Draw3DBorder (tmp->w, 0, 0, tmp->width, tmp->height, shadow_width,
894 tmp->cp, on, fill, False);
896 Draw3DBorder (tmp->w, 0, 0, tmp->width, tmp->height, shadow_width,
897 tmp->cp, off, fill, False);
901 XSetForeground(dpy, Scr->NormalGC, tmp->fore);
903 XSetForeground(dpy, Scr->NormalGC, tmp->cp.fore);
904 XDrawRectangle(dpy, tmp->w, Scr->NormalGC, 2, 2,
905 tmp->width-5, tmp->height-5);
908 if (tmp->active && Scr->Highlight)
910 if (tmp->active && Scr->IconMgrHighlight)
911 XSetForeground(dpy, Scr->NormalGC, tmp->highlight);
914 XSetForeground(dpy, Scr->NormalGC, tmp->back);
916 XSetForeground(dpy, Scr->NormalGC, tmp->cp.back);
918 XDrawRectangle(dpy, tmp->w, Scr->NormalGC, 0, 0,
919 tmp->width-1, tmp->height-1);
920 XDrawRectangle(dpy, tmp->w, Scr->NormalGC, 1, 1,
921 tmp->width-3, tmp->height-3);
925 /***********************************************************************
928 * SortIconManager - sort the dude
931 * ip - a pointer to the icon manager struture
933 ***********************************************************************
936 void SortIconManager(ip)
941 int (*compar)() = (Scr->CaseSensitive ? strcmp : XmuCompareISOLatin1);
944 ip = Active->iconmgr;
949 for (tmp1 = ip->first; tmp1 != NULL; tmp1 = tmp1->next)
951 if ((tmp2 = tmp1->next) == NULL)
956 if ((*compar)(tmp1->twm->icon_name, tmp2->twm->icon_name) > 0)
958 /* take it out and put it back in */
959 RemoveFromIconManager(ip, tmp2);
960 InsertInIconManager(ip, tmp2, tmp2->twm);
969 /***********************************************************************
972 * PackIconManager - pack the icon manager windows following
973 * an addition or deletion
976 * ip - a pointer to the icon manager struture
978 ***********************************************************************
981 void PackIconManager(ip)
984 int newwidth, i, row, col, maxcol, colinc, rowinc, wheight, wwidth;
990 wheight = ComputeIconMgrWindowHeight();
992 wwidth = ip->width / ip->columns;
1000 for (i = 0, tmp = ip->first; tmp != NULL; i++, tmp = tmp->next)
1003 if (++col >= ip->columns)
1011 new_x = col * colinc;
1012 new_y = (row-1) * rowinc;
1014 /* if the position or size has not changed, don't touch it */
1015 if (tmp->x != new_x || tmp->y != new_y ||
1016 tmp->width != wwidth || tmp->height != wheight)
1018 XMoveResizeWindow(dpy, tmp->w, new_x, new_y, wwidth, wheight);
1024 tmp->width = wwidth;
1025 tmp->height = wheight;
1031 ip->cur_columns = maxcol;
1032 ip->height = row * rowinc;
1033 if (ip->height == 0)
1034 ip->height = rowinc;
1035 newwidth = maxcol * colinc;
1039 XResizeWindow(dpy, ip->w, newwidth, ip->height);
1041 savewidth = ip->width;
1045 /* limit the min and max sizes of an icon manager - djhjr - 3/1/99 */
1046 ip->twm_win->hints.flags |= (PMinSize | PMaxSize);
1047 ip->twm_win->hints.min_width = maxcol * (2 * iconmgr_iconx + siconify_width);
1048 ip->twm_win->hints.min_height = ip->height;
1049 ip->twm_win->hints.max_width = Scr->MyDisplayWidth;
1050 ip->twm_win->hints.max_height = ip->height;
1053 SetupWindow (ip->twm_win,
1054 ip->twm_win->frame_x, ip->twm_win->frame_y,
1055 newwidth, ip->height + ip->twm_win->title_height, -1);
1057 SetupWindow (ip->twm_win,
1058 ip->twm_win->frame_x, ip->twm_win->frame_y,
1059 newwidth + 2 * ip->twm_win->frame_bw3D,
1060 ip->height + ip->twm_win->title_height + 2 * ip->twm_win->frame_bw3D, -1);
1063 ip->width = savewidth;
1067 * ComputeIconMgrWindowHeight()
1068 * scale the icon manager window height to the font used
1072 static int ComputeIconMgrWindowHeight()
1076 /* was 'Scr->use3Diconmanagers' - djhjr - 8/11/98 */
1077 if (Scr->IconMgrBevelWidth > 0)
1079 h = Scr->IconManagerFont.height + 2 * Scr->IconMgrBevelWidth + 4;
1080 if (h < (siconify_height + 2 * Scr->IconMgrBevelWidth + 4))
1081 h = siconify_height + 2 * Scr->IconMgrBevelWidth + 4;
1085 h = Scr->IconManagerFont.height + 10;
1086 if (h < (siconify_height + 4))
1087 h = siconify_height + 4;
1090 /* make height be odd so buttons look nice and centered */